Zrythm
a highly automated and intuitive digital audio workstation
|
Data Structures | |
struct | AudioFileMetadata |
struct | AudioFile |
Audio file struct. More... | |
struct | FileImportInfo |
struct | FileImport |
An object used for importing files asynchronously. More... | |
Macros | |
#define | FILE_IMPORT_TYPE (file_import_get_type ()) |
Functions | |
NONNULL AudioFile * | audio_file_new (const char *filepath) |
Creates a new instance of an AudioFile for the given path. | |
bool | audio_file_read_metadata (AudioFile *self, GError **error) |
Reads the metadata for the given file. | |
bool | audio_file_read_samples (AudioFile *self, bool in_parts, float *samples, size_t start_from, size_t num_frames_to_read, GError **error) |
Reads the file into an internal float array (interleaved). | |
NONNULL_ARGS (1) bool audio_file_finish(AudioFile *self | |
Must be called when done reading or writing files (or when the operation was cancelled). | |
bool | audio_file_read_simple (const char *filepath, float **frames, size_t *num_frames, AudioFileMetadata *metadata, size_t samplerate, GError **error) |
Simple blocking API for reading and optionally resampling audio files. | |
NONNULL void | audio_file_free (AudioFile *self) |
G_DECLARE_FINAL_TYPE (FileImport, file_import, Z, FILE_IMPORT, GObject) | |
FileImportInfo * | file_import_info_new (void) |
FileImportInfo * | file_import_info_clone (const FileImportInfo *src) |
void | file_import_info_free (FileImportInfo *self) |
FileImport * | file_import_new (const char *filepath, const FileImportInfo *import_nfo) |
Returns a new FileImport instance. | |
void | file_import_async (FileImport *self, GObject *owner, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer callback_data) |
Begins file import for a single file. | |
GPtrArray * | file_import_sync (FileImport *self, GError **error) |
GPtrArray * | file_import_finish (FileImport *self, GAsyncResult *result, GError **error) |
To be called by the provided GAsyncReadyCallback to retrieve retun values and error details, passing the GAsyncResult which was passed to the callback. | |
bool | midi_file_track_has_data (const char *abs_path, int track_idx) |
Returns whether the given track in the midi file has data. | |
int | midi_file_get_num_tracks (const char *abs_path, bool non_empty_only) |
Returns the number of tracks in the MIDI file. | |
Variables | |
GError ** | error |
#define FILE_IMPORT_TYPE (file_import_get_type ()) |
Definition at line 27 of file file_import.h.
NONNULL AudioFile * audio_file_new | ( | const char * | filepath | ) |
Creates a new instance of an AudioFile for the given path.
This may be a file to read from or a file to write to.
bool audio_file_read_samples | ( | AudioFile * | self, |
bool | in_parts, | ||
float * | samples, | ||
size_t | start_from, | ||
size_t | num_frames_to_read, | ||
GError ** | error ) |
Reads the file into an internal float array (interleaved).
samples | Samples to fill in. |
in_parts | Whether to read the file in parts. If true, start_from and num_frames_to_read must be specified. |
samples[out] | Pre-allocated frame array. Caller must ensure there is enough space (ie, number of frames * number of channels). |
bool audio_file_read_simple | ( | const char * | filepath, |
float ** | frames, | ||
size_t * | num_frames, | ||
AudioFileMetadata * | metadata, | ||
size_t | samplerate, | ||
GError ** | error ) |
Simple blocking API for reading and optionally resampling audio files.
Only to be used on small files.
[out] | frames | Pointer to store newly allocated interlaved frames to. |
[out] | metadata | File metadata will be pasted here if non-NULL. |
samplerate | If specified, the audio will be resampled to the given samplerate. Pass 0 to avoid resampling. |
void file_import_async | ( | FileImport * | self, |
GObject * | owner, | ||
GCancellable * | cancellable, | ||
GAsyncReadyCallback | callback, | ||
gpointer | callback_data ) |
Begins file import for a single file.
owner | Passed to the task as the owner object. This is to avoid the task callback being called after the owner object is deleted. |
callback_data | User data to pass to the callback. |
GPtrArray * file_import_finish | ( | FileImport * | self, |
GAsyncResult * | result, | ||
GError ** | error ) |
To be called by the provided GAsyncReadyCallback to retrieve retun values and error details, passing the GAsyncResult which was passed to the callback.
NONNULL_ARGS | ( | 1 | ) |
Must be called when done reading or writing files (or when the operation was cancelled).
This is not needed when only reading metadata.
GError** error |
Definition at line 102 of file audio_file.h.