From 6e6f57b5a619e94149980867002d2b3544594403 Mon Sep 17 00:00:00 2001 From: George Reales Date: Fri, 22 May 2020 20:04:56 +0200 Subject: [PATCH] Preliminary folder browser support --- OPL.jucer | 2 +- Source/PluginGui.cpp | 56 +++++++++++++++++++++++++++++++++++++------- Source/PluginGui.h | 2 ++ 3 files changed, 51 insertions(+), 9 deletions(-) diff --git a/OPL.jucer b/OPL.jucer index 3fb265a..62f7a4e 100644 --- a/OPL.jucer +++ b/OPL.jucer @@ -1,6 +1,6 @@ -setButtonText (TRANS("Export .SBI")); + exportButton->setButtonText (TRANS("Export")); exportButton->setConnectedEdges (Button::ConnectedOnLeft | Button::ConnectedOnRight); exportButton->addListener (this); exportButton->setColour (TextButton::buttonColourId, Colour (0xff007f00)); @@ -1163,13 +1163,13 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) loadButton.reset (new TextButton ("load button")); addAndMakeVisible (loadButton.get()); - loadButton->setButtonText (TRANS("Load .SBI")); + loadButton->setButtonText (TRANS("Load")); loadButton->setConnectedEdges (Button::ConnectedOnLeft | Button::ConnectedOnRight); loadButton->addListener (this); loadButton->setColour (TextButton::buttonColourId, Colour (0xff007f00)); loadButton->setColour (TextButton::buttonOnColourId, Colours::lime); - loadButton->setBounds (728, 472, 96, 24); + loadButton->setBounds (728, 472, 48, 24); versionLabel.reset (new Label ("version label", String())); @@ -2025,6 +2025,26 @@ PluginGui::PluginGui (AdlibBlasterAudioProcessor* ownerFilter) dbLabel8->setBounds (392, 520, 72, 40); + previousButton.reset (new TextButton ("previous button")); + addAndMakeVisible (previousButton.get()); + previousButton->setButtonText (TRANS("-")); + previousButton->setConnectedEdges (Button::ConnectedOnLeft | Button::ConnectedOnRight); + previousButton->addListener (this); + previousButton->setColour (TextButton::buttonColourId, Colour (0xff007f00)); + previousButton->setColour (TextButton::buttonOnColourId, Colours::lime); + + previousButton->setBounds (776, 472, 24, 24); + + nextButton.reset (new TextButton ("next button")); + addAndMakeVisible (nextButton.get()); + nextButton->setButtonText (TRANS("+")); + nextButton->setConnectedEdges (Button::ConnectedOnLeft | Button::ConnectedOnRight); + nextButton->addListener (this); + nextButton->setColour (TextButton::buttonColourId, Colour (0xff007f00)); + nextButton->setColour (TextButton::buttonOnColourId, Colours::lime); + + nextButton->setBounds (800, 472, 24, 24); + //[UserPreSize] LookAndFeel::setDefaultLookAndFeel(new OPLLookAndFeel()); @@ -2348,6 +2368,8 @@ PluginGui::~PluginGui() hiHatButton = nullptr; dbLabel7 = nullptr; dbLabel8 = nullptr; + previousButton = nullptr; + nextButton = nullptr; //[Destructor]. You can add your own custom destruction code here.. @@ -2914,6 +2936,16 @@ void PluginGui::buttonClicked (Button* buttonThatWasClicked) processor->setEnumParameter("Percussion Mode", 5); //[/UserButtonCode_hiHatButton] } + else if (buttonThatWasClicked == previousButton.get()) + { + //[UserButtonCode_previousButton] -- add your button handler code here.. + //[/UserButtonCode_previousButton] + } + else if (buttonThatWasClicked == nextButton.get()) + { + //[UserButtonCode_nextButton] -- add your button handler code here.. + //[/UserButtonCode_nextButton] + } //[UserbuttonClicked_Post] //[/UserbuttonClicked_Post] @@ -3415,12 +3447,12 @@ BEGIN_JUCER_METADATA connectedEdges="0" needsCallback="1" radioGroupId="0" state="0"/> + bgColOn="ff00ff00" buttonText="Export" connectedEdges="3" needsCallback="1" + radioGroupId="0"/> + virtualName="" explicitFocusOrder="0" pos="728 472 48 24" bgColOff="ff007f00" + bgColOn="ff00ff00" buttonText="Load" connectedEdges="3" needsCallback="1" + radioGroupId="0"/>