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:
Bryan Schumaker 2012-02-24 09:34:18 -05:00
parent f3abd0cbc6
commit 98573bf3a9
3 changed files with 10 additions and 1 deletions

View File

@ -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 *);

View File

@ -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;

View File

@ -45,6 +45,7 @@ namespace libsaria
void queue::load()
{
IOTask *task = new IOTask(refresh);
q_queue.reload();
task->queue();
}