60 static void xmms_playlist_client_move_entry (
xmms_playlist_t *playlist,
const gchar *plname, gint32 pos, gint32 newpos,
xmms_error_t *err);
64 static void xmms_playlist_client_insert_url (
xmms_playlist_t *playlist,
const gchar *plname, gint32 pos,
const gchar *url,
xmms_error_t *error);
68 static void xmms_playlist_client_rinsert (
xmms_playlist_t *playlist,
const gchar *plname, gint32 pos,
const gchar *path,
xmms_error_t *error);
73 static const gchar *xmms_playlist_canonical_name (
xmms_playlist_t *playlist,
const gchar *plname);
74 static gint xmms_playlist_coll_get_currpos (
xmmsv_coll_t *plcoll);
75 static gint xmms_playlist_coll_get_size (
xmmsv_coll_t *plcoll);
79 static void xmms_playlist_register_ipc_commands (
xmms_object_t *playlist_object);
81 static void xmms_playlist_current_pos_msg_send (
xmms_playlist_t *playlist, GTree *dict);
82 static GTree * xmms_playlist_current_pos_msg_new (
xmms_playlist_t *playlist, guint32 pos,
const gchar *plname);
84 #define XMMS_PLAYLIST_CHANGED_MSG(type, id, name) xmms_playlist_changed_msg_send (playlist, xmms_playlist_changed_msg_new (playlist, type, id, name)) 85 #define XMMS_PLAYLIST_CURRPOS_MSG(pos, name) xmms_playlist_current_pos_msg_send (playlist, xmms_playlist_current_pos_msg_new (playlist, pos, name)) 98 struct xmms_playlist_St {
111 gboolean update_flag;
115 #include "playlist_ipc.c" 126 g_mutex_lock (playlist->mutex);
127 playlist->repeat_all = !!value;
128 g_mutex_unlock (playlist->mutex);
140 g_mutex_lock (playlist->mutex);
141 playlist->repeat_one = !!value;
142 g_mutex_unlock (playlist->mutex);
147 on_playlist_updated (
xmms_object_t *
object,
const gchar *plname)
153 if (playlist->update_flag) {
157 plcoll = xmms_playlist_get_coll (playlist, plname, NULL);
158 if (plcoll == NULL) {
164 xmms_playlist_update_queue (playlist, plname, plcoll);
168 xmms_playlist_update_partyshuffle (playlist, plname, plcoll);
180 XMMS_DBG (
"PLAYLIST: updated pos!");
187 const gchar *plname = NULL;
190 XMMS_DBG (
"PLAYLIST: updated chg!");
193 if (pl_val != NULL) {
197 XMMS_DBG (
"PLAYLIST: updated_chg, NULL playlist!");
198 g_assert_not_reached ();
201 on_playlist_updated (
object, plname);
205 xmms_playlist_update_queue (
xmms_playlist_t *playlist,
const gchar *plname,
208 gint history, currpos;
210 XMMS_DBG (
"PLAYLIST: update-queue!");
216 playlist->update_flag = TRUE;
217 currpos = xmms_playlist_coll_get_currpos (coll);
218 while (currpos > history) {
219 xmms_playlist_remove_unlocked (playlist, plname, coll, 0, NULL);
220 currpos = xmms_playlist_coll_get_currpos (coll);
222 playlist->update_flag = FALSE;
229 gint history, upcoming, currpos, size;
233 XMMS_DBG (
"PLAYLIST: update-partyshuffle!");
243 playlist->update_flag = TRUE;
244 currpos = xmms_playlist_coll_get_currpos (coll);
245 while (currpos > history) {
246 xmms_playlist_remove_unlocked (playlist, plname, coll, 0, NULL);
247 currpos = xmms_playlist_coll_get_currpos (coll);
251 XMMS_DBG (
"Cannot find party shuffle operand!");
256 currpos = xmms_playlist_coll_get_currpos (coll);
257 size = xmms_playlist_coll_get_size (coll);
258 while (size < currpos + 1 + upcoming) {
261 if (randentry == 0) {
267 currpos = xmms_playlist_coll_get_currpos (coll);
268 size = xmms_playlist_coll_get_size (coll);
270 playlist->update_flag = FALSE;
283 ret->mutex = g_mutex_new ();
285 xmms_playlist_register_ipc_commands (
XMMS_OBJECT (ret));
288 on_playlist_r_one_changed, ret);
292 on_playlist_r_all_changed, ret);
295 ret->update_flag = FALSE;
299 on_playlist_updated_chg, ret);
303 on_playlist_updated_pos, ret);
324 xmms_error_reset (&err);
327 if (plcoll == NULL) {
329 }
else if ((size = xmms_playlist_coll_get_size (plcoll)) == 0) {
331 xmms_playlist_client_load (buffer, jumplist, &err);
333 ret = xmms_playlist_advance_do (playlist);
340 }
else if (!playlist->repeat_one) {
341 currpos = xmms_playlist_coll_get_currpos (plcoll);
344 if (currpos == size && !playlist->repeat_all &&
350 xmms_playlist_client_load (buffer, jumplist, &err);
352 ret = xmms_playlist_advance_do (playlist);
357 newpos = currpos%size;
360 ret = (currpos != size) || playlist->repeat_all;
380 g_return_val_if_fail (playlist, FALSE);
382 g_mutex_lock (playlist->mutex);
383 ret = xmms_playlist_advance_do (playlist);
384 g_mutex_unlock (playlist->mutex);
400 g_return_val_if_fail (playlist, 0);
402 g_mutex_lock (playlist->mutex);
405 if (plcoll == NULL) {
407 g_mutex_unlock (playlist->mutex);
411 currpos = xmms_playlist_coll_get_currpos (plcoll);
412 size = xmms_playlist_coll_get_size (plcoll);
414 if (currpos == -1 && (size > 0)) {
420 if (currpos < size) {
426 g_mutex_unlock (playlist->mutex);
437 xmms_playlist_client_current_pos (
xmms_playlist_t *playlist,
const gchar *plname,
444 g_return_val_if_fail (playlist, 0);
446 g_mutex_lock (playlist->mutex);
448 plcoll = xmms_playlist_get_coll (playlist, plname, err);
449 if (plcoll == NULL) {
450 g_mutex_unlock (playlist->mutex);
455 pos = xmms_playlist_coll_get_currpos (plcoll);
460 g_mutex_unlock (playlist->mutex);
462 dict = xmms_playlist_current_pos_msg_new (playlist, pos, plname);
477 g_return_val_if_fail (playlist, 0);
479 g_mutex_lock (playlist->mutex);
482 if (active_coll != NULL) {
491 name = g_strdup (alias);
497 g_mutex_unlock (playlist->mutex);
514 if (active_coll == NULL) {
519 plcoll = xmms_playlist_get_coll (playlist, name, err);
520 if (plcoll == NULL) {
525 if (active_coll == plcoll) {
526 XMMS_DBG (
"Not loading %s playlist, already active!", name);
530 XMMS_DBG (
"Loading new playlist! %s", name);
558 xmms_playlist_client_shuffle (
xmms_playlist_t *playlist,
const gchar *plname,
565 g_return_if_fail (playlist);
567 g_mutex_lock (playlist->mutex);
569 plcoll = xmms_playlist_get_coll (playlist, plname, err);
570 if (plcoll == NULL) {
572 g_mutex_unlock (playlist->mutex);
576 currpos = xmms_playlist_coll_get_currpos (plcoll);
577 len = xmms_playlist_coll_get_size (plcoll);
581 swap_entries (plcoll, 0, currpos);
587 for (i = currpos + 1; i < len; i++) {
588 j = g_random_int_range (i, len);
591 swap_entries (plcoll, i, j);
600 g_mutex_unlock (playlist->mutex);
604 xmms_playlist_remove_unlocked (
xmms_playlist_t *playlist,
const gchar *plname,
610 g_return_val_if_fail (playlist, FALSE);
612 currpos = xmms_playlist_coll_get_currpos (plcoll);
620 g_tree_insert (dict, (gpointer)
"position",
xmmsv_new_int (pos));
626 if (currpos != -1 && pos <= currpos) {
638 } playlist_remove_info_t;
641 remove_from_playlist (gpointer key, gpointer value, gpointer udata)
643 playlist_remove_info_t *rminfo = (playlist_remove_info_t *) udata;
649 size = xmms_playlist_coll_get_size (plcoll);
650 for (i = 0; i < size; i++) {
652 XMMS_DBG (
"removing entry on pos %d in %s", i, (gchar *)key);
653 xmms_playlist_remove_unlocked (rminfo->pls, (gchar *)key, plcoll, i, NULL);
673 playlist_remove_info_t rminfo;
674 g_return_val_if_fail (playlist, FALSE);
676 g_mutex_lock (playlist->mutex);
678 rminfo.pls = playlist;
679 rminfo.entry = entry;
683 remove_from_playlist, &rminfo);
685 g_mutex_unlock (playlist->mutex);
699 gboolean ret = FALSE;
702 g_return_if_fail (playlist);
704 g_mutex_lock (playlist->mutex);
705 plcoll = xmms_playlist_get_coll (playlist, plname, err);
706 if (plcoll != NULL) {
707 ret = xmms_playlist_remove_unlocked (playlist, plname, plcoll, pos, err);
709 g_mutex_unlock (playlist->mutex);
719 const gchar *plname, gint32 pos,
725 gint64 ipos, inewpos;
728 g_return_if_fail (playlist);
730 XMMS_DBG (
"Moving %d, to %d", pos, newpos);
732 g_mutex_lock (playlist->mutex);
734 plcoll = xmms_playlist_get_coll (playlist, plname, err);
735 if (plcoll == NULL) {
737 g_mutex_unlock (playlist->mutex);
741 currpos = xmms_playlist_coll_get_currpos (plcoll);
742 size = xmms_playlist_coll_get_size (plcoll);
744 if (size == 0 || newpos > (size - 1)) {
746 "Cannot move entry outside playlist");
747 g_mutex_unlock (playlist->mutex);
753 g_mutex_unlock (playlist->mutex);
760 if (inewpos <= currpos && ipos > currpos)
762 else if (inewpos >= currpos && ipos < currpos)
764 else if (ipos == currpos)
772 g_tree_insert (dict, (gpointer)
"position",
xmmsv_new_int (pos));
773 g_tree_insert (dict, (gpointer)
"newposition",
xmmsv_new_int (newpos));
778 g_mutex_unlock (playlist->mutex);
797 xmms_playlist_client_insert_url (
xmms_playlist_t *playlist,
const gchar *plname,
810 xmms_playlist_client_insert_id (playlist, plname, pos, entry, err);
825 xmms_playlist_client_rinsert (
xmms_playlist_t *playlist,
const gchar *plname, gint32 pos,
844 xmms_playlist_client_insert_id (
xmms_playlist_t *playlist,
const gchar *plname,
850 "That is not a valid medialib id!");
858 xmms_playlist_client_insert_collection (
xmms_playlist_t *playlist,
const gchar *plname,
870 xmms_playlist_client_insert_id (playlist, plname, pos,
id, err);
873 res = g_list_delete_link (res, res);
895 g_mutex_lock (playlist->mutex);
897 plcoll = xmms_playlist_get_coll (playlist, plname, err);
898 if (plcoll == NULL) {
900 g_mutex_unlock (playlist->mutex);
904 len = xmms_playlist_coll_get_size (plcoll);
907 "Could not insert entry outside of playlist!");
908 g_mutex_unlock (playlist->mutex);
915 g_tree_insert (dict, (gpointer)
"position",
xmmsv_new_int (pos));
919 currpos = xmms_playlist_coll_get_currpos (plcoll);
920 if (pos <= currpos) {
926 g_mutex_unlock (playlist->mutex);
941 xmms_playlist_client_add_url (
xmms_playlist_t *playlist,
const gchar *plname,
967 xmms_playlist_client_radd (
xmms_playlist_t *playlist,
const gchar *plname,
990 xmms_playlist_client_add_id (
xmms_playlist_t *playlist,
const gchar *plname,
995 "That is not a valid medialib id!");
1004 const gchar *plname,
1018 "Idlist contains invalid medialib id!");
1036 xmms_playlist_client_add_collection (
xmms_playlist_t *playlist,
const gchar *plname,
1051 res = g_list_delete_link (res, res);
1067 g_mutex_lock (playlist->mutex);
1069 plcoll = xmms_playlist_get_coll (playlist, plname, err);
1070 if (plcoll != NULL) {
1074 g_mutex_unlock (playlist->mutex);
1083 const gchar *plname,
1091 prev_size = xmms_playlist_coll_get_size (plcoll);
1096 g_tree_insert (dict, (gpointer)
"position",
xmmsv_new_int (prev_size));
1102 xmms_playlist_client_clear (
xmms_playlist_t *playlist,
const gchar *plname,
1107 g_return_if_fail (playlist);
1109 g_mutex_lock (playlist->mutex);
1111 plcoll = xmms_playlist_get_coll (playlist, plname, err);
1112 if (plcoll == NULL) {
1113 g_mutex_unlock (playlist->mutex);
1121 g_mutex_unlock (playlist->mutex);
1134 xmms_playlist_set_current_position_do (
xmms_playlist_t *playlist, guint32 pos,
1142 g_return_val_if_fail (playlist, FALSE);
1145 if (plcoll == NULL) {
1149 size = xmms_playlist_coll_get_size (plcoll);
1157 xmms_playlist_client_load (playlist, jumplist, err);
1163 if (plcoll == NULL) {
1166 }
else if (pos < size) {
1172 "Can't set pos outside the current playlist!");
1186 g_return_val_if_fail (playlist, FALSE);
1188 g_mutex_lock (playlist->mutex);
1189 mid = xmms_playlist_set_current_position_do (playlist, pos, err);
1190 g_mutex_unlock (playlist->mutex);
1196 xmms_playlist_client_set_next_rel (
xmms_playlist_t *playlist, gint32 pos,
1199 gint currpos, newpos, size;
1203 g_return_val_if_fail (playlist, FALSE);
1205 g_mutex_lock (playlist->mutex);
1208 if (plcoll != NULL) {
1209 currpos = xmms_playlist_coll_get_currpos (plcoll);
1211 if (playlist->repeat_all) {
1212 newpos = pos + currpos;
1222 mid = xmms_playlist_set_current_position_do (playlist, newpos, err);
1224 if (currpos + pos >= 0) {
1225 mid = xmms_playlist_set_current_position_do (playlist,
1230 "Can't set pos outside the current playlist!");
1235 g_mutex_unlock (playlist->mutex);
1254 xmms_playlist_entry_compare (gconstpointer a, gconstpointer b, gpointer user_data)
1257 xmmsv_t *val1, *val2, *properties, *propval;
1259 sortdata_t *data1 = (sortdata_t *) a;
1260 sortdata_t *data2 = (sortdata_t *) b;
1262 const gchar *propstr, *str1, *str2;
1264 properties = (
xmmsv_t *) user_data;
1271 if (propstr[0] ==
'-') {
1294 res = g_utf8_collate (str1, str2);
1316 XMMS_DBG (
"Types in compare function differ to much");
1330 xmms_playlist_sorted_free (gpointer data, gpointer userdata)
1333 sortdata_t *sorted = (sortdata_t *) data;
1335 for (n = sorted->val; n; n = n->next) {
1340 g_list_free (sorted->val);
1349 xmms_playlist_sorted_unwind (gpointer data, gpointer userdata)
1352 sortdata_t *sorted = (sortdata_t *) data;
1357 if (sorted->current) {
1362 xmms_playlist_sorted_free (sorted, NULL);
1376 xmms_playlist_client_sort (
xmms_playlist_t *playlist,
const gchar *plname,
1380 GList *tmp = NULL, *n;
1385 gboolean list_changed = FALSE;
1391 g_return_if_fail (playlist);
1392 g_return_if_fail (properties);
1394 g_mutex_lock (playlist->mutex);
1396 plcoll = xmms_playlist_get_coll (playlist, plname, err);
1397 if (plcoll == NULL) {
1399 g_mutex_unlock (playlist->mutex);
1406 "invalid list of properties to sort by!");
1407 g_mutex_unlock (playlist->mutex);
1413 "empty list of properties to sort by!");
1414 g_mutex_unlock (playlist->mutex);
1421 XMMS_DBG (
"Sorting on %s (and maybe more)", str);
1423 currpos = xmms_playlist_coll_get_currpos (plcoll);
1424 size = xmms_playlist_coll_get_size (plcoll);
1428 g_mutex_unlock (playlist->mutex);
1435 for (i = 0; i < size; i++) {
1436 data = g_new (sortdata_t, 1);
1460 casefold = g_utf8_casefold (str, strlen (str));
1467 data->val = g_list_prepend (data->val, val);
1469 data->val = g_list_reverse (data->val);
1471 data->current = (currpos == i);
1473 tmp = g_list_prepend (tmp, data);
1478 tmp = g_list_reverse (tmp);
1479 tmp = g_list_sort_with_data (tmp, xmms_playlist_entry_compare, properties);
1482 for (i = 0, n = tmp; n; i++, n = g_list_next (n)) {
1483 if (((sortdata_t*)n->data)->position != i) {
1484 list_changed = TRUE;
1489 if (!list_changed) {
1490 g_list_foreach (tmp, xmms_playlist_sorted_free, NULL);
1492 g_mutex_unlock (playlist->mutex);
1497 g_list_foreach (tmp, xmms_playlist_sorted_unwind, plcoll);
1504 g_mutex_unlock (playlist->mutex);
1510 xmms_playlist_client_list_entries (
xmms_playlist_t *playlist,
const gchar *plname,
1513 GList *entries = NULL;
1518 g_return_val_if_fail (playlist, NULL);
1520 g_mutex_lock (playlist->mutex);
1522 plcoll = xmms_playlist_get_coll (playlist, plname, err);
1523 if (plcoll == NULL) {
1524 g_mutex_unlock (playlist->mutex);
1538 g_mutex_unlock (playlist->mutex);
1540 entries = g_list_reverse (entries);
1549 g_return_val_if_fail (playlist, NULL);
1551 return playlist->mediainfordr;
1567 g_return_if_fail (playlist);
1569 g_mutex_free (playlist->mutex);
1579 xmms_playlist_unregister_ipc_commands ();
1584 xmms_playlist_get_coll (
xmms_playlist_t *playlist,
const gchar *plname,
1591 if (coll == NULL && error != NULL) {
1602 static const gchar *
1603 xmms_playlist_canonical_name (
xmms_playlist_t *playlist,
const gchar *plname)
1605 const gchar *fullname;
1652 dict = g_tree_new_full ((GCompareDataFunc) strcmp, NULL,
1655 g_tree_insert (dict, (gpointer)
"type",
xmmsv_new_int (type));
1661 tmp = xmms_playlist_canonical_name (playlist, plname);
1669 guint32 pos,
const gchar *plname)
1674 dict = g_tree_new_full ((GCompareDataFunc) strcmp, NULL,
1677 g_tree_insert (dict, (gpointer)
"position",
xmmsv_new_int (pos));
1679 tmp = xmms_playlist_canonical_name (playlist, plname);
1691 const gchar *plname;
1693 g_return_if_fail (playlist);
1694 g_return_if_fail (dict);
1697 type_val = g_tree_lookup (dict,
"type");
1698 pl_val = g_tree_lookup (dict,
"name");
1710 g_tree_destroy (dict);
1717 g_return_if_fail (playlist);
1719 g_return_if_fail (dict);
1726 g_tree_destroy (dict);
void xmmsv_list_iter_first(xmmsv_list_iter_t *it)
Rewind the iterator to the start of the list.
int xmmsv_coll_idlist_insert(xmmsv_coll_t *coll, int index, int id)
Insert a value at a given position in the idlist.
#define xmms_error_isok(e)
struct xmmsv_list_iter_St xmmsv_list_iter_t
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.
#define XMMS_COLLECTION_PLAYLIST_CHANGED_MSG(dag, name)
void xmmsv_unref(xmmsv_t *val)
Decreases the references for the xmmsv_t When the number of references reaches 0 it will be freed...
#define xmms_object_unref(obj)
int xmmsv_coll_attribute_get(xmmsv_coll_t *coll, const char *key, char **value)
Retrieve the value of the attribute of the given collection.
int xmmsv_coll_idlist_append(xmmsv_coll_t *coll, int id)
Append a value to the idlist.
#define xmms_error_iserror(e)
void xmms_config_property_callback_remove(xmms_config_property_t *prop, xmms_object_handler_t cb, gpointer userdata)
Remove a callback from a config property.
xmms_config_property_t * xmms_config_lookup(const gchar *path)
Look up a config key from the global config.
void xmms_playlist_add_entry(xmms_playlist_t *playlist, const gchar *plname, xmms_medialib_entry_t file, xmms_error_t *err)
Add an entry to the playlist without validating it.
xmmsv_t * xmmsv_new_string(const char *s)
Allocates a new string xmmsv_t.
xmms_playlist_changed_actions_t
int xmmsv_get_int(const xmmsv_t *val, int32_t *r)
Retrieves a signed integer from the value.
xmmsv_coll_t * xmms_collection_get_pointer(xmms_coll_dag_t *dag, const gchar *collname, guint nsid)
Find the collection structure corresponding to the given name in the given namespace.
gboolean check_string_list(xmmsv_t *list)
Checks that the list only contains string values.
int xmmsv_get_list_iter(const xmmsv_t *val, xmmsv_list_iter_t **it)
Retrieves a list iterator from a list xmmsv_t.
gboolean xmms_playlist_advance(xmms_playlist_t *playlist)
Go to next song in playlist according to current playlist mode.
struct xmmsv_St * xmmsv_coll_operands_get(xmmsv_coll_t *coll)
size_t xmmsv_coll_idlist_get_size(xmmsv_coll_t *coll)
Get the size of the idlist.
gboolean xmms_collection_get_int_attr(xmmsv_coll_t *coll, const gchar *attrname, gint *val)
Extract an attribute from a collection as an integer.
gint xmms_config_property_get_int(const xmms_config_property_t *prop)
Return the value of a config property as an int.
#define XMMS_DEFAULT_PARTYSHUFFLE_UPCOMING
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.
struct xmmsv_St * xmmsv_coll_idlist_get(xmmsv_coll_t *coll)
Return the list of ids stored in the collection.
int xmmsv_coll_idlist_get_index(xmmsv_coll_t *coll, int index, int32_t *val)
Retrieves the value at the given position in the idlist.
int xmmsv_dict_get(xmmsv_t *dictv, const char *key, xmmsv_t **val)
Get the element corresponding to the given key in the dict xmmsv_t (if it exists).
void xmms_object_emit_f(xmms_object_t *object, guint32 signalid, xmmsv_type_t type,...)
Emits a signal on the current object.
void xmmsv_list_iter_next(xmmsv_list_iter_t *it)
Advance the iterator to the next element in the list.
void xmmsv_list_iter_explicit_destroy(xmmsv_list_iter_t *it)
Explicitly free list iterator.
struct xmmsv_coll_St xmmsv_coll_t
int xmmsv_list_get(xmmsv_t *listv, int pos, xmmsv_t **val)
Get the element at the given position in the list xmmsv_t.
struct xmms_playlist_St xmms_playlist_t
#define XMMS_PLAYLIST_CURRPOS_MSG(pos, name)
void xmms_playlist_insert_entry(xmms_playlist_t *playlist, const gchar *plname, guint32 pos, xmms_medialib_entry_t file, xmms_error_t *err)
Insert an entry at a given position in the playlist without validating it.
gboolean xmms_playlist_remove_by_entry(xmms_playlist_t *playlist, xmms_medialib_entry_t entry)
Remove all additions of entry in the playlist.
xmms_mediainfo_reader_t * xmms_playlist_mediainfo_reader_get(xmms_playlist_t *playlist)
returns pointer to mediainfo reader.
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.
xmmsv_type_t xmmsv_get_type(const xmmsv_t *val)
Get the type of the value.
xmmsv_t * xmmsv_new_int(int32_t i)
Allocates a new integer xmmsv_t.
gboolean xmms_collection_set_int_attr(xmmsv_coll_t *coll, const gchar *attrname, gint newval)
Set the attribute of a collection as an integer.
int xmmsv_list_get_size(xmmsv_t *listv)
Return the size of the list.
int xmmsv_coll_idlist_remove(xmmsv_coll_t *coll, int index)
Remove the value at a given index from the idlist.
void xmms_playlist_add_entry_unlocked(xmms_playlist_t *playlist, const gchar *plname, xmmsv_coll_t *plcoll, xmms_medialib_entry_t file, xmms_error_t *err)
Add an entry to the playlist without locking the mutex.
#define XMMS_ACTIVE_PLAYLIST
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 matc...
GTree * xmms_playlist_changed_msg_new(xmms_playlist_t *playlist, xmms_playlist_changed_actions_t type, xmms_medialib_entry_t id, const gchar *plname)
int xmmsv_coll_idlist_set_index(xmmsv_coll_t *coll, int index, int32_t val)
Sets the value at the given position in the idlist.
void xmms_playlist_changed_msg_send(xmms_playlist_t *playlist, GTree *dict)
#define XMMS_DBG(fmt,...)
xmms_playlist_t * xmms_playlist_init(void)
Initializes a new xmms_playlist_t.
void xmms_object_connect(xmms_object_t *object, guint32 signalid, xmms_object_handler_t handler, gpointer userdata)
Connect to a signal that is emitted by this object.
xmms_coll_dag_t * xmms_collection_init(xmms_playlist_t *playlist)
Initializes a new xmms_coll_dag_t.
int xmmsv_list_iter_valid(xmmsv_list_iter_t *it)
Check whether the iterator is valid and points to a valid element.
int xmmsv_get_string(const xmmsv_t *val, const char **r)
Retrieves a string from the value.
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.
#define xmms_object_new(objtype, destroyfunc)
G_BEGIN_DECLS struct xmms_error_St xmms_error_t
xmms_config_property_t * xmms_config_property_register(const gchar *path, const gchar *default_value, xmms_object_handler_t cb, gpointer userdata)
Register a new config property.
struct xmms_config_property_St xmms_config_property_t
int xmmsv_list_iter_entry(xmmsv_list_iter_t *it, xmmsv_t **val)
Get the element currently pointed at by the iterator.
int xmmsv_coll_idlist_move(xmmsv_coll_t *coll, int index, int newindex)
Move a value of the idlist to a new position.
int xmmsv_list_iter_entry_int(xmmsv_list_iter_t *it, int32_t *val)
int xmmsv_coll_idlist_clear(xmmsv_coll_t *coll)
Empties the idlist.
xmms_medialib_entry_t xmms_playlist_current_entry(xmms_playlist_t *playlist)
Retrieve the currently active xmms_medialib_entry_t.
xmmsv_coll_type_t xmmsv_coll_get_type(xmmsv_coll_t *coll)
Return the type of the collection.
int xmmsv_get_coll(const xmmsv_t *val, xmmsv_coll_t **coll)
Retrieves a collection from the value.
struct xmms_coll_dag_St xmms_coll_dag_t
#define XMMS_PLAYLIST_CHANGED_MSG(type, id, name)