- 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] You can add your own user definitions and misc code here...
|
||||||
//[/MiscUserDefs]
|
//[/MiscUserDefs]
|
||||||
|
|
||||||
|
using namespace juce;
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
JaySynthAudioProcessorEditor::JaySynthAudioProcessorEditor (JaySynthAudioProcessor* ownerFilter, bool has_wt)
|
JaySynthAudioProcessorEditor::JaySynthAudioProcessorEditor (JaySynthAudioProcessor* ownerFilter, bool has_wt)
|
||||||
: AudioProcessorEditor (ownerFilter)
|
: AudioProcessorEditor (ownerFilter)
|
||||||
@@ -4927,7 +4929,43 @@ void JaySynthAudioProcessorEditor::buttonClicked (Button* buttonThatWasClicked)
|
|||||||
float value;
|
float value;
|
||||||
param_info_t *pParamInfo;
|
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);
|
getProcessor()->setCurrentProgram(getProcessor()->getCurrentProgram()+1);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -911,6 +911,26 @@ void JaySynthAudioProcessor::setCurrentProgramStateInformation (const void* data
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void JaySynthAudioProcessor::loadPatch (int index, const File &file)
|
||||||
|
{
|
||||||
|
String filename(file.getFullPathName());
|
||||||
|
}
|
||||||
|
|
||||||
|
void JaySynthAudioProcessor::savePatch (int index, const File &file)
|
||||||
|
{
|
||||||
|
String filename(file.getFullPathName());
|
||||||
|
}
|
||||||
|
|
||||||
|
void JaySynthAudioProcessor::loadBank (const File &file)
|
||||||
|
{
|
||||||
|
String filename(file.getFullPathName());
|
||||||
|
}
|
||||||
|
|
||||||
|
void JaySynthAudioProcessor::saveBank (const File &file)
|
||||||
|
{
|
||||||
|
String filename(file.getFullPathName());
|
||||||
|
}
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
// This creates new instances of the plugin..
|
// This creates new instances of the plugin..
|
||||||
AudioProcessor* JUCE_CALLTYPE createPluginFilter()
|
AudioProcessor* JUCE_CALLTYPE createPluginFilter()
|
||||||
|
|||||||
@@ -211,6 +211,10 @@ public:
|
|||||||
void getStateInformation (MemoryBlock& destData);
|
void getStateInformation (MemoryBlock& destData);
|
||||||
void setStateInformation (const void* data, int sizeInBytes);
|
void setStateInformation (const void* data, int sizeInBytes);
|
||||||
|
|
||||||
|
void loadPatch (int index, const File &file);
|
||||||
|
void savePatch (int index, const File &file);
|
||||||
|
void loadBank (const File &file);
|
||||||
|
void saveBank (const File &file);
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
// These properties are public so that our editor component can access them
|
// These properties are public so that our editor component can access them
|
||||||
// A bit of a hacky way to do it, but it's only a demo! Obviously in your own
|
// A bit of a hacky way to do it, but it's only a demo! Obviously in your own
|
||||||
|
|||||||
Reference in New Issue
Block a user