Since many are variable length we have to be careful about the memory management. We decree that all pointers to data in the object are owned by the object and memory-managed by the object.
Use the FLAC__metadata_object_new() and FLAC__metadata_object_delete() functions to create all instances. When using the FLAC__metadata_object_set_*() functions to set pointers to data, set copy to true
to have the function make it's own copy of the data, or to false
to give the object ownership of your data. In the latter case your pointer must be freeable by free() and will be free()d when the object is FLAC__metadata_object_delete()d. It is legal to pass a null pointer as the data pointer to a FLAC__metadata_object_set_*() function as long as the length argument is 0 and the copy argument is false
.
The FLAC__metadata_object_new() and FLAC__metadata_object_clone() function will return NULL
in the case of a memory allocation error, otherwise a new object. The FLAC__metadata_object_set_*() functions return false
in the case of a memory allocation error.
We don't have the convenience of C++ here, so note that the library relies on you to keep the types straight. In other words, if you pass, for example, a FLAC__StreamMetadata* that represents a STREAMINFO block to FLAC__metadata_object_application_set_data(), you will get an assertion failure.
There is no need to recalculate the length field on metadata blocks you have modified. They will be calculated automatically before they are written back to a file.
|
Create a new metadata object instance of the given type.
The object will be "empty"; i.e. values and data pointers will be Do not pass in a value greater than or equal to FLAC__METADATA_TYPE_UNDEFINED unless you really know what you're doing.
|
|
Create a copy of an existing metadata object. The copy is a "deep" copy, i.e. dynamically allocated data within the object is also copied. The caller takes ownership of the new block and is responsible for freeing it with FLAC__metadata_object_delete().
object != NULL
|
|
Free a metadata object. Deletes the object pointed to by object. The delete is a "deep" delete, i.e. dynamically allocated data within the object is also deleted.
object != NULL |
|
Compares two metadata objects. The compare is "deep", i.e. dynamically allocated data within the object is also compared.
block1 != NULL block2 != NULL
|
|
Sets the application data of an APPLICATION block.
If copy is
object != NULL object->type == FLAC__METADATA_TYPE_APPLICATION (data != NULL && length > 0) ||
(data == NULL && length == 0 && copy == false)
|
|
Resize the seekpoint array. If the size shrinks, elements will truncated; if it grows, new placeholder points will be added to the end.
object != NULL object->type == FLAC__METADATA_TYPE_SEEKTABLE (object->data.seek_table.points == NULL && object->data.seek_table.num_points == 0) || (object->data.seek_table.points != NULL && object->data.seek_table.num_points > 0)
|
|
Set a seekpoint in a seektable.
object != NULL object->type == FLAC__METADATA_TYPE_SEEKTABLE object->data.seek_table.num_points > point_num |
|
Insert a seekpoint into a seektable.
object != NULL object->type == FLAC__METADATA_TYPE_SEEKTABLE object->data.seek_table.num_points >= point_num
|
|
Delete a seekpoint from a seektable.
object != NULL object->type == FLAC__METADATA_TYPE_SEEKTABLE object->data.seek_table.num_points > point_num
|
|
Check a seektable to see if it conforms to the FLAC specification. See the format specification for limits on the contents of the seektable.
object != NULL object->type == FLAC__METADATA_TYPE_SEEKTABLE
|
|
Append a number of placeholder points to the end of a seek table.
object != NULL object->type == FLAC__METADATA_TYPE_SEEKTABLE
|
|
Append a specific seek point template to the end of a seek table.
object != NULL object->type == FLAC__METADATA_TYPE_SEEKTABLE
|
|
Append specific seek point templates to the end of a seek table.
object != NULL object->type == FLAC__METADATA_TYPE_SEEKTABLE
|
|
Append a set of evenly-spaced seek point templates to the end of a seek table.
object != NULL object->type == FLAC__METADATA_TYPE_SEEKTABLE
|
|
Sort a seek table's seek points according to the format specification, removing duplicates.
object != NULL object->type == FLAC__METADATA_TYPE_SEEKTABLE
|
|
Sets the vendor string in a VORBIS_COMMENT block.
If copy is
object != NULL object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT (entry->entry != NULL && entry->length > 0) ||
(entry->entry == NULL && entry->length == 0 && copy == false)
|
|
Resize the comment array. If the size shrinks, elements will truncated; if it grows, new empty fields will be added to the end.
object != NULL object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT (object->data.vorbis_comment.comments == NULL && object->data.vorbis_comment.num_comments == 0) || (object->data.vorbis_comment.comments != NULL && object->data.vorbis_comment.num_comments > 0)
|
|
Sets a comment in a VORBIS_COMMENT block.
If copy is
object != NULL object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT comment_num < object->data.vorbis_comment.num_comments (entry->entry != NULL && entry->length > 0) ||
(entry->entry == NULL && entry->length == 0 && copy == false)
|
|
Insert a comment in a VORBIS_COMMENT block at the given index.
If copy is
object != NULL object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT object->data.vorbis_comment.num_comments >= comment_num (entry->entry != NULL && entry->length > 0) ||
(entry->entry == NULL && entry->length == 0 && copy == false)
|
|
Delete a comment in a VORBIS_COMMENT block at the given index.
object != NULL object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT object->data.vorbis_comment.num_comments > comment_num (entry->entry != NULL && entry->length > 0) ||
(entry->entry == NULL && entry->length == 0 && copy == false)
|
|
Check if the given Vorbis comment entry's field name matches the given field name.
entry != NULL (entry->entry != NULL && entry->length > 0)
|
|
Find a Vorbis comment with the given field name. The search begins at entry number offset; use and offset of 0 to search from the beginning of the comment array.
object != NULL object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT
|
|
Remove first Vorbis comment matching the given field name.
object != NULL object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT
|
|
Remove all Vorbis comments matching the given field name.
object != NULL object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT
|
|
Create a new CUESHEET track instance.
The object will be "empty"; i.e. values and data pointers will be
|
|
Create a copy of an existing CUESHEET track object. The copy is a "deep" copy, i.e. dynamically allocated data within the object is also copied. The caller takes ownership of the new object and is responsible for freeing it with FLAC__metadata_object_cuesheet_track_delete().
object != NULL
|
|
Delete a CUESHEET track object
object != NULL |
|
Resize a track's index point array. If the size shrinks, elements will truncated; if it grows, new blank indices will be added to the end.
object != NULL object->type == FLAC__METADATA_TYPE_CUESHEET object->data.cue_sheet.num_tracks > track_num (object->data.cue_sheet.tracks[track_num].indices == NULL && object->data.cue_sheet.tracks[track_num].num_indices == 0) || (object->data.cue_sheet.tracks[track_num].indices != NULL && object->data.cue_sheet.tracks[track_num].num_indices > 0)
|
|
Insert an index point in a CUESHEET track at the given index.
object != NULL object->type == FLAC__METADATA_TYPE_CUESHEET object->data.cue_sheet.num_tracks > track_num object->data.cue_sheet.tracks[track_num].num_indices >= index_num
|
|
Insert a blank index point in a CUESHEET track at the given index. A blank index point is one in which all field values are zero.
object != NULL object->type == FLAC__METADATA_TYPE_CUESHEET object->data.cue_sheet.num_tracks > track_num object->data.cue_sheet.tracks[track_num].num_indices >= index_num
|
|
Delete an index point in a CUESHEET track at the given index.
object != NULL object->type == FLAC__METADATA_TYPE_CUESHEET object->data.cue_sheet.num_tracks > track_num object->data.cue_sheet.tracks[track_num].num_indices > index_num
|
|
Resize the track array. If the size shrinks, elements will truncated; if it grows, new blank tracks will be added to the end.
object != NULL object->type == FLAC__METADATA_TYPE_CUESHEET (object->data.cue_sheet.tracks == NULL && object->data.cue_sheet.num_tracks == 0) || (object->data.cue_sheet.tracks != NULL && object->data.cue_sheet.num_tracks > 0)
|
|
Sets a track in a CUESHEET block.
If copy is
object != NULL object->type == FLAC__METADATA_TYPE_CUESHEET track_num < object->data.cue_sheet.num_tracks (track->indices != NULL && track->num_indices > 0) || (track->indices == NULL && track->num_indices == 0) \retval FLAC__bool \c false if \a copy is \c true and malloc fails, else \c true. */ FLAC__bool FLAC__metadata_object_cuesheet_set_track(FLAC__StreamMetadata *object, unsigned track_num, FLAC__StreamMetadata_CueSheet_Track *track, FLAC__bool copy); object->type == FLAC__METADATA_TYPE_CUESHEET object->data.cue_sheet.num_tracks >= track_num
|
|
Insert a blank track in a CUESHEET block at the given index. A blank track is one in which all field values are zero.
object != NULL object->type == FLAC__METADATA_TYPE_CUESHEET object->data.cue_sheet.num_tracks >= track_num
|
|
Delete a track in a CUESHEET block at the given index.
object != NULL object->type == FLAC__METADATA_TYPE_CUESHEET object->data.cue_sheet.num_tracks > track_num
|
|
Check a cue sheet to see if it conforms to the FLAC specification. See the format specification for limits on the contents of the cue sheet.
object != NULL object->type == FLAC__METADATA_TYPE_CUESHEET
|