kopia lustrzana https://github.com/jameshball/osci-render
Merge pull request #71 from jameshball/lua-vst-fix
Fix lua values so they update when the interface is closedpull/170/head
commit
9fa9d89cb7
|
@ -112,6 +112,10 @@ OscirenderAudioProcessor::OscirenderAudioProcessor()
|
|||
addLuaSlider();
|
||||
}
|
||||
|
||||
for (auto& effect : luaEffects) {
|
||||
effect->addListener(0, this);
|
||||
}
|
||||
|
||||
allEffects = toggleableEffects;
|
||||
allEffects.insert(allEffects.end(), permanentEffects.begin(), permanentEffects.end());
|
||||
allEffects.insert(allEffects.end(), luaEffects.begin(), luaEffects.end());
|
||||
|
@ -144,7 +148,11 @@ OscirenderAudioProcessor::OscirenderAudioProcessor()
|
|||
synth.addSound(defaultSound);
|
||||
}
|
||||
|
||||
OscirenderAudioProcessor::~OscirenderAudioProcessor() {}
|
||||
OscirenderAudioProcessor::~OscirenderAudioProcessor() {
|
||||
for (auto& effect : luaEffects) {
|
||||
effect->removeListener(0, this);
|
||||
}
|
||||
}
|
||||
|
||||
const juce::String OscirenderAudioProcessor::getName() const {
|
||||
return JucePlugin_Name;
|
||||
|
@ -674,6 +682,18 @@ void OscirenderAudioProcessor::consumerStop(std::shared_ptr<BufferConsumer> cons
|
|||
}
|
||||
}
|
||||
|
||||
void OscirenderAudioProcessor::parameterValueChanged(int parameterIndex, float newValue) {
|
||||
// call apply on lua effects
|
||||
for (auto& effect : luaEffects) {
|
||||
if (parameterIndex == effect->parameters[0]->getParameterIndex()) {
|
||||
effect->apply();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OscirenderAudioProcessor::parameterGestureChanged(int parameterIndex, bool gestureIsStarting) {}
|
||||
|
||||
|
||||
//==============================================================================
|
||||
// This creates new instances of the plugin..
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
//==============================================================================
|
||||
/**
|
||||
*/
|
||||
class OscirenderAudioProcessor : public juce::AudioProcessor
|
||||
class OscirenderAudioProcessor : public juce::AudioProcessor, juce::AudioProcessorParameter::Listener
|
||||
#if JucePlugin_Enable_ARA
|
||||
, public juce::AudioProcessorARAExtension
|
||||
#endif
|
||||
|
@ -62,6 +62,8 @@ public:
|
|||
std::shared_ptr<BufferConsumer> consumerRegister(std::vector<float>& buffer);
|
||||
void consumerStop(std::shared_ptr<BufferConsumer> consumer);
|
||||
void consumerRead(std::shared_ptr<BufferConsumer> consumer);
|
||||
void parameterValueChanged(int parameterIndex, float newValue) override;
|
||||
void parameterGestureChanged(int parameterIndex, bool gestureIsStarting) override;
|
||||
|
||||
int VERSION_HINT = 1;
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@ LuaListComponent::LuaListComponent(OscirenderAudioProcessor& p, Effect& effect)
|
|||
|
||||
effectComponent->slider.onValueChange = [this, &effect, &p] {
|
||||
effect.setValue(effectComponent->slider.getValue());
|
||||
effect.apply(0, Vector2());
|
||||
};
|
||||
|
||||
addAndMakeVisible(*effectComponent);
|
||||
|
|
Ładowanie…
Reference in New Issue