Add player_queue_make_pl() for playlist-based queues

This commit is contained in:
Kai Elwert 2010-07-31 11:41:36 +02:00 committed by Julien BLACHE
parent 4347731133
commit 4a160e8ad1
2 changed files with 38 additions and 0 deletions

View File

@ -457,6 +457,41 @@ player_queue_make_daap(const char *query, const char *sort)
return ps;
}
struct player_source *
player_queue_make_pl(int plid, uint32_t *id)
{
struct query_params qp;
struct player_source *ps;
struct player_source *p;
uint32_t i;
memset(&qp, 0, sizeof(struct query_params));
qp.id = plid;
qp.type = Q_PLITEMS;
qp.offset = 0;
qp.limit = 0;
ps = player_queue_make(&qp, NULL);
p = ps;
i = 0;
do
{
if (p->id == *id)
{
*id = i;
break;
}
p = p->pl_next;
i++;
}
while (p != ps);
return ps;
}
static void
source_free(struct player_source *ps)
{

View File

@ -97,6 +97,9 @@ player_shuffle_set(int enable);
struct player_source *
player_queue_make_daap(const char *query, const char *sort);
struct player_source *
player_queue_make_pl(int plid, uint32_t *id);
int
player_queue_add(struct player_source *ps);