mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-26 23:25:56 -05:00
Add player_queue_make_pl() for playlist-based queues
This commit is contained in:
parent
4347731133
commit
4a160e8ad1
35
src/player.c
35
src/player.c
@ -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)
|
||||
{
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user