diff --git a/Source/PluginEditor.h b/Source/PluginEditor.h index d07a6c6..d0ce6eb 100644 --- a/Source/PluginEditor.h +++ b/Source/PluginEditor.h @@ -146,12 +146,13 @@ public: void setAudioBuffer(AudioBuffer* buf, int samplerate, int len); void beginAddingAudioBlocks(int channels, int samplerate, int totalllen); void addAudioBlock(AudioBuffer& buf, int samplerate, int pos); + WaveformComponent m_wavecomponent; private: PaulstretchpluginAudioProcessor& processor; std::vector> m_parcomps; ToggleButton m_rec_enable; TextButton m_import_button; Label m_info_label; - WaveformComponent m_wavecomponent; + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PaulstretchpluginAudioProcessorEditor) }; diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index 16e670f..cb17345 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -275,9 +275,10 @@ void PaulstretchpluginAudioProcessor::setStateInformation (const void* data, int setAudioFile(f); Timer::callAfterDelay(500, [this,f]() { - callGUI([f](PaulstretchpluginAudioProcessorEditor* ed) + callGUI([f,this](PaulstretchpluginAudioProcessorEditor* ed) { ed->setAudioFile(f); + ed->m_wavecomponent.setTimeSelection({ *getFloatParameter(5),*getFloatParameter(6) }); }, false); });