cache: improved code pathways for cache

Viewers are now more aware of each other and can pause each others' cache tasks
when one of them plays, as well as wait for other viewers' cache tasks to
finish before starting their own.
This commit is contained in:
itsmattkc
2020-05-24 18:10:38 +10:00
parent 4f21a930dd
commit efdf56acf8
3 changed files with 91 additions and 42 deletions
+8 -1
View File
@@ -1136,9 +1136,16 @@ void Core::CacheActiveSequence(bool in_out_only)
in_out_only);
// Stop any current auto-cache tasks
ViewerWidget::StopAllBackgroundCacheTasks();
ViewerWidget::StopAllBackgroundCacheTasks(true);
ViewerWidget::SetBackgroundCacheTask(task);
TaskDialog* dialog = new TaskDialog(task, tr("Caching Sequence"), main_window_);
connect(dialog,
&TaskDialog::TaskSucceeded,
this,
[] { ViewerWidget::SetBackgroundCacheTask(nullptr); });
dialog->open();
}
}