![]() |
![]() |
![]() |
Rhythmbox Development Reference Manual | ![]() |
---|---|---|---|---|
RBMetaData; RBMetaDataClass; enum RBMetaDataField; enum RBMetaDataError; RBMetaData* rb_metadata_new (void); GType rb_metadata_get_field_type (RBMetaDataField field); const char* rb_metadata_get_field_name (RBMetaDataField field); gboolean rb_metadata_can_save (RBMetaData *md, const char *mimetype); void rb_metadata_load (RBMetaData *md, const char *uri, GError **error); void rb_metadata_save (RBMetaData *md, GError **error); const char* rb_metadata_get_mime (RBMetaData *md); gboolean rb_metadata_has_missing_plugins (RBMetaData *md); gboolean rb_metadata_get_missing_plugins (RBMetaData *md, char ***missing_plugins, char ***plugin_descriptions); gboolean rb_metadata_get (RBMetaData *md, RBMetaDataField field, GValue *val); gboolean rb_metadata_set (RBMetaData *md, RBMetaDataField field, const GValue *val);
typedef enum { RB_METADATA_FIELD_TITLE, /* string */ RB_METADATA_FIELD_ARTIST, /* string */ RB_METADATA_FIELD_ALBUM, /* string */ RB_METADATA_FIELD_DATE, /* ulong */ RB_METADATA_FIELD_GENRE, /* string */ RB_METADATA_FIELD_COMMENT, /* string */ RB_METADATA_FIELD_TRACK_NUMBER, /* ulong */ RB_METADATA_FIELD_MAX_TRACK_NUMBER, /* ulong */ RB_METADATA_FIELD_DISC_NUMBER, /* ulong */ RB_METADATA_FIELD_MAX_DISC_NUMBER, /* ulong */ RB_METADATA_FIELD_DESCRIPTION, /* string */ RB_METADATA_FIELD_VERSION, /* string */ RB_METADATA_FIELD_ISRC, /* string */ RB_METADATA_FIELD_ORGANIZATION, /* string */ RB_METADATA_FIELD_COPYRIGHT, /* string */ RB_METADATA_FIELD_CONTACT, /* string */ RB_METADATA_FIELD_LICENSE, /* string */ RB_METADATA_FIELD_PERFORMER, /* string */ RB_METADATA_FIELD_DURATION, /* ulong */ RB_METADATA_FIELD_CODEC, /* string */ RB_METADATA_FIELD_BITRATE, /* ulong */ RB_METADATA_FIELD_TRACK_GAIN, /* double */ RB_METADATA_FIELD_TRACK_PEAK, /* double */ RB_METADATA_FIELD_ALBUM_GAIN, /* double */ RB_METADATA_FIELD_ALBUM_PEAK, /* double */ RB_METADATA_FIELD_LANGUAGE_CODE, /* string */ RB_METADATA_FIELD_MUSICBRAINZ_TRACKID, /* string */ RB_METADATA_FIELD_MUSICBRAINZ_ARTISTID, /* string */ RB_METADATA_FIELD_MUSICBRAINZ_ALBUMID, /* string */ RB_METADATA_FIELD_MUSICBRAINZ_ALBUMARTISTID, /* string */ RB_METADATA_FIELD_ARTIST_SORTNAME, /* string */ RB_METADATA_FIELD_LAST /* nothing */ } RBMetaDataField;
Metadata fields that can be read from and written to files.
Title of the recording | |
Person(s) responsible for the recording | |
Album containing the recording | |
Release date of the album | |
Genre of the recording | |
Free form comment on the recording | |
Track number inside a collection | |
Count of tracks inside the collection | |
Disc number inside a collection | |
Count of discs inside the collection | |
Short text describing the recording | |
Version of the recording | |
International Standard Recording Code | |
Organization responsible for the recording | |
Copyright notice on the recording | |
Contact information | |
License of the recording | |
Person(s) performing in the recording | |
Duration of the recording | |
Codec used to store the recording | |
Exact or average encoding bitrate in bits/s | |
Track gain in dB for replaygain | |
Track peak volume level | |
Album gain in dB for replaygain | |
Album peak volume level | |
Language code (ISO-639-1) | |
MusicBrainz track ID | |
MusicBrainz artist ID | |
MusicBrainz album ID | |
MusicBrainz album artist ID | |
Person(s) responsible for the recording, as used for sorting | |
invalid field |
typedef enum { RB_METADATA_ERROR_GNOMEVFS, RB_METADATA_ERROR_MISSING_PLUGIN, RB_METADATA_ERROR_UNRECOGNIZED, RB_METADATA_ERROR_UNSUPPORTED, RB_METADATA_ERROR_GENERAL, RB_METADATA_ERROR_INTERNAL, RB_METADATA_ERROR_NOT_AUDIO, RB_METADATA_ERROR_NOT_AUDIO_IGNORE, RB_METADATA_ERROR_EMPTY_FILE } RBMetaDataError;
GType rb_metadata_get_field_type (RBMetaDataField field);
|
a RBMetaDataField |
Returns : |
the GType of the value for the metadata field |
const char* rb_metadata_get_field_name (RBMetaDataField field);
|
a RBMetaDataField |
Returns : |
the name of the metadata field |
gboolean rb_metadata_can_save (RBMetaData *md, const char *mimetype);
Checks if the metadata writer is capable of updating file metadata for a given media type.
|
a RBMetaData |
|
the MIME type-ish string to check |
Returns : |
TRUE if the file metadata for the given media type can be updated |
void rb_metadata_load (RBMetaData *md, const char *uri, GError **error);
Reads metadata information from the specified URI. Once this has returned successfully (with *error == NULL), rb_metadata_get, rb_metadata_get_mime, rb_metadata_has_missing_plugins, and rb_metadata_get_missing_plugins can usefully be called.
|
a RBMetaData |
|
URI from which to load metadata |
|
returns error information |
void rb_metadata_save (RBMetaData *md, GError **error);
Saves all metadata changes made with rb_metadata_set to the target URI.
|
a RBMetaData |
|
returns error information |
const char* rb_metadata_get_mime (RBMetaData *md);
Returns the type of the file from which metadata was read. This isn't really a MIME type, but it looks like one.
|
a RBMetaData |
Returns : |
MIME type-ish string |
gboolean rb_metadata_has_missing_plugins (RBMetaData *md);
If the metadata reader could not decode the file it was asked to because one or more media framework plugins (specifically, for the existing implementations, GStreamer plugins) required are missing, this will return TRUE.
|
a RBMetaData |
Returns : |
TRUE if required plugins are missing |
gboolean rb_metadata_get_missing_plugins (RBMetaData *md, char ***missing_plugins, char ***plugin_descriptions);
This function returns the information used to request automatic
installation of media framework plugins required to decode the target URI.
Use g_strfreev()
to free the returned information arrays.
|
a RBMetaData |
|
returns machine-readable missing plugin information |
|
returns human-readable missing plugin descriptions |
Returns : |
TRUE if missing plugin information was returned |
gboolean rb_metadata_get (RBMetaData *md, RBMetaDataField field, GValue *val);
Retrieves the value of a metadata field extracted from the target URI. If the target URI contained no value for the field, returns FALSE.
|
a RBMetaData |
|
the RBMetaDataField to retrieve |
|
returns the field value |
Returns : |
TRUE if a value was returned |
gboolean rb_metadata_set (RBMetaData *md, RBMetaDataField field, const GValue *val);
Sets a metadata field value. The value is only stored inside the RBMetaData object until rb_metadata_save is called.
|
a RBMetaData |
|
the RBMetaDataField to set |
|
the vaule to set |
Returns : |
TRUE if the field is valid |