- refactored XML structure

- new XML structure not compatible to old structure
This commit is contained in:
2023-04-29 00:05:13 +02:00
parent 08b70cb57b
commit ca353251f4
3 changed files with 142 additions and 96 deletions
+31 -27
View File
@@ -2126,26 +2126,26 @@ JaySynthAudioProcessorEditor::JaySynthAudioProcessorEditor (JaySynthAudioProcess
// --------------------------------------------------------------------
// Buttons
// --------------------------------------------------------------------
m_btn_osc0_enable->setComponentID(String("BUTTON ") + String(SYNTH_PARAM_OSC_0_ENABLE));
m_btn_osc1_enable->setComponentID(String("BUTTON ") + String(SYNTH_PARAM_OSC_1_ENABLE));
m_btn_noise_enable_led->setComponentID(String("BUTTON ") + String(SYNTH_PARAM_NOISE_ENABLE));
m_button_humanize_enable->setComponentID(String("BUTTON ") + String(SYNTH_PARAM_HUMANIZE_ENABLE));
m_button_mono_enable->setComponentID(String("BUTTON ") + String(SYNTH_PARAM_MONOPHONIC_ENABLE));
m_button_mono_retrigger->setComponentID(String("BUTTON ") + String(SYNTH_PARAM_MONOPHONIC_RETRIGGER_ENABLE));
m_button_unisono_enable->setComponentID(String("BUTTON ") + String(SYNTH_PARAM_UNISONO_ENABLE));
m_btn_osc0_enable->setComponentID(String("PARAM_BUTTON ") + String(SYNTH_PARAM_OSC_0_ENABLE));
m_btn_osc1_enable->setComponentID(String("PARAM_BUTTON ") + String(SYNTH_PARAM_OSC_1_ENABLE));
m_btn_noise_enable_led->setComponentID(String("PARAM_BUTTON ") + String(SYNTH_PARAM_NOISE_ENABLE));
m_button_humanize_enable->setComponentID(String("PARAM_BUTTON ") + String(SYNTH_PARAM_HUMANIZE_ENABLE));
m_button_mono_enable->setComponentID(String("PARAM_BUTTON ") + String(SYNTH_PARAM_MONOPHONIC_ENABLE));
m_button_mono_retrigger->setComponentID(String("PARAM_BUTTON ") + String(SYNTH_PARAM_MONOPHONIC_RETRIGGER_ENABLE));
m_button_unisono_enable->setComponentID(String("PARAM_BUTTON ") + String(SYNTH_PARAM_UNISONO_ENABLE));
m_button_osc0_restart_enable->setComponentID(String("BUTTON ") + String(SYNTH_PARAM_OSC_0_RESTART_ON_TRIGGER));
m_button_osc1_restart_enable->setComponentID(String("BUTTON ") + String(SYNTH_PARAM_OSC_1_RESTART_ON_TRIGGER));
m_button_osc0_restart_enable->setComponentID(String("PARAM_BUTTON ") + String(SYNTH_PARAM_OSC_0_RESTART_ON_TRIGGER));
m_button_osc1_restart_enable->setComponentID(String("PARAM_BUTTON ") + String(SYNTH_PARAM_OSC_1_RESTART_ON_TRIGGER));
m_button_lfo0_restart_enable->setComponentID(String("BUTTON ") + String(SYNTH_PARAM_LFO_0_SYNC));
m_button_lfo1_restart_enable->setComponentID(String("BUTTON ") + String(SYNTH_PARAM_LFO_1_SYNC));
m_button_lfo2_restart_enable->setComponentID(String("BUTTON ") + String(SYNTH_PARAM_LFO_2_SYNC));
m_button_lfo3_restart_enable->setComponentID(String("BUTTON ") + String(SYNTH_PARAM_LFO_3_SYNC));
m_button_lfo0_restart_enable->setComponentID(String("PARAM_BUTTON ") + String(SYNTH_PARAM_LFO_0_SYNC));
m_button_lfo1_restart_enable->setComponentID(String("PARAM_BUTTON ") + String(SYNTH_PARAM_LFO_1_SYNC));
m_button_lfo2_restart_enable->setComponentID(String("PARAM_BUTTON ") + String(SYNTH_PARAM_LFO_2_SYNC));
m_button_lfo3_restart_enable->setComponentID(String("PARAM_BUTTON ") + String(SYNTH_PARAM_LFO_3_SYNC));
m_button_lfo0_individual_enable->setComponentID(String("BUTTON ") + String(SYNTH_PARAM_LFO_0_MODE));
m_button_lfo1_individual_enable->setComponentID(String("BUTTON ") + String(SYNTH_PARAM_LFO_1_MODE));
m_button_lfo2_individual_enable->setComponentID(String("BUTTON ") + String(SYNTH_PARAM_LFO_2_MODE));
m_button_lfo3_individual_enable->setComponentID(String("BUTTON ") + String(SYNTH_PARAM_LFO_3_MODE));
m_button_lfo0_individual_enable->setComponentID(String("PARAM_BUTTON ") + String(SYNTH_PARAM_LFO_0_MODE));
m_button_lfo1_individual_enable->setComponentID(String("PARAM_BUTTON ") + String(SYNTH_PARAM_LFO_1_MODE));
m_button_lfo2_individual_enable->setComponentID(String("PARAM_BUTTON ") + String(SYNTH_PARAM_LFO_2_MODE));
m_button_lfo3_individual_enable->setComponentID(String("PARAM_BUTTON ") + String(SYNTH_PARAM_LFO_3_MODE));
// --------------------------------------------------------------------
// Sliders
@@ -4933,7 +4933,7 @@ void JaySynthAudioProcessorEditor::buttonClicked (Button* buttonThatWasClicked)
if (buttonThatWasClicked == m_button_bank_load)
{
String filePatterns("*.fxb;*.xml");
String filePatterns("*.fxb;*.xmb");
FileChooser fc("Load bank", m_fileChooserDirectory, filePatterns, false);
if (fc.browseForFileToOpen())
{
@@ -4944,7 +4944,7 @@ void JaySynthAudioProcessorEditor::buttonClicked (Button* buttonThatWasClicked)
}
else if (buttonThatWasClicked == m_button_bank_save)
{
String filePatterns("*.fxb;*.xml");
String filePatterns("*.fxb;*.xmb");
FileChooser fc("Save bank", m_fileChooserDirectory, filePatterns, false);
if (fc.browseForFileToSave(true))
{
@@ -4955,7 +4955,7 @@ void JaySynthAudioProcessorEditor::buttonClicked (Button* buttonThatWasClicked)
}
else if (buttonThatWasClicked == m_button_patch_load)
{
String filePatterns("*.fxp;*.xml");
String filePatterns("*.fxp;*.xmp");
FileChooser fc("Load patch", m_fileChooserDirectory, filePatterns, false);
if (fc.browseForFileToOpen())
{
@@ -4966,7 +4966,7 @@ void JaySynthAudioProcessorEditor::buttonClicked (Button* buttonThatWasClicked)
}
else if (buttonThatWasClicked == m_button_patch_save)
{
String filePatterns("*.fxp;*.xml");
String filePatterns("*.fxp;*.xmp");
FileChooser fc("Save patch", m_fileChooserDirectory, filePatterns, false);
if (fc.browseForFileToSave(true))
{
@@ -4986,12 +4986,6 @@ void JaySynthAudioProcessorEditor::buttonClicked (Button* buttonThatWasClicked)
return;
}
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();
@@ -5007,6 +5001,16 @@ 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)