• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

src/includepriv/xmmspriv/xmms_collection.h

Go to the documentation of this file.
00001 /*  XMMS2 - X Music Multiplexer System
00002  *  Copyright (C) 2003-2009 XMMS2 Team
00003  *
00004  *  PLUGINS ARE NOT CONSIDERED TO BE DERIVED WORK !!!
00005  *
00006  *  This library is free software; you can redistribute it and/or
00007  *  modify it under the terms of the GNU Lesser General Public
00008  *  License as published by the Free Software Foundation; either
00009  *  version 2.1 of the License, or (at your option) any later version.
00010  *
00011  *  This library is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  *  Lesser General Public License for more details.
00015  */
00016 
00017 #ifndef __XMMS_COLLECTION_H__
00018 #define __XMMS_COLLECTION_H__
00019 
00020 #include <glib.h>
00021 
00022 
00023 /*
00024  * Public definitions
00025  */
00026 
00027 #define XMMS_COLLECTION_NUM_NAMESPACES  2
00028 
00029 typedef enum {
00030     XMMS_COLLECTION_NSID_COLLECTIONS,
00031     XMMS_COLLECTION_NSID_PLAYLISTS,
00032     XMMS_COLLECTION_NSID_ALL,
00033     XMMS_COLLECTION_NSID_INVALID,
00034 } xmms_collection_namespace_id_t;
00035 
00036 
00037 /*
00038  * Private defintions
00039  */
00040 
00041 struct xmms_coll_dag_St;
00042 typedef struct xmms_coll_dag_St xmms_coll_dag_t;
00043 
00044 #include "xmms/xmms_error.h"
00045 #include "xmmsc/xmmsv_coll.h"
00046 #include "xmmspriv/xmms_playlist.h"
00047 #include "xmmspriv/xmms_medialib.h"
00048 
00049 typedef void (*FuncApplyToColl)(xmms_coll_dag_t *dag, xmmsv_coll_t *coll, xmmsv_coll_t *parent, void *udata);
00050 
00051 
00052 /*
00053  * Public functions
00054  */
00055 
00056 xmms_coll_dag_t * xmms_collection_init (xmms_playlist_t *playlist);
00057 
00058 xmmsv_coll_t * xmms_collection_get (xmms_coll_dag_t *dag, const gchar *collname, const gchar *namespace, xmms_error_t *error);
00059 GList * xmms_collection_list (xmms_coll_dag_t *dag, const gchar *namespace, xmms_error_t *error);
00060 gboolean xmms_collection_save (xmms_coll_dag_t *dag, const gchar *name, const gchar *namespace, xmmsv_coll_t *coll, xmms_error_t *error);
00061 gboolean xmms_collection_remove (xmms_coll_dag_t *dag, const gchar *collname, const gchar *namespace, xmms_error_t *error);
00062 GList * xmms_collection_find (xmms_coll_dag_t *dag, guint mid, const gchar *namespace, xmms_error_t *error);
00063 gboolean xmms_collection_rename (xmms_coll_dag_t *dag, const gchar *from_name, const gchar *to_name, const gchar *namespace, xmms_error_t *error);
00064 void xmms_collection_sync (xmms_coll_dag_t *dag, xmms_error_t *error);
00065 
00066 GList * xmms_collection_query_ids (xmms_coll_dag_t *dag, xmmsv_coll_t *coll, guint lim_start, guint lim_len, xmmsv_t *order, xmms_error_t *err);
00067 GList * xmms_collection_query_infos (xmms_coll_dag_t *dag, xmmsv_coll_t *coll, guint lim_start, guint lim_len, xmmsv_t *order, xmmsv_t *fetch, xmmsv_t *group, xmms_error_t *err);
00068 
00069 void xmms_collection_foreach_in_namespace (xmms_coll_dag_t *dag, guint nsid, GHFunc f, void *udata);
00070 void xmms_collection_apply_to_all_collections (xmms_coll_dag_t *dag, FuncApplyToColl f, void *udata);
00071 void xmms_collection_apply_to_collection (xmms_coll_dag_t *dag, xmmsv_coll_t *coll, FuncApplyToColl f, void *udata);
00072 
00073 xmmsv_coll_t * xmms_collection_get_pointer (xmms_coll_dag_t *dag, const gchar *collname, guint namespace);
00074 void xmms_collection_update_pointer (xmms_coll_dag_t *dag, const gchar *name, guint nsid, xmmsv_coll_t *newtarget);
00075 const gchar * xmms_collection_find_alias (xmms_coll_dag_t *dag, guint nsid, xmmsv_coll_t *value, const gchar *key);
00076 xmms_medialib_entry_t xmms_collection_get_random_media (xmms_coll_dag_t *dag, xmmsv_coll_t *source);
00077 void xmms_collection_dag_replace (xmms_coll_dag_t *dag, xmms_collection_namespace_id_t nsid, gchar *key, xmmsv_coll_t *newcoll);
00078 
00079 xmms_collection_namespace_id_t xmms_collection_get_namespace_id (const gchar *namespace);
00080 const gchar *xmms_collection_get_namespace_string (xmms_collection_namespace_id_t nsid);
00081 
00082 gboolean xmms_collection_get_int_attr (xmmsv_coll_t *coll, const gchar *attrname, gint *val);
00083 gboolean xmms_collection_set_int_attr (xmmsv_coll_t *coll, const gchar *attrname, gint newval);
00084 
00085 GTree *xmms_collection_changed_msg_new (xmms_collection_changed_actions_t type, const gchar *plname, const gchar *namespace);
00086 void xmms_collection_changed_msg_send (xmms_coll_dag_t *colldag, GTree *dict);
00087 
00088 void bind_all_references (xmms_coll_dag_t *dag, xmmsv_coll_t *coll, xmmsv_coll_t *parent, void *udata);
00089 
00090 #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))
00091 
00092 
00093 #endif

Generated on Wed Feb 9 2011 for XMMS2 by  doxygen 1.7.1