XMMS2
|
#include <glib.h>
#include "xmms/xmms_error.h"
#include "xmmsc/xmmsv_coll.h"
#include "xmmspriv/xmms_playlist.h"
#include "xmmspriv/xmms_medialib.h"
#include "xmmspriv/xmms_medialib.h"
Go to the source code of this file.
Defines | |
#define | XMMS_COLLECTION_NUM_NAMESPACES 2 |
#define | XMMS_COLLECTION_PLAYLIST_CHANGED_MSG(dag, name) xmms_collection_changed_msg_send (dag, xmms_collection_changed_msg_new (XMMS_COLLECTION_CHANGED_UPDATE, name, XMMS_COLLECTION_NS_PLAYLISTS)) |
Typedefs | |
typedef struct xmms_coll_dag_St | xmms_coll_dag_t |
typedef void(* | FuncApplyToColl )(xmms_coll_dag_t *dag, xmmsv_coll_t *coll, xmmsv_coll_t *parent, void *udata) |
Enumerations | |
enum | xmms_collection_namespace_id_t { XMMS_COLLECTION_NSID_COLLECTIONS, XMMS_COLLECTION_NSID_PLAYLISTS, XMMS_COLLECTION_NSID_ALL, XMMS_COLLECTION_NSID_INVALID } |
Functions | |
xmms_coll_dag_t * | xmms_collection_init (xmms_playlist_t *playlist) |
Initializes a new xmms_coll_dag_t. | |
void | xmms_collection_sync (xmms_coll_dag_t *dag) |
Synchronize collection data to the database (i.e. | |
GList * | xmms_collection_query_ids (xmms_coll_dag_t *dag, xmmsv_coll_t *coll, gint32 lim_start, gint32 lim_len, xmmsv_t *order, xmms_error_t *err) |
Find the ids of the media matched by a collection. | |
void | xmms_collection_foreach_in_namespace (xmms_coll_dag_t *dag, guint nsid, GHFunc f, void *udata) |
Apply a function to all the collections in a given namespace. | |
void | xmms_collection_apply_to_all_collections (xmms_coll_dag_t *dag, FuncApplyToColl f, void *udata) |
Apply a function of type FuncApplyToColl to all the collections in all namespaces. | |
void | xmms_collection_apply_to_collection (xmms_coll_dag_t *dag, xmmsv_coll_t *coll, FuncApplyToColl f, void *udata) |
Apply a function of type FuncApplyToColl to the given collection. | |
xmmsv_coll_t * | xmms_collection_get_pointer (xmms_coll_dag_t *dag, const gchar *collname, guint namespace) |
Find the collection structure corresponding to the given name in the given namespace. | |
void | xmms_collection_update_pointer (xmms_coll_dag_t *dag, const gchar *name, guint nsid, xmmsv_coll_t *newtarget) |
Update a reference to point to a new collection. | |
const gchar * | xmms_collection_find_alias (xmms_coll_dag_t *dag, guint nsid, xmmsv_coll_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_coll_t *source) |
Get a random media entry from the given collection. | |
void | xmms_collection_dag_replace (xmms_coll_dag_t *dag, xmms_collection_namespace_id_t nsid, gchar *key, xmmsv_coll_t *newcoll) |
Update the DAG to update the value of the pair with the given key. | |
xmms_collection_namespace_id_t | xmms_collection_get_namespace_id (const gchar *namespace) |
Find the namespace id corresponding to a namespace string. | |
const gchar * | xmms_collection_get_namespace_string (xmms_collection_namespace_id_t nsid) |
Find the namespace name (string) corresponding to a namespace id. | |
gboolean | xmms_collection_get_int_attr (xmmsv_coll_t *coll, const gchar *attrname, gint *val) |
Extract an attribute from a collection as an integer. | |
gboolean | xmms_collection_set_int_attr (xmmsv_coll_t *coll, const gchar *attrname, gint newval) |
Set the attribute of a collection as an integer. | |
GTree * | xmms_collection_changed_msg_new (xmms_collection_changed_actions_t type, const gchar *plname, const gchar *namespace) |
void | xmms_collection_changed_msg_send (xmms_coll_dag_t *colldag, GTree *dict) |
void | bind_all_references (xmms_coll_dag_t *dag, xmmsv_coll_t *coll, xmmsv_coll_t *parent, void *udata) |
If a reference, add the operator of the pointed collection as an operand. |
#define XMMS_COLLECTION_NUM_NAMESPACES 2 |
Definition at line 27 of file xmms_collection.h.
Referenced by xmms_collection_apply_to_all_collections(), xmms_collection_dag_save(), xmms_collection_foreach_in_namespace(), xmms_collection_get_pointer(), and xmms_collection_init().
#define XMMS_COLLECTION_PLAYLIST_CHANGED_MSG | ( | dag, | |
name | |||
) | xmms_collection_changed_msg_send (dag, xmms_collection_changed_msg_new (XMMS_COLLECTION_CHANGED_UPDATE, name, XMMS_COLLECTION_NS_PLAYLISTS)) |
Definition at line 83 of file xmms_collection.h.
Referenced by xmms_playlist_changed_msg_send().
typedef void(* FuncApplyToColl)(xmms_coll_dag_t *dag, xmmsv_coll_t *coll, xmmsv_coll_t *parent, void *udata) |
Definition at line 49 of file xmms_collection.h.
typedef struct xmms_coll_dag_St xmms_coll_dag_t |
Definition at line 42 of file xmms_collection.h.
XMMS_COLLECTION_NSID_COLLECTIONS | |
XMMS_COLLECTION_NSID_PLAYLISTS | |
XMMS_COLLECTION_NSID_ALL | |
XMMS_COLLECTION_NSID_INVALID |
Definition at line 29 of file xmms_collection.h.
void bind_all_references | ( | xmms_coll_dag_t * | dag, |
xmmsv_coll_t * | coll, | ||
xmmsv_coll_t * | parent, | ||
void * | udata | ||
) |
If a reference, add the operator of the pointed collection as an operand.
Definition at line 1559 of file collection.c.
Referenced by xmms_collection_dag_restore().
void xmms_collection_apply_to_all_collections | ( | xmms_coll_dag_t * | dag, |
FuncApplyToColl | f, | ||
void * | udata | ||
) |
Apply a function of type FuncApplyToColl to all the collections in all namespaces.
dag | The collection DAG. |
f | The function to apply to all the collections. |
udata | Additional user data parameter passed to the function. |
Definition at line 1449 of file collection.c.
Referenced by xmms_collection_dag_restore().
void xmms_collection_apply_to_collection | ( | xmms_coll_dag_t * | dag, |
xmmsv_coll_t * | coll, | ||
FuncApplyToColl | f, | ||
void * | udata | ||
) |
Apply a function of type FuncApplyToColl to the given collection.
dag | The collection DAG. |
coll | The collection on which to apply the function. |
f | The function to apply to all the collections. |
udata | Additional user data parameter passed to the function. |
Definition at line 1468 of file collection.c.
GTree* xmms_collection_changed_msg_new | ( | xmms_collection_changed_actions_t | type, |
const gchar * | plname, | ||
const gchar * | namespace | ||
) |
Definition at line 159 of file collection.c.
void xmms_collection_changed_msg_send | ( | xmms_coll_dag_t * | colldag, |
GTree * | dict | ||
) |
Definition at line 175 of file collection.c.
void xmms_collection_foreach_in_namespace | ( | xmms_coll_dag_t * | dag, |
guint | nsid, | ||
GHFunc | f, | ||
void * | udata | ||
) |
Apply a function to all the collections in a given namespace.
dag | The collection DAG. |
nsid | The namespace id. |
f | The function to apply to all the collections. |
udata | Additional user data parameter passed to the function. |
Definition at line 1429 of file collection.c.
Referenced by xmms_collection_dag_save(), and xmms_playlist_remove_by_entry().
xmms_collection_namespace_id_t xmms_collection_get_namespace_id | ( | const gchar * | namespace | ) |
Find the namespace id corresponding to a namespace string.
namespace | The namespace string. |
Definition at line 1353 of file collection.c.
Referenced by bind_all_references().
const gchar* xmms_collection_get_namespace_string | ( | xmms_collection_namespace_id_t | nsid | ) |
Find the namespace name (string) corresponding to a namespace id.
nsid | The namespace id. |
Definition at line 1376 of file collection.c.