libsaria: Implement a next() function
This will pick the next song from the library to play.
This commit is contained in:
parent
9379a2cf33
commit
e908f46c21
|
@ -0,0 +1,9 @@
|
|||
#ifndef LIBSARIA_CONTROLS_H
|
||||
#define LIBSARIA_CONTROLS_H
|
||||
|
||||
namespace libsaria
|
||||
{
|
||||
void next();
|
||||
};
|
||||
|
||||
#endif /* LIBSARIA_CONTROLS_H */
|
|
@ -23,6 +23,7 @@ namespace libsaria
|
|||
void update_path(string);
|
||||
void refresh();
|
||||
|
||||
void next();
|
||||
void add_path(string);
|
||||
void remove_path(string);
|
||||
void play_id(ino_t &);
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
|
||||
#include <libsaria/controls.h>
|
||||
#include <libsaria/library.h>
|
||||
|
||||
namespace libsaria
|
||||
{
|
||||
|
||||
void next()
|
||||
{
|
||||
library::next();
|
||||
}
|
||||
|
||||
}; /* Namespace: libsaria */
|
|
@ -119,6 +119,14 @@ namespace libsaria
|
|||
return false;
|
||||
}
|
||||
|
||||
void library::next()
|
||||
{
|
||||
cur_track++;
|
||||
if (cur_track == play_list.end())
|
||||
cur_track = play_list.begin();
|
||||
libsaria::audio::load((*cur_track)->get_filepath());
|
||||
}
|
||||
|
||||
unsigned int library::size()
|
||||
{
|
||||
return play_list.size();
|
||||
|
|
Loading…
Reference in New Issue