![]() |
![]() |
![]() |
Rhythmbox Development Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
RBExtDBKey * rb_ext_db_key_copy (RBExtDBKey *key
); void rb_ext_db_key_free (RBExtDBKey *key
); RBExtDBKey * rb_ext_db_key_create_lookup (const char *field
,const char *value
); RBExtDBKey * rb_ext_db_key_create_storage (const char *field
,const char *value
); gboolean rb_ext_db_key_is_lookup (RBExtDBKey *key
); void rb_ext_db_key_add_field (RBExtDBKey *key
,const char *field
,const char *value
); char ** rb_ext_db_key_get_field_names (RBExtDBKey *key
); const char * rb_ext_db_key_get_field (RBExtDBKey *key
,const char *field
); char ** rb_ext_db_key_get_field_values (RBExtDBKey *key
,const char *field
); gboolean rb_ext_db_key_field_matches (RBExtDBKey *key
,const char *field
,const char *value
); void rb_ext_db_key_add_info (RBExtDBKey *key
,const char *name
,const char *value
); char ** rb_ext_db_key_get_info_names (RBExtDBKey *key
); const char * rb_ext_db_key_get_info (RBExtDBKey *key
,const char *name
); gboolean rb_ext_db_key_matches (RBExtDBKey *a
,RBExtDBKey *b
); gboolean (*RBExtDBKeyLookupCallback) (TDB_DATA data
,gpointer user_data
); void rb_ext_db_key_lookups (RBExtDBKey *key
,RBExtDBKeyLookupCallback callback
,gpointer user_data
); TDB_DATA rb_ext_db_key_to_store_key (RBExtDBKey *key
); RBExtDBKey;
An external metadata key consists of one or more required fields (such as the album name for album art lookups), zero or more optional fields (such as the artist name), and zero or more informational fields (such as the musicbrainz album ID).
RBExtDBKey * rb_ext_db_key_copy (RBExtDBKey *key
);
Copies a key.
|
a RBExtDBKey |
Returns : |
copied key |
RBExtDBKey * rb_ext_db_key_create_lookup (const char *field
,const char *value
);
Creates a new metadata lookup key with a single field.
Use rb_ext_db_key_add_field
to add more.
|
required field name |
|
value for field |
Returns : |
the new key |
RBExtDBKey * rb_ext_db_key_create_storage (const char *field
,const char *value
);
Creates a new metadata storage key with a single field.
Use rb_ext_db_key_add_field
to add more.
|
required field name |
|
value for field |
Returns : |
the new key |
gboolean rb_ext_db_key_is_lookup (RBExtDBKey *key
);
Returns TRUE
if the key is a lookup key
|
a RBExtDBKey |
Returns : |
whether the key is a lookup key |
void rb_ext_db_key_add_field (RBExtDBKey *key
,const char *field
,const char *value
);
Adds a field to the key, or an additional value to an existing field.
|
a RBExtDBKey |
|
name of the field to add |
|
field value |
char ** rb_ext_db_key_get_field_names (RBExtDBKey *key
);
Returns a NULL-terminated array containing the names of the fields present in the key.
|
a RBExtDBKey |
Returns : |
array of field names. [transfer full] |
const char * rb_ext_db_key_get_field (RBExtDBKey *key
,const char *field
);
Extracts the value for a single-valued field.
|
a RBExtDBKey |
|
field to retrieve |
Returns : |
field value, or NULL |
char ** rb_ext_db_key_get_field_values (RBExtDBKey *key
,const char *field
);
Extracts the values for the specified field.
|
a RBExtDBKey |
|
field to retrieve |
Returns : |
field values, or NULL. [transfer full] |
gboolean rb_ext_db_key_field_matches (RBExtDBKey *key
,const char *field
,const char *value
);
Checks whether a specified field in key
matches a value.
This can be used to match keys against other types of data.
To match keys against each other, use rb_ext_db_key_matches
.
|
an RBExtDBKey |
|
a field to check |
|
a value to match against |
Returns : |
TRUE if the field matches the value |
void rb_ext_db_key_add_info (RBExtDBKey *key
,const char *name
,const char *value
);
Adds an information field to the key.
|
a RBExtDBKey |
|
name of the field to add |
|
field value |
char ** rb_ext_db_key_get_info_names (RBExtDBKey *key
);
Returns a NULL-terminated array containing the names of the info fields * present in the key.
|
a RBExtDBKey |
Returns : |
array of info field names. [transfer full] |
const char * rb_ext_db_key_get_info (RBExtDBKey *key
,const char *name
);
Extracts the value for the specified info field.
|
a RBExtDBKey |
|
info field to retrieve |
Returns : |
field value, or NULL |
gboolean rb_ext_db_key_matches (RBExtDBKey *a
,RBExtDBKey *b
);
Checks whether the fields specified in a
match b
.
For keys to match, they must have the same set of required fields,
and the values for all must match. Optional fields must have the
same values if present in both. Informational fields are ignored.
|
first RBExtDBKey |
|
second RBExtDBKey |
Returns : |
TRUE if the keys match |
gboolean (*RBExtDBKeyLookupCallback) (TDB_DATA data
,gpointer user_data
);
void rb_ext_db_key_lookups (RBExtDBKey *key
,RBExtDBKeyLookupCallback callback
,gpointer user_data
);