Remember directory
This commit is contained in:
@@ -32,6 +32,8 @@ using namespace juce;
|
|||||||
JaySynthAudioProcessorEditor::JaySynthAudioProcessorEditor (JaySynthAudioProcessor* ownerFilter, bool has_wt)
|
JaySynthAudioProcessorEditor::JaySynthAudioProcessorEditor (JaySynthAudioProcessor* ownerFilter, bool has_wt)
|
||||||
: AudioProcessorEditor (ownerFilter)
|
: AudioProcessorEditor (ownerFilter)
|
||||||
{
|
{
|
||||||
|
m_fileChooserDirectory = File::getSpecialLocation (File::currentExecutableFile).getParentDirectory();
|
||||||
|
|
||||||
addAndMakeVisible (m_label_colon = new Label ("Colon",
|
addAndMakeVisible (m_label_colon = new Label ("Colon",
|
||||||
TRANS(":")));
|
TRANS(":")));
|
||||||
m_label_colon->setFont (Font ("Times New Roman", 20.00f, Font::plain));
|
m_label_colon->setFont (Font ("Times New Roman", 20.00f, Font::plain));
|
||||||
@@ -4932,42 +4934,46 @@ void JaySynthAudioProcessorEditor::buttonClicked (Button* buttonThatWasClicked)
|
|||||||
if (buttonThatWasClicked == m_button_bank_load)
|
if (buttonThatWasClicked == m_button_bank_load)
|
||||||
{
|
{
|
||||||
String filePatterns("*.fxb;*.xml");
|
String filePatterns("*.fxb;*.xml");
|
||||||
FileChooser fc("Load bank", File::nonexistent, filePatterns, false);
|
FileChooser fc("Load bank", m_fileChooserDirectory, filePatterns, false);
|
||||||
if (fc.browseForFileToOpen())
|
if (fc.browseForFileToOpen())
|
||||||
{
|
{
|
||||||
File const &file = fc.getResult();
|
File const &file = fc.getResult();
|
||||||
getProcessor()->loadBank(file);
|
getProcessor()->loadBank(file);
|
||||||
|
m_fileChooserDirectory = file;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (buttonThatWasClicked == m_button_bank_save)
|
else if (buttonThatWasClicked == m_button_bank_save)
|
||||||
{
|
{
|
||||||
String filePatterns("*.fxb;*.xml");
|
String filePatterns("*.fxb;*.xml");
|
||||||
FileChooser fc("Save bank", File::nonexistent, filePatterns, false);
|
FileChooser fc("Save bank", m_fileChooserDirectory, filePatterns, false);
|
||||||
if (fc.browseForFileToSave(true))
|
if (fc.browseForFileToSave(true))
|
||||||
{
|
{
|
||||||
File const &file = fc.getResult();
|
File const &file = fc.getResult();
|
||||||
getProcessor()->saveBank(file);
|
getProcessor()->saveBank(file);
|
||||||
|
m_fileChooserDirectory = file;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (buttonThatWasClicked == m_button_patch_load)
|
else if (buttonThatWasClicked == m_button_patch_load)
|
||||||
{
|
{
|
||||||
String filePatterns("*.fxp;*.xml");
|
String filePatterns("*.fxp;*.xml");
|
||||||
FileChooser fc("Load patch", File::nonexistent, filePatterns, false);
|
FileChooser fc("Load patch", m_fileChooserDirectory, filePatterns, false);
|
||||||
if (fc.browseForFileToOpen())
|
if (fc.browseForFileToOpen())
|
||||||
{
|
{
|
||||||
File const &file = fc.getResult();
|
File const &file = fc.getResult();
|
||||||
getProcessor()->loadPatch(file, 0);
|
getProcessor()->loadPatch(file, 0);
|
||||||
|
m_fileChooserDirectory = file;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (buttonThatWasClicked == m_button_patch_save)
|
else if (buttonThatWasClicked == m_button_patch_save)
|
||||||
{
|
{
|
||||||
String filePatterns("*.fxp;*.xml");
|
String filePatterns("*.fxp;*.xml");
|
||||||
FileChooser fc("Save patch", File::nonexistent, filePatterns, false);
|
FileChooser fc("Save patch", m_fileChooserDirectory, filePatterns, false);
|
||||||
if (fc.browseForFileToSave(true))
|
if (fc.browseForFileToSave(true))
|
||||||
{
|
{
|
||||||
File const &file = fc.getResult();
|
File const &file = fc.getResult();
|
||||||
getProcessor()->savePatch(file, 0);
|
getProcessor()->savePatch(file, 0);
|
||||||
}
|
m_fileChooserDirectory = file;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (buttonThatWasClicked == m_button_patch_incr)
|
else if (buttonThatWasClicked == m_button_patch_incr)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -102,6 +102,7 @@ private:
|
|||||||
String m_mod_src_op_names[VOICE_NUM_MOD_OPS];
|
String m_mod_src_op_names[VOICE_NUM_MOD_OPS];
|
||||||
String m_mod_src0_cb_names[VOICE_NUM_MOD_SOURCES_0];
|
String m_mod_src0_cb_names[VOICE_NUM_MOD_SOURCES_0];
|
||||||
String m_mod_src1_cb_names[(VOICE_NUM_MOD_SOURCES_1-1)*VOICE_NUM_MOD_OPS + 1];
|
String m_mod_src1_cb_names[(VOICE_NUM_MOD_SOURCES_1-1)*VOICE_NUM_MOD_OPS + 1];
|
||||||
|
File m_fileChooserDirectory;
|
||||||
//[/UserVariables]
|
//[/UserVariables]
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|||||||
Reference in New Issue
Block a user