XMMS2
|
The API to be used to work with collection structures. More...
Functions | |
xmmsv_coll_t * | xmmsv_coll_ref (xmmsv_coll_t *coll) |
Increases the references for the xmmsv_coll_t. More... | |
xmmsv_coll_t * | xmmsv_coll_new (xmmsv_coll_type_t type) |
Allocate a new collection of the given type. More... | |
void | xmmsv_coll_unref (xmmsv_coll_t *coll) |
Decreases the references for the xmmsv_coll_t When the number of references reaches 0 it will be freed and all its operands unreferenced as well. More... | |
void | xmmsv_coll_set_idlist (xmmsv_coll_t *coll, unsigned int ids[]) |
Set the list of ids in the given collection. More... | |
void | xmmsv_coll_add_operand (xmmsv_coll_t *coll, xmmsv_coll_t *op) |
Add the operand to the given collection. More... | |
void | xmmsv_coll_remove_operand (xmmsv_coll_t *coll, xmmsv_coll_t *op) |
Remove all the occurences of the operand in the given collection. More... | |
int | xmmsv_coll_idlist_append (xmmsv_coll_t *coll, unsigned int id) |
Append a value to the idlist. More... | |
int | xmmsv_coll_idlist_insert (xmmsv_coll_t *coll, unsigned int index, unsigned int id) |
Insert a value at a given position in the idlist. More... | |
int | xmmsv_coll_idlist_move (xmmsv_coll_t *coll, unsigned int index, unsigned int newindex) |
Move a value of the idlist to a new position. More... | |
int | xmmsv_coll_idlist_remove (xmmsv_coll_t *coll, unsigned int index) |
Remove the value at a given index from the idlist. More... | |
int | xmmsv_coll_idlist_clear (xmmsv_coll_t *coll) |
Empties the idlist. More... | |
int | xmmsv_coll_idlist_get_index (xmmsv_coll_t *coll, unsigned int index, uint32_t *val) |
Retrieves the value at the given position in the idlist. More... | |
int | xmmsv_coll_idlist_set_index (xmmsv_coll_t *coll, unsigned int index, uint32_t val) |
Sets the value at the given position in the idlist. More... | |
size_t | xmmsv_coll_idlist_get_size (xmmsv_coll_t *coll) |
Get the size of the idlist. More... | |
xmmsv_coll_type_t | xmmsv_coll_get_type (xmmsv_coll_t *coll) |
Return the type of the collection. More... | |
uint32_t * | xmmsv_coll_get_idlist (xmmsv_coll_t *coll) |
Return the list of ids stored in the collection. More... | |
xmmsv_t * | xmmsv_coll_operands_get (xmmsv_coll_t *coll) |
xmmsv_t * | xmmsv_coll_attributes_get (xmmsv_coll_t *coll) |
void | xmmsv_coll_attribute_set (xmmsv_coll_t *coll, const char *key, const char *value) |
Set an attribute in the given collection. More... | |
int | xmmsv_coll_attribute_remove (xmmsv_coll_t *coll, const char *key) |
Remove an attribute from the given collection. More... | |
int | xmmsv_coll_attribute_get (xmmsv_coll_t *coll, const char *key, char **value) |
Retrieve the value of the attribute of the given collection. More... | |
void | xmmsv_coll_attribute_foreach (xmmsv_coll_t *coll, xmmsv_coll_attribute_foreach_func func, void *user_data) |
Iterate over all key/value-pair of the collection attributes. More... | |
xmmsv_coll_t * | xmmsv_coll_universe () |
Return a collection referencing the whole media library, that is a reference to the "All Media" collection. More... | |
The API to be used to work with collection structures.
void xmmsv_coll_add_operand | ( | xmmsv_coll_t * | coll, |
xmmsv_coll_t * | op | ||
) |
Add the operand to the given collection.
coll | The collection to add the operand to. |
op | The operand to add. |
Definition at line 218 of file coll.c.
Referenced by bind_all_references(), xmms_collection_dag_restore(), and xmms_ipc_msg_put_value().
void xmmsv_coll_attribute_foreach | ( | xmmsv_coll_t * | coll, |
xmmsv_coll_attribute_foreach_func | func, | ||
void * | user_data | ||
) |
Iterate over all key/value-pair of the collection attributes.
Calls specified function for each key/value-pair of the attribute list.
void function (const char *key, const char *value, void *user_data);
coll | the xmmsv_coll_t. |
func | function that is called for each key/value-pair |
user_data | extra data passed to func |
int xmmsv_coll_attribute_get | ( | xmmsv_coll_t * | coll, |
const char * | key, | ||
char ** | value | ||
) |
Retrieve the value of the attribute of the given collection.
The return value is 1 if the attribute was found and 0 otherwise. The value of the attribute is owned by the collection and must not be freed by the caller.
coll | The collection to retrieve the attribute from. |
key | The name of the attribute. |
value | The value of the attribute if found (owned by the collection). |
Definition at line 550 of file coll.c.
Referenced by bind_all_references(), xmms_collection_get_int_attr(), xmms_collection_get_query(), xmms_collection_get_random_media(), xmms_playlist_add_entry_unlocked(), and xmms_playlist_init().
int xmmsv_coll_attribute_remove | ( | xmmsv_coll_t * | coll, |
const char * | key | ||
) |
Remove an attribute from the given collection.
The return value indicated whether the attribute was found (and removed)
coll | The collection to remove the attribute from. |
key | The name of the attribute to remove. |
Definition at line 533 of file coll.c.
Referenced by xmms_collection_dag_restore().
void xmmsv_coll_attribute_set | ( | xmmsv_coll_t * | coll, |
const char * | key, | ||
const char * | value | ||
) |
Set an attribute in the given collection.
coll | The collection in which to set the attribute. |
key | The name of the attribute to set. |
value | The value of the attribute. |
Definition at line 512 of file coll.c.
Referenced by bind_all_references(), xmms_collection_dag_restore(), xmms_collection_set_int_attr(), xmms_ipc_msg_put_value(), and xmmsv_coll_universe().
xmmsv_t* xmmsv_coll_attributes_get | ( | xmmsv_coll_t * | coll | ) |
Definition at line 497 of file coll.c.
Referenced by xmms_collection_dag_restore(), and xmms_ipc_msg_read_transport().
uint32_t* xmmsv_coll_get_idlist | ( | xmmsv_coll_t * | coll | ) |
Return the list of ids stored in the collection.
The list is owned by the collection. Note that this must not be confused with the content of the collection, which must be queried using xmmsc_coll_query_ids!
coll | The collection to consider. |
Definition at line 481 of file coll.c.
Referenced by bind_all_references(), xmms_collection_dag_restore(), xmms_collection_get_query(), xmms_ipc_msg_read_transport(), xmms_playlist_add_entry_unlocked(), xmms_playlist_current_entry(), and xmms_playlist_insert_entry().
xmmsv_coll_type_t xmmsv_coll_get_type | ( | xmmsv_coll_t * | coll | ) |
Return the type of the collection.
coll | The collection to consider. |
Definition at line 464 of file coll.c.
Referenced by bind_all_references(), xmms_collection_apply_to_collection(), xmms_collection_dag_restore(), xmms_collection_get_query(), xmms_collection_get_random_media(), and xmms_ipc_msg_read_transport().
int xmmsv_coll_idlist_append | ( | xmmsv_coll_t * | coll, |
unsigned int | id | ||
) |
Append a value to the idlist.
coll | The collection to update. |
id | The id to append to the idlist. |
Definition at line 275 of file coll.c.
Referenced by xmms_collection_dag_restore(), xmms_collection_init(), and xmms_playlist_add_entry_unlocked().
int xmmsv_coll_idlist_clear | ( | xmmsv_coll_t * | coll | ) |
Empties the idlist.
coll | The collection to update. |
Definition at line 390 of file coll.c.
Referenced by xmms_playlist_add_entry_unlocked().
int xmmsv_coll_idlist_get_index | ( | xmmsv_coll_t * | coll, |
unsigned int | index, | ||
uint32_t * | val | ||
) |
Retrieves the value at the given position in the idlist.
coll | The collection to update. |
index | The position of the value to retrieve. |
val | The pointer at which to store the found value. |
Definition at line 409 of file coll.c.
Referenced by xmms_playlist_add_entry_unlocked(), xmms_playlist_current_entry(), and xmms_playlist_remove_by_entry().
size_t xmmsv_coll_idlist_get_size | ( | xmmsv_coll_t * | coll | ) |
Get the size of the idlist.
coll | The collection to update. |
Definition at line 449 of file coll.c.
Referenced by xmms_playlist_add_entry_unlocked(), and xmms_playlist_mediainfo_reader_get().
int xmmsv_coll_idlist_insert | ( | xmmsv_coll_t * | coll, |
unsigned int | index, | ||
unsigned int | id | ||
) |
Insert a value at a given position in the idlist.
coll | The collection to update. |
id | The id to insert in the idlist. |
index | The position at which to insert the value. |
Definition at line 290 of file coll.c.
Referenced by xmms_playlist_insert_entry(), and xmmsv_coll_idlist_append().
int xmmsv_coll_idlist_move | ( | xmmsv_coll_t * | coll, |
unsigned int | index, | ||
unsigned int | newindex | ||
) |
Move a value of the idlist to a new position.
coll | The collection to update. |
index | The index of the value to move. |
newindex | The newindex to which to move the value. |
Definition at line 325 of file coll.c.
Referenced by xmms_playlist_remove_by_entry().
int xmmsv_coll_idlist_remove | ( | xmmsv_coll_t * | coll, |
unsigned int | index | ||
) |
Remove the value at a given index from the idlist.
coll | The collection to update. |
index | The index at which to remove the value. |
Definition at line 359 of file coll.c.
Referenced by xmms_playlist_current_entry().
int xmmsv_coll_idlist_set_index | ( | xmmsv_coll_t * | coll, |
unsigned int | index, | ||
uint32_t | val | ||
) |
Sets the value at the given position in the idlist.
coll | The collection to update. |
index | The position of the value to set. |
val | The new value. |
Definition at line 430 of file coll.c.
Referenced by xmms_playlist_current_entry().
xmmsv_coll_t* xmmsv_coll_new | ( | xmmsv_coll_type_t | type | ) |
Allocate a new collection of the given type.
The pointer will have to be deallocated using xmmsv_coll_unref.
type | the xmmsv_coll_type_t specifying the type of collection to create. |
Definition at line 83 of file coll.c.
Referenced by xmms_collection_dag_restore(), xmms_collection_init(), xmms_ipc_msg_put_value(), and xmmsv_coll_universe().
xmmsv_t* xmmsv_coll_operands_get | ( | xmmsv_coll_t * | coll | ) |
Definition at line 489 of file coll.c.
Referenced by bind_all_references(), xmms_collection_apply_to_collection(), xmms_collection_dag_restore(), xmms_collection_get_query(), xmms_collection_get_random_media(), and xmms_ipc_msg_read_transport().
xmmsv_coll_t* xmmsv_coll_ref | ( | xmmsv_coll_t * | coll | ) |
Increases the references for the xmmsv_coll_t.
coll | the collection to reference. |
Definition at line 66 of file coll.c.
Referenced by xmms_collection_dag_restore(), xmms_collection_init(), xmms_collection_sync(), xmms_collection_update_pointer(), xmmsv_coll_new(), and xmmsv_new_coll().
void xmmsv_coll_remove_operand | ( | xmmsv_coll_t * | coll, |
xmmsv_coll_t * | op | ||
) |
Remove all the occurences of the operand in the given collection.
coll | The collection to remove the operand from. |
op | The operand to remove. |
Definition at line 249 of file coll.c.
Referenced by bind_all_references().
void xmmsv_coll_set_idlist | ( | xmmsv_coll_t * | coll, |
unsigned int | ids[] | ||
) |
Set the list of ids in the given collection.
The list must be 0-terminated. Note that the idlist is only relevant for idlist collections.
coll | the collection to modify. |
ids | the 0-terminated list of ids to store in the collection. |
Definition at line 168 of file coll.c.
Referenced by xmms_ipc_msg_put_value(), and xmmsv_coll_idlist_clear().
xmmsv_coll_t* xmmsv_coll_universe | ( | void | ) |
Return a collection referencing the whole media library, that is a reference to the "All Media" collection.
The returned structure must be unref'd using xmmsv_coll_unref after usage.
void xmmsv_coll_unref | ( | xmmsv_coll_t * | coll | ) |
Decreases the references for the xmmsv_coll_t When the number of references reaches 0 it will be freed and all its operands unreferenced as well.
coll | the collection to unref. |
Definition at line 147 of file coll.c.
Referenced by bind_all_references(), xmms_collection_dag_restore(), xmms_ipc_msg_put_value(), and xmmsv_unref().