implemented base for thumbnail display

This commit is contained in:
itsmattkc
2022-05-25 11:18:08 -07:00
parent 44b9888efb
commit 60f7f06de4
21 changed files with 503 additions and 328 deletions
+4 -2
View File
@@ -187,9 +187,9 @@ void ClipBlock::InvalidateCache(const TimeRange& range, const QString& from, int
if (Node *connected = GetConnectedOutput(from, element)) {
TimeRange max_range = InputTimeAdjustment(from, element, TimeRange(0, length()));
if (type == Track::kVideo) {
emit connected->video_frame_cache()->Request(range.Intersected(max_range), true);
emit connected->video_frame_cache()->Request(range.Intersected(max_range), PlaybackCache::kPreviewsOnly);
} else if (type == Track::kAudio) {
emit connected->audio_playback_cache()->Request(range.Intersected(max_range), true);
emit connected->audio_playback_cache()->Request(range.Intersected(max_range), PlaybackCache::kPreviewsOnly);
}
}
}
@@ -250,6 +250,7 @@ void ClipBlock::InputConnectedEvent(const QString &input, int element, Node *out
super::InputConnectedEvent(input, element, output);
if (input == kBufferIn) {
connect(output->video_frame_cache(), &FrameHashCache::ThumbnailsUpdated, this, &Block::PreviewChanged);
connect(output->audio_playback_cache(), &AudioPlaybackCache::WaveformUpdated, this, &Block::PreviewChanged);
}
}
@@ -259,6 +260,7 @@ void ClipBlock::InputDisconnectedEvent(const QString &input, int element, Node *
super::InputDisconnectedEvent(input, element, output);
if (input == kBufferIn) {
disconnect(output->video_frame_cache(), &FrameHashCache::ThumbnailsUpdated, this, &Block::PreviewChanged);
disconnect(output->audio_playback_cache(), &AudioPlaybackCache::WaveformUpdated, this, &Block::PreviewChanged);
}
}
+9
View File
@@ -119,6 +119,15 @@ public:
return block_links_;
}
const FrameHashCache *thumbnails()
{
if (Node *n = GetConnectedOutput(kBufferIn)) {
return n->video_frame_cache();
} else {
return nullptr;
}
}
const AudioVisualWaveform *waveform()
{
if (Node *n = GetConnectedOutput(kBufferIn)) {