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
+4 -3
View File
@@ -93,11 +93,12 @@ void AudioMonitor::PushSampleBuffer(const SampleBuffer &d)
SetUpdateLoop(true);
}
void AudioMonitor::StartWaveform(const AudioVisualWaveform *waveform, const rational &start, int playback_speed)
void AudioMonitor::StartWaveform(const AudioWaveformCache *waveform, const rational &start, int playback_speed)
{
Stop();
if (start >= waveform->length()) {
waveform_length_ = waveform->length();
if (start >= waveform_length_) {
return;
}
@@ -239,7 +240,7 @@ void AudioMonitor::paintGL()
if (waveform_) {
UpdateValuesFromWaveform(v, delta_time);
if (waveform_time_ >= waveform_->length()) {
if (waveform_time_ >= waveform_length_) {
Stop();
}
}