XMMS2
Macros | Typedefs | Enumerations | Functions
xmms_collection.h File Reference
#include <glib.h>
#include <xmms/xmms_error.h>
#include <xmmsc/xmmsv_coll.h>
#include <xmmspriv/xmms_playlist.h>
#include <xmmspriv/xmms_medialib.h>

Macros

#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_t *coll, xmmsv_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_txmms_collection_init (xmms_medialib_t *medialib)
 Initializes a new xmms_coll_dag_t. More...
 
xmmsv_txmms_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. More...
 
void xmms_collection_foreach_in_namespace (xmms_coll_dag_t *dag, xmms_collection_namespace_id_t nsid, GHFunc f, void *udata)
 Apply a function to all the collections in a given namespace. More...
 
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. More...
 
void xmms_collection_apply_to_collection (xmms_coll_dag_t *dag, xmmsv_t *coll, FuncApplyToColl f, void *udata)
 Apply a function of type FuncApplyToColl to the given collection. More...
 
xmmsv_txmms_collection_get_pointer (xmms_coll_dag_t *dag, const gchar *collname, guint namespace)
 
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. More...
 
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. More...
 
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. More...
 
xmms_collection_namespace_id_t xmms_collection_get_namespace_id (const gchar *namespace)
 Find the namespace id corresponding to a namespace string. More...
 
const gchar * xmms_collection_get_namespace_string (xmms_collection_namespace_id_t nsid)
 Find the namespace name (string) corresponding to a namespace id. More...
 
gboolean xmms_collection_get_int_attr (xmmsv_t *coll, const gchar *attrname, gint *val)
 Extract an attribute from a collection as an integer. More...
 
gboolean xmms_collection_set_int_attr (xmmsv_t *coll, const gchar *attrname, gint newval)
 Set the attribute of a collection as an integer. More...
 
xmmsv_txmms_collection_changed_msg_new (xmms_collection_changed_action_t type, const gchar *plname, const gchar *namespace)
 
void xmms_collection_changed_msg_send (xmms_coll_dag_t *colldag, xmmsv_t *dict)
 
xmmsv_txmms_collection_snapshot (xmms_coll_dag_t *dag)
 
void xmms_collection_restore (xmms_coll_dag_t *dag, xmmsv_t *snapshot)
 

Macro Definition Documentation

#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))

Typedef Documentation

typedef void(* FuncApplyToColl)(xmms_coll_dag_t *dag, xmmsv_t *coll, xmmsv_t *parent, void *udata)
typedef struct xmms_coll_dag_St xmms_coll_dag_t

Enumeration Type Documentation

Enumerator
XMMS_COLLECTION_NSID_COLLECTIONS 
XMMS_COLLECTION_NSID_PLAYLISTS 
XMMS_COLLECTION_NSID_ALL 
XMMS_COLLECTION_NSID_INVALID 

Function Documentation

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.

Parameters
dagThe collection DAG.
fThe function to apply to all the collections.
udataAdditional user data parameter passed to the function.

Referenced by xmms_collection_restore(), and xmms_collection_snapshot().

void xmms_collection_apply_to_collection ( xmms_coll_dag_t dag,
xmmsv_t coll,
FuncApplyToColl  f,
void *  udata 
)

Apply a function of type FuncApplyToColl to the given collection.

Parameters
dagThe collection DAG.
collThe collection on which to apply the function.
fThe function to apply to all the collections.
udataAdditional user data parameter passed to the function.

Referenced by xmms_collection_get_random_media().

xmmsv_t* xmms_collection_changed_msg_new ( xmms_collection_changed_action_t  type,
const gchar *  plname,
const gchar *  namespace 
)
void xmms_collection_changed_msg_send ( xmms_coll_dag_t colldag,
xmmsv_t dict 
)
void xmms_collection_foreach_in_namespace ( xmms_coll_dag_t dag,
xmms_collection_namespace_id_t  nsid,
GHFunc  f,
void *  udata 
)

Apply a function to all the collections in a given namespace.

Parameters
dagThe collection DAG.
nsidThe namespace id.
fThe function to apply to all the collections.
udataAdditional user data parameter passed to the function.
xmms_collection_namespace_id_t xmms_collection_get_namespace_id ( const gchar *  namespace)

Find the namespace id corresponding to a namespace string.

Parameters
namespaceThe namespace string.
Returns
The namespace id.
const gchar* xmms_collection_get_namespace_string ( xmms_collection_namespace_id_t  nsid)

Find the namespace name (string) corresponding to a namespace id.

Parameters
nsidThe namespace id.
Returns
The namespace name (string).
xmmsv_t* xmms_collection_get_pointer ( xmms_coll_dag_t dag,
const gchar *  collname,
guint  namespace 
)
void xmms_collection_restore ( xmms_coll_dag_t dag,
xmmsv_t snapshot 
)
xmmsv_t* xmms_collection_snapshot ( xmms_coll_dag_t dag)