diff --git a/plugins/AudioFileProcessor/AudioFileProcessorView.cpp b/plugins/AudioFileProcessor/AudioFileProcessorView.cpp index 298e79c5ed1..b38767cd15c 100644 --- a/plugins/AudioFileProcessor/AudioFileProcessorView.cpp +++ b/plugins/AudioFileProcessor/AudioFileProcessorView.cpp @@ -210,6 +210,7 @@ void AudioFileProcessorView::dropEvent(QDropEvent* de) } m_waveView->updateSampleRange(); + m_waveView->updateWaveform(); Engine::getSong()->setModified(); de->accept(); } @@ -263,6 +264,7 @@ void AudioFileProcessorView::openAudioFile() castModel()->setAudioFile(af); Engine::getSong()->setModified(); m_waveView->updateSampleRange(); + m_waveView->updateWaveform(); } void AudioFileProcessorView::modelChanged() diff --git a/plugins/AudioFileProcessor/AudioFileProcessorWaveView.cpp b/plugins/AudioFileProcessor/AudioFileProcessorWaveView.cpp index a69efba726e..2ebcec8841c 100644 --- a/plugins/AudioFileProcessor/AudioFileProcessorWaveView.cpp +++ b/plugins/AudioFileProcessor/AudioFileProcessorWaveView.cpp @@ -49,7 +49,10 @@ void AudioFileProcessorWaveView::updateSampleRange() setFrom(m_sample->startFrame() - marging); setTo(m_sample->endFrame() + marging); } +} +void AudioFileProcessorWaveView::updateWaveform() +{ m_waveform.reset(m_sample->data(), m_sample->sampleSize()); } @@ -92,6 +95,7 @@ AudioFileProcessorWaveView::AudioFileProcessorWaveView(QWidget* parent, int w, i configureKnobRelationsAndWaveViews(); updateSampleRange(); + updateWaveform(); m_graph.fill(Qt::transparent); update(); diff --git a/plugins/AudioFileProcessor/AudioFileProcessorWaveView.h b/plugins/AudioFileProcessor/AudioFileProcessorWaveView.h index 7753d44dc03..c45e0d86876 100644 --- a/plugins/AudioFileProcessor/AudioFileProcessorWaveView.h +++ b/plugins/AudioFileProcessor/AudioFileProcessorWaveView.h @@ -155,6 +155,7 @@ public slots: void updateSampleRange(); + void updateWaveform(); private: void setTo(int to); void setFrom(int from);