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.
For convenience the FLAC__metadata_object_vorbiscomment_*() functions maintain a trailing NUL on each Vorbis comment entry. This is not counted toward the length or stored in the stream, but it can make working with plain comments (those that don't contain embedded-NULs in the value) easier. Entries passed into these functions have trailing NULs added if missing, and returned entries are guaranteed to have a trailing NUL.
The FLAC__metadata_object_vorbiscomment_*() functions that take a Vorbis comment entry/name/value will first validate that it complies with the Vorbis comment specification and return false if it does not.
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().
|
|
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.
|
|
Compares two metadata objects. The compare is "deep", i.e. dynamically allocated data within the object is also compared.
|
|
Sets the application data of an APPLICATION block.
If copy is
|
|
Resize the seekpoint array. If the size shrinks, elements will truncated; if it grows, new placeholder points will be added to the end.
|
|
Set a seekpoint in a seektable.
|
|
Insert a seekpoint into a seektable.
|
|
Delete a seekpoint from a seektable.
|
|
Check a seektable to see if it conforms to the FLAC specification. See the format specification for limits on the contents of the seektable.
|
|
Append a number of placeholder points to the end of a seek table.
|
|
Append a specific seek point template to the end of a seek table.
|
|
Append specific seek point templates to the end of a seek table.
|
|
Append a set of evenly-spaced seek point templates to the end of a seek table.
|
|
Append a set of evenly-spaced seek point templates to the end of a seek table.
|
|
Sort a seek table's seek points according to the format specification, removing duplicates.
|
|
Sets the vendor string in a VORBIS_COMMENT block. For convenience, a trailing NUL is added to the entry if it doesn't have one already.
If copy is
|
|
Resize the comment array. If the size shrinks, elements will truncated; if it grows, new empty fields will be added to the end.
|
|
Sets a comment in a VORBIS_COMMENT block. For convenience, a trailing NUL is added to the entry if it doesn't have one already.
If copy is
|
|
Insert a comment in a VORBIS_COMMENT block at the given index. For convenience, a trailing NUL is added to the entry if it doesn't have one already.
If copy is
|
|
Appends a comment to a VORBIS_COMMENT block. For convenience, a trailing NUL is added to the entry if it doesn't have one already.
If copy is
|
|
Replaces comments in a VORBIS_COMMENT block with a new one. For convenience, a trailing NUL is added to the entry if it doesn't have one already. Depending on the the value of all, either all or just the first comment whose field name(s) match the given entry's name will be replaced by the given entry. If no comments match, entry will simply be appended.
If copy is
|
|
Delete a comment in a VORBIS_COMMENT block at the given index.
|
|
Creates a Vorbis comment entry from NUL-terminated name and value strings. On return, the filled-in entry->entry pointer will point to malloc()ed memory and shall be owned by the caller. For convenience the entry will have a terminating NUL.
|
|
Splits a Vorbis comment entry into NUL-terminated name and value strings. The returned pointers to name and value will be allocated by malloc() and shall be owned by the caller.
|
|
Check if the given Vorbis comment entry's field name matches the given field name.
|
|
Find a Vorbis comment with the given field name. The search begins at entry number offset; use an offset of 0 to search from the beginning of the comment array.
|
|
Remove first Vorbis comment matching the given field name.
|
|
Remove all Vorbis comments matching the given field name.
|
|
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().
|
|
Delete a CUESHEET track object
|
|
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.
|
|
Insert an index point in a CUESHEET track at the given index.
|
|
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.
|
|
Delete an index point in a CUESHEET track at the given index.
|
|
Resize the track array. If the size shrinks, elements will truncated; if it grows, new blank tracks will be added to the end.
|
|
Sets a track in a CUESHEET block.
If copy is
|
|
Insert a blank track in a CUESHEET block at the given index. A blank track is one in which all field values are zero.
|
|
Delete a track in a CUESHEET block at the given index.
|
|
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.
|
|
Calculate and return the CDDB/freedb ID for a cue sheet. The function assumes the cue sheet corresponds to a CD; the result is undefined if the cuesheet's is_cd bit is not set.
|
|
Sets the MIME type of a PICTURE block.
If copy is
|
|
Sets the description of a PICTURE block.
If copy is
|
|
Sets the picture data of a PICTURE block.
If copy is
|
|
Check a PICTURE block to see if it conforms to the FLAC specification. See the format specification for limits on the contents of the PICTURE block.
|