Skip to content

bindings.metadata

Melchor Garau Madrigal edited this page Feb 9, 2017 · 3 revisions

Contains all the functions and objects for FLAC/metadata interface. Don't think this documentation is a full replacement of the FLAC's one. Only tells all available functions, and the relation to the FLAC API, with a short description. If this documents lacks a function from the FLAC API, it means that has no bounded.

See the C <=> Javascript mapping and how they work.

Metadata functions

Object? new(Number type)

FLAC__metadata_new()

Returns an object of type type, or null if failed. Valid values for type can be found here.

Object? clone(Buffer metadata)

FLAC__metadata_clone()

Tryies to clone the metadata object into a new one.

delete(Buffer metadata)

FLAC__metadata_delete()

Deletes the metadata object.

Boolean is_equal(Buffer metadata1, Buffer metadata2)

FLAC__metadata_is_equal()

Returns true if both metadata objects are equals.

Application metadata functions

Boolean application_set_data(Buffer metadata, Buffer data)

FLAC__metadata_application_set_data()

Sets the data value for an application metadata object. Always makes a copy of the data.

SeekTable metadata functions

Boolean seektable_resize_points(Buffer metadata, Number newSize)

FLAC__metadata_seektable_resize_points()

Changes the size of the seek points to the new one.

Boolean seektable_set_point(Buffer metadata, Number pos, Object point)

FLAC__metadata_seektable_set_point()

The point object must have this structure:

{
    "sample_number": ...,
    "stream_offset": ...,
    "frame_samples": ...
}

Boolean seektable_insert_point(Buffer metadata, Number pos, Object point)

FLAC__metadata_seektable_insert_point()

The point object must have the structure show before.

Boolean seektable_delete_point(Buffer metadata, Number pos)

FLAC__metadata_seektable_delete_point()

Deletes a point in the position pos.

Boolean seektable_is_legal(Buffer metadata)

FLAC__metadata_seektable_is_legal()

Checks wether the Seek Table is valid or not.

Boolean seektable_template_append_placeholders(Buffer metadata, Number num)

FLAC__metadata_seektable_template_append_placeholders()

Appends a number of placeholders points into the Seek Table.

Boolean seektable_template_append_point(Buffer metadata, Number samplePoint)

FLAC__metadata_seektable_template_append_point()

Append a specific seek point to the end of the table.

Boolean seektable_template_append_points(Buffer metadata, Array[Number] samplePoints)

FLAC__metadata_seektable_template_append_points()

Append some seek points to the end of the table.

Boolean seektable_template_append_spaced_points(Buffer metadata, Number num, Number totalSamples)

FLAC__metadata_seektable_template_append_spaced_points()

Append a set of evenly-spaced seek point templates to the end of a seek table.

Boolean seektable_template_append_spaced_points_by_samples(Buffer metadata, Number num, Number totalSamples)

FLAC__metadata_seektable_template_append_spaced_points_by_samples()

Append a set of evenly-spaced seek point templates to the end of a seek table.

Boolean seektable_template_sort(Buffer metadata, Boolean compact)

FLAC__metadata_seektable_template_sort()

Sort a seek table's seek points according to the format specification, removing duplicates. After all calls of seektable_template_* methods, you must call this one to make the table valid.

VorbisComment metadata functions

Boolean vorbiscomment_set_vendor_string(Buffer metadata, String vendorString)

FLAC__metadata_vorbiscomment_set_vendor_string()

Sets the vendor string of a VorbisComment. Always makes a copy of the string.

Boolean vorbiscomment_resize_comments(Buffer metadata, Number newSize)

FLAC__metadata_vorbiscomment_resize_comments()

Changes the size of the VorbisComment list.

Boolean vorbiscomment_set_comment(Buffer metadata, Number pos, String comment)

FLAC__metadata_vorbiscomment_set_comment()

Overwrites an entry positioned in pos with comment. Always makes a copy of the string.

Boolean vorbiscomment_insert_comment(Buffer metadata, Number pos, String comment)

FLAC__metadata_vorbiscomment_insert_comment()

Inserts in pos position a new comment. Always makes a copy of the string.

Boolean vorbiscomment_append_comment(Buffer metadata, String comment)

FLAC__metadata_vorbiscomment_append_comment()

Inserts at the end of the list a new comment. Always makes a copy of the string.

Boolean vorbiscomment_replace_comment(Buffer metadata, String comment, Boolean all)

FLAC__metadata_vorbiscomment_replace_comment()

Replaces the first, of all if all is true, comment(s) that matches the field name (NAME=Value, only the NAME part will match). Always makes a copy of the string.

Boolean vorbiscomment_delete_comment(Buffer metadata, Number pos)

FLAC__metadata_vorbiscomment_delete_comment()

Deletes the VorbisComment entry on the position pos.

Number vorbiscomment_find_entry_from(Buffer metadata, Number offset, String name)

FLAC__metadata_vorbiscomment_find_entry_from()

Find the first entry starting from offset position and matching the field name with name.

Number vorbiscomment_remove_entry_matching(Buffer metadata, String name)

FLAC__metadata_vorbiscomment_remove_entry_matching()

Removes the first entry that matches its field name with name.

Number vorbiscomment_remove_entries_matching(Buffer metadata, String name)

FLAC__metadata_vorbiscomment_remove_entries_matching()

Removes all entries that match their field name with name.

CueSheet metadata functions

Object? cuesheet_track_new()

FLAC__metadata_cuesheet_track_new()

Creates a new CueSheet Track.

Object? cuesheet_track_clone(Buffer cuesheettrack)

FLAC__metadata_cuesheet_track_clone()

Clones a CueSheet Track.

cuesheet_track_delete(Buffer cuesheettrack)

FLAC__metadata_cuesheet_track_delete()

Deletes a CueSheet Track

Boolean cuesheet_track_resize_indices(Buffer metadata, Number pos, Number newNum)

FLAC__metadata_cuesheet_track_resize_indices()

Resizes the indices list to newNum for the track number pos.

Boolean cuesheet_track_insert_index(Buffer metadata, Number trackPos, Number indexPos, Number offset, Number number)

FLAC__metadata_cuesheet_track_insert_index()

Inserts a new index in the position indexPos for the track number trackPos. The values for the new point are offset and number. Here don't need to pass an object. Because yes...

Boolean cuesheet_track_insert_blank_index(Buffer metadata, Number trackPos, Number indexPos)

FLAC__metadata_cuesheet_track_insert_blank_index()

Inserts a new empty index in the position indexPos for the track number trackPos.

Boolean cuesheet_track_delete_index(Buffer metadata, Number trackPos, Number indexPos)

FLAC__metadata_cuesheet_track_delete_index()

Deletes an index in the position indexPos for the track number trackPos.

Boolean cuesheet_resize_tracks(Buffer metadata, Number newTrackSize)

FLAC__metadata_cuesheet_resize_tracks()

Resize the track array.

Boolean cuesheet_set_track(Buffer metadata, Number trackPos, Object track)

FLAC__metadata_cuesheet_set_track()

Sets a track in a CueSheet block. The ownership of the object will be passed to the metadata object, so you don't need to delete the track object.

Boolean cuesheet_insert_track(Buffer metadata, Number trackPos, Object track)

FLAC__metadata_cuesheet_insert_track()

Insert a track in a CueSheet block at trackPos. The ownership of the object will be passed to the metadata object, so you don't need to delete the track object.

Boolean cuesheet_insert_blank_track(Buffer metadata, Number trackPos)

FLAC__metadata_cuesheet_insert_blank_track()

Insert a blank track in a CueSheet block at trackPos.

Boolean cuesheet_delete_track(Buffer metadata, Number trackPos)

FLAC__metadata_cuesheet_delete_track()

Deletes the track in trackPos.

Boolean or String cuesheet_is_legal(Buffer metadata, Number trackPos)

FLAC__metadata_cuesheet_is_legal()

Checks whether the track is valid (returning true) or if there's an error (returning a string).

Number cuesheet_calculate_cddb_id(Buffer metadata)

FLAC__metadata_cuesheet_calculate_cddb_id()

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 value is not set.

Picture metadata functions

Boolean picture_set_mime_type(Buffer metadata, String mimetype)

FLAC__metadata_picture_set_mime_type()

Sets the MIME type for the picture. Always will copy the string.

Boolean picture_set_description(Buffer metadata, String description)

FLAC__metadata_picture_set_description()

Sets the description of the picture. Always will copy the string.

Boolean picture_set_data(Buffer metadata, Buffer data)

FLAC__metadata_picture_set_data()

Copies the data inside the buffer data into the picture metadata.

Boolean or String picture_is_legal(Buffer metadata)

FLAC__metadata_picture_is_legal()

Checks whether the picture metadata is valid (returning true) or is invalid (returning a string).

Clone this wiki locally