libsaria: Chose next songs from the queue

If there are songs in the queue, I pick from there.  Otherwise, I pick
from the library.
This commit is contained in:
Bryan Schumaker 2011-12-11 16:25:24 -05:00
parent 0f3e5d5963
commit e983d69322
3 changed files with 14 additions and 1 deletions

View File

@ -14,6 +14,8 @@ namespace libsaria
void for_each(SourceModel *);
unsigned int size();
void next();
}
}

View File

@ -1,13 +1,17 @@
#include <libsaria/controls.h>
#include <libsaria/library.h>
#include <libsaria/queue.h>
namespace libsaria
{
void next()
{
library::next();
if (queue::size() > 0)
queue::next();
else
library::next();
}
}; /* Namespace: libsaria */

View File

@ -35,4 +35,11 @@ namespace libsaria
return playqueue.size();
}
void queue::next()
{
library::play_id(playqueue.front());
playqueue.pop_front();
trigger_callback(QUEUE_REFRESH);
}
} /* Namespace: libsaria */