implemented base for thumbnail display
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user