cache: save states to disk

This commit is contained in:
itsmattkc
2022-05-29 14:03:09 -07:00
parent 89b6cce2b2
commit 826090b621
10 changed files with 162 additions and 1 deletions
+11
View File
@@ -345,6 +345,10 @@ void PreviewAutoCacher::ConnectToNodeCache(Node *node)
this,
&PreviewAutoCacher::AudioInvalidatedFromCache);
node->video_frame_cache()->LoadState();
node->audio_playback_cache()->LoadState();
node->thumbnail_cache()->LoadState();
// Copy invalidated ranges and start rendering if necessary
if (node->video_frame_cache()->IsAutomatic()) {
VideoAutoCacheEnableChangedFromNode(node, true);
@@ -382,6 +386,10 @@ void PreviewAutoCacher::DisconnectFromNodeCache(Node *node)
this,
&PreviewAutoCacher::AudioInvalidatedFromCache);
node->video_frame_cache()->SaveState();
node->audio_playback_cache()->SaveState();
node->thumbnail_cache()->SaveState();
if (node->video_frame_cache()->IsAutomatic()) {
VideoAutoCacheEnableChangedFromNode(node, false);
}
@@ -841,6 +849,9 @@ void PreviewAutoCacher::SetViewerNode(ViewerOutput *viewer_node)
for (int i=copied_project_.nodes().size(); i<graph->nodes().size(); i++) {
AddNode(graph->nodes().at(i));
}
for (int i=0; i<graph->nodes().size(); i++) {
graph->nodes().at(i)->ConnectedToPreviewEvent();
}
// Find copied viewer node
copied_viewer_node_ = static_cast<ViewerOutput*>(copy_map_.value(viewer_node_));