implemented separate waveform cache

This commit is contained in:
itsmattkc
2022-05-29 17:52:35 -07:00
parent 826090b621
commit 2f7dc3c98b
28 changed files with 381 additions and 178 deletions
@@ -558,11 +558,11 @@ void TimelineView::DrawBlock(QPainter *painter, bool foreground, Block *block, q
// Draw waveform
if (clip->GetTrackType() == Track::kAudio && show_waveforms_) {
if (const AudioVisualWaveform *wave = clip->waveform()) {
if (const AudioWaveformCache *wave = clip->waveform()) {
rational waveform_start = SceneToTime(block_left - block_in, GetScale(), connected_track_list_->parent()->GetAudioParams().sample_rate_as_time_base()) + media_in;
painter->setPen(shadow_color);
AudioVisualWaveform::DrawWaveform(painter, preview_rect, this->GetScale(), *wave, waveform_start);
wave->Draw(painter, preview_rect, this->GetScale(), waveform_start);
}
}