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:
parent
0f3e5d5963
commit
e983d69322
|
@ -14,6 +14,8 @@ namespace libsaria
|
|||
void for_each(SourceModel *);
|
||||
unsigned int size();
|
||||
|
||||
void next();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue