diff --git a/Source/JaySynthAudioProcessorEditor.cpp b/Source/JaySynthAudioProcessorEditor.cpp index ee236e4..223b7a9 100644 --- a/Source/JaySynthAudioProcessorEditor.cpp +++ b/Source/JaySynthAudioProcessorEditor.cpp @@ -2384,7 +2384,7 @@ JaySynthAudioProcessorEditor::JaySynthAudioProcessorEditor (JaySynthAudioProcess for (int i=0; i < SYNTH_NUM_PARAMS; i++) { Button *pButton; - pButton = (Button*)findChildWithID(String("BUTTON ") + String(i)); + pButton = (Button*)findChildWithID(String("PARAM_BUTTON ") + String(i)); if (pButton) pButton->addMouseListener (this, false); } @@ -4986,6 +4986,17 @@ void JaySynthAudioProcessorEditor::buttonClicked (Button* buttonThatWasClicked) return; } + if (buttonThatWasClicked->getComponentID().startsWith("PARAM")) + { + paramID = (int)(buttonThatWasClicked->getComponentID()).getTrailingIntValue(); + value = (float)buttonThatWasClicked->getToggleState(); + pParamInfo = getParamInfo(paramID); + if (pParamInfo) + { + getProcessor()->setParam(paramID, toParam(pParamInfo, (synth_float_t)value), true, true); + } + } + if (buttonThatWasClicked == m_button_humanize_enable) { getProcessor()->humanizeModeChanged(); @@ -5000,17 +5011,6 @@ void JaySynthAudioProcessorEditor::buttonClicked (Button* buttonThatWasClicked) { getProcessor()->unisonoModeChanged(); } - - if (buttonThatWasClicked->getComponentID().startsWith("PARAM")) - { - paramID = (int)(buttonThatWasClicked->getComponentID()).getTrailingIntValue(); - value = (float)buttonThatWasClicked->getToggleState(); - pParamInfo = getParamInfo(paramID); - if (pParamInfo) - { - getProcessor()->setParam(paramID, toParam(pParamInfo, (synth_float_t)value), true, true); - } - } } void JaySynthAudioProcessorEditor::mouseDown (const MouseEvent &m)