SimpleTaskProgress::SimpleTaskProgress(const ofx::TaskQueueEventArgs& args): taskId(args.getTaskId()), name(args.getTaskName()), state(args.getState()), progress(0), errorMessage(""), data(""), fader(1) { }
void FileImporter::onTaskFinished(const ofx::TaskQueueEventArgs& args){ ofScopedLock sl(mutex); taskProgress.erase(args.getTaskId()); numDone++; if( numDone == totalNumFile){ ofLogNotice("FileImporter") << "completed " << numDone << " files"; onCompletion(); } updateProgress(); }
void FileImporter::onTaskCancelled(const ofx::TaskQueueEventArgs& args){taskProgress.erase(args.getTaskId());ofLogError("FileImporter","task cancelled");}
void FileImporter::onTaskQueued(const ofx::TaskQueueEventArgs& args){ taskProgress[args.getTaskId()] = 0; }
void SimpleTaskProgress::update(const ofx::TaskQueueEventArgs& args) { taskId = args.getTaskId(); name = args.getTaskName(); state = args.getState(); }