libsaria: LoadTasks take an extra argument

I want to pass a playlist argument through during playlist construction,
so I changed the LoadTask to handle it.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
Bryan Schumaker 2012-02-18 09:33:36 -05:00 committed by Bryan Schumaker
parent 7a355d1434
commit c452af1ce7
2 changed files with 16 additions and 1 deletions

View File

@ -23,9 +23,12 @@ class LoadTask : public IdleTask
{
private:
void (*load_func)();
void (*load_func_aux)(void *);
void *load_aux;
public:
LoadTask(void (*func)());
LoadTask(void (*func)(void *), void *);
~LoadTask();
void run_task();
};

View File

@ -19,6 +19,15 @@ void SaveTask::run_task()
LoadTask::LoadTask(void (*func)())
{
load_func = func;
load_func_aux = NULL;
load_aux = NULL;
}
LoadTask::LoadTask(void (*func)(void *), void *aux)
{
load_func = NULL;
load_func_aux= func;
load_aux = aux;
}
LoadTask::~LoadTask()
@ -27,7 +36,10 @@ LoadTask::~LoadTask()
void LoadTask::run_task()
{
load_func();
if (load_func)
load_func();
else
load_func_aux(load_aux);
}
OutFile::OutFile(string path)