- Bank/Patch load/save: Opens fileChooser on btn press and calls pluginProcessor
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user