Update waveform component time selection when state restored. Should probably restructure all this stuff so that the GUI can ask for this stuff when it wants, instead of the AudioProcessor making calls into the GUI...
This commit is contained in:
parent
4620ba818e
commit
c283d719d0
@ -146,12 +146,13 @@ public:
|
||||
void setAudioBuffer(AudioBuffer<float>* buf, int samplerate, int len);
|
||||
void beginAddingAudioBlocks(int channels, int samplerate, int totalllen);
|
||||
void addAudioBlock(AudioBuffer<float>& buf, int samplerate, int pos);
|
||||
WaveformComponent m_wavecomponent;
|
||||
private:
|
||||
PaulstretchpluginAudioProcessor& processor;
|
||||
std::vector<std::shared_ptr<ParameterComponent>> 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)
|
||||
};
|
||||
|
@ -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);
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user