waveforms: moved waveform to track rather than block

This is a much more robust and thread-safe system of storing the waveforms.
This commit is contained in:
itsmattkc
2020-06-04 18:03:21 +10:00
parent 9ff9817b95
commit 0e87762afa
19 changed files with 184 additions and 336 deletions
@@ -97,10 +97,14 @@ void TimelineViewBlockItem::paint(QPainter *painter, const QStyleOptionGraphicsI
// Draw waveform if one is available
painter->setPen(QColor(64, 64, 64));
AudioVisualWaveform::DrawWaveform(painter,
rect().toRect(),
this->GetScale(),
static_cast<ClipBlock*>(block_)->waveform());
TrackOutput* track = TrackOutput::TrackFromBlock(block_);
if (track) {
AudioVisualWaveform::DrawWaveform(painter,
rect().toRect(),
this->GetScale(),
track->waveform(),
block_->in());
}
painter->setPen(Qt::white);
painter->drawLine(rect().topLeft(), QPointF(rect().right(), rect().top()));