cache: better implemented changing disk cache folders

Not complete yet, but getting there.
This commit is contained in:
itsmattkc
2020-08-07 02:31:46 +10:00
parent 00d84cfda0
commit df14c2aaa7
33 changed files with 701 additions and 431 deletions
+25
View File
@@ -22,6 +22,10 @@
#include <QDateTime>
#include "node/output/viewer/viewer.h"
#include "project/item/sequence/sequence.h"
#include "project/project.h"
OLIVE_NAMESPACE_ENTER
void PlaybackCache::Invalidate(const TimeRange &r)
@@ -190,4 +194,25 @@ void PlaybackCache::RemoveRangeFromJobs(const TimeRange &remove)
}
}
QString PlaybackCache::GetCacheDirectory() const
{
// NOTE: A lot of assumptions in this behavior
ViewerOutput* viewer = static_cast<ViewerOutput*>(parent());
if (!viewer) {
return QString();
}
Sequence* sequence = static_cast<Sequence*>(viewer->parent());
if (!sequence) {
return QString();
}
Project* project = sequence->project();
if (!project) {
return QString();
}
return project->cache_path();
}
OLIVE_NAMESPACE_EXIT