libsaria: Create a function for reloading a playlist
I don't think I'll need this once I implement dynamic, stackable playlists, but for now I need a way of scheduling the idle task. Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
parent
f3abd0cbc6
commit
98573bf3a9
|
@ -43,6 +43,7 @@ namespace libsaria
|
|||
void do_save();
|
||||
void load();
|
||||
void save();
|
||||
void reload();
|
||||
|
||||
void add_ids(list<sid_t> &);
|
||||
void add_track(Track *);
|
||||
|
|
|
@ -18,12 +18,13 @@ namespace libsaria
|
|||
filename = file;
|
||||
flags = options;
|
||||
cur = plist.end();
|
||||
it = plist.end();
|
||||
load();
|
||||
}
|
||||
|
||||
Playlist::Playlist(string file, unsigned int options)
|
||||
{
|
||||
init_common(file, options);
|
||||
load();
|
||||
}
|
||||
|
||||
Playlist::Playlist(unsigned int options)
|
||||
|
@ -35,6 +36,12 @@ namespace libsaria
|
|||
{
|
||||
}
|
||||
|
||||
void Playlist::reload()
|
||||
{
|
||||
plist.clear();
|
||||
init_common(filename, flags);
|
||||
}
|
||||
|
||||
void Playlist::add_ids(list<sid_t> &ids)
|
||||
{
|
||||
list<sid_t>::iterator it;
|
||||
|
|
|
@ -45,6 +45,7 @@ namespace libsaria
|
|||
void queue::load()
|
||||
{
|
||||
IOTask *task = new IOTask(refresh);
|
||||
q_queue.reload();
|
||||
task->queue();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue