|
XMMS2
|
This is the collection manager. More...
Functions | |
| xmms_coll_dag_t * | xmms_collection_init (xmms_medialib_t *medialib) |
| Initializes a new xmms_coll_dag_t. | |
| xmmsv_t * | xmms_collection_query_ids (xmms_coll_dag_t *dag, xmmsv_t *coll, xmms_error_t *err) |
| Find the ids of the media matched by a collection. | |
| void | xmms_collection_update_pointer (xmms_coll_dag_t *dag, const gchar *name, xmms_collection_namespace_id_t nsid, xmmsv_t *newtarget) |
| Update a reference to point to a new collection. | |
| xmmsv_t * | xmms_collection_get_pointer (xmms_coll_dag_t *dag, const gchar *collname, xmms_collection_namespace_id_t nsid) |
| Find the collection structure corresponding to the given name in the given namespace. | |
| gboolean | xmms_collection_get_int_attr (xmmsv_t *coll, const gchar *attrname, gint *val) |
| Extract an attribute from a collection as an integer. | |
| gboolean | xmms_collection_set_int_attr (xmmsv_t *coll, const gchar *attrname, gint newval) |
| Set the attribute of a collection as an integer. | |
| gchar * | xmms_collection_find_alias (xmms_coll_dag_t *dag, xmms_collection_namespace_id_t nsid, xmmsv_t *value, const gchar *key) |
| Reverse-search the list of collections in the given namespace to find the first pair whose value matches the argument. | |
| xmms_medialib_entry_t | xmms_collection_get_random_media (xmms_coll_dag_t *dag, xmmsv_t *source) |
| Get a random media entry from the given collection. | |
This is the collection manager.
The set of collections is stored as a DAG of collection operators. Each collection namespace contains a list of saved collections, with a pointer to the node in the graph.
| gchar * xmms_collection_find_alias | ( | xmms_coll_dag_t * | dag, |
| xmms_collection_namespace_id_t | nsid, | ||
| xmmsv_t * | value, | ||
| const gchar * | key ) |
Reverse-search the list of collections in the given namespace to find the first pair whose value matches the argument.
If key is not NULL, any pair with the same key will be ignored.
| dag | The collection DAG. |
| nsid | The id of the namespace to consider. |
| value | The value of the pair to find. |
| key | If not NULL, ignore any pair with that key. |
Referenced by xmms_collection_snapshot().
| gboolean xmms_collection_get_int_attr | ( | xmmsv_t * | coll, |
| const gchar * | attrname, | ||
| gint * | val ) |
Extract an attribute from a collection as an integer.
| coll | The collection to extract the attribute from. |
| attrname | The name of the attribute. |
| val | The integer value of the attribute will be saved in this pointer. |
| xmmsv_t * xmms_collection_get_pointer | ( | xmms_coll_dag_t * | dag, |
| const gchar * | collname, | ||
| xmms_collection_namespace_id_t | nsid ) |
Find the collection structure corresponding to the given name in the given namespace.
| dag | The collection DAG. |
| collname | The name of the collection to find. |
| nsid | The namespace id. |
Referenced by xmms_collection_restore(), and xmms_collection_snapshot().
| xmms_medialib_entry_t xmms_collection_get_random_media | ( | xmms_coll_dag_t * | dag, |
| xmmsv_t * | source ) |
Get a random media entry from the given collection.
| dag | The collection DAG. |
| source | The collection to query. |
| xmms_coll_dag_t * xmms_collection_init | ( | xmms_medialib_t * | medialib | ) |
| xmmsv_t * xmms_collection_query_ids | ( | xmms_coll_dag_t * | dag, |
| xmmsv_t * | coll, | ||
| xmms_error_t * | err ) |
Find the ids of the media matched by a collection.
| dag | The collection DAG. |
| coll | The collection used to match media. |
| lim_start | The beginning index of the LIMIT statement (0 to disable). |
| lim_len | The number of entries of the LIMIT statement (0 to disable). |
| order | The list of properties to order by (empty to disable). |
| err | If an error occurs, a message is stored in it. |
| gboolean xmms_collection_set_int_attr | ( | xmmsv_t * | coll, |
| const gchar * | attrname, | ||
| gint | newval ) |
Set the attribute of a collection as an integer.
| coll | The collection in which to set the attribute. |
| attrname | The name of the attribute. |
| newval | The new value of the attribute. |
Referenced by xmms_playlist_current_entry(), and xmms_playlist_insert_entry().
| void xmms_collection_update_pointer | ( | xmms_coll_dag_t * | dag, |
| const gchar * | name, | ||
| xmms_collection_namespace_id_t | nsid, | ||
| xmmsv_t * | newtarget ) |
Update a reference to point to a new collection.
| dag | The collection DAG. |
| name | The name of the reference to update. |
| nsid | The namespace in which to locate the reference. |
| newtarget | The new collection pointed to by the reference. |
Referenced by xmms_collection_restore().