Ejemplo n.º 1
0
/**
  * Convenient function for adding a directory to the playlist,
  * It will dive down the URL you feed it and recursivly add
  * all files there.
  *
  * @param playlist the playlist to add it URL to.
  * @param plname the name of the playlist to modify.
  * @param nurl the URL of an directory you want to add
  * @param err an #xmms_error_t that should be defined upon error.
  */
static void
xmms_playlist_client_radd (xmms_playlist_t *playlist, const gchar *plname,
                           const gchar *path, xmms_error_t *err)
{
	xmmsv_coll_t *idlist;
	xmmsv_list_iter_t *it;
	xmmsv_t *list;

	idlist = xmms_medialib_add_recursive (playlist->medialib, path, err);
	list = xmmsv_coll_idlist_get (idlist);

	xmmsv_get_list_iter (list, &it);
	while (xmmsv_list_iter_valid (it)) {
		xmms_medialib_entry_t entry;
		xmmsv_t *value;

		xmmsv_list_iter_entry (it, &value);
		xmmsv_get_int (value, &entry);

		xmms_playlist_add_entry (playlist, plname, entry, err);

		xmmsv_list_iter_next (it);
	}
	xmmsv_coll_unref (idlist);
}
Ejemplo n.º 2
0
static void
xmms_medialib_client_import_path (xmms_medialib_t *medialib, const gchar *path,
                                  xmms_error_t *error)
{
	xmmsv_unref (xmms_medialib_add_recursive (medialib, path, error));
}