- Bank/Patch load/save: Opens fileChooser on btn press and calls pluginProcessor

This commit is contained in:
2023-04-28 09:47:31 +02:00
parent 45f2696b77
commit 5850ab5d46
3 changed files with 63 additions and 1 deletions
+39 -1
View File
@@ -26,6 +26,8 @@
//[MiscUserDefs] You can add your own user definitions and misc code here...
//[/MiscUserDefs]
using namespace juce;
//==============================================================================
JaySynthAudioProcessorEditor::JaySynthAudioProcessorEditor (JaySynthAudioProcessor* ownerFilter, bool has_wt)
: AudioProcessorEditor (ownerFilter)
@@ -4927,7 +4929,43 @@ void JaySynthAudioProcessorEditor::buttonClicked (Button* buttonThatWasClicked)
float value;
param_info_t *pParamInfo;
if (buttonThatWasClicked == m_button_patch_incr)
if (buttonThatWasClicked == m_button_bank_load)
{
FileChooser fc("Load bank");
if (fc.browseForFileToOpen())
{
File const &file = fc.getResult();
getProcessor()->loadBank(file);
}
}
else if (buttonThatWasClicked == m_button_bank_save)
{
FileChooser fc("Save bank");
if (fc.browseForFileToSave(true))
{
File const &file = fc.getResult();
getProcessor()->saveBank(file);
}
}
else if (buttonThatWasClicked == m_button_patch_load)
{
FileChooser fc("Load patch");
if (fc.browseForFileToOpen())
{
File const &file = fc.getResult();
getProcessor()->loadPatch(0, file);
}
}
else if (buttonThatWasClicked == m_button_patch_save)
{
FileChooser fc("Save patch");
if (fc.browseForFileToSave(true))
{
File const &file = fc.getResult();
getProcessor()->savePatch(0, file);
}
}
else if (buttonThatWasClicked == m_button_patch_incr)
{
getProcessor()->setCurrentProgram(getProcessor()->getCurrentProgram()+1);
return;