Browse Source

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...

tags/v100_p5
xenakios 7 years ago
parent
commit
c283d719d0
2 changed files with 4 additions and 2 deletions
  1. +2
    -1
      Source/PluginEditor.h
  2. +2
    -1
      Source/PluginProcessor.cpp

+ 2
- 1
Source/PluginEditor.h View File

@@ -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)
};

+ 2
- 1
Source/PluginProcessor.cpp View File

@@ -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…
Cancel
Save