/* ============================================================================== This is an automatically generated GUI class created by the Projucer! Be careful when adding custom code to these files, as only the code within the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded and re-saved. Created with Projucer version: 6.0.5 ------------------------------------------------------------------------------ The Projucer is part of the JUCE library. Copyright (c) 2020 - Raw Material Software Limited. ============================================================================== */ #pragma once //[Headers] -- You can add your own extra header files here -- #include #include "JuceHeader.h" #include "PluginProcessor.h" #include "OPLLookAndFeel.h" #include "ChannelButtonLookAndFeel.h" //[/Headers] //============================================================================== /** //[Comments] This is a GUI for the OPL2 VST plugin, created in Juce. //[/Comments] */ class PluginGui : public Component, public FileDragAndDropTarget, public DragAndDropContainer, public Timer, public juce::ComboBox::Listener, public juce::Slider::Listener, public juce::Button::Listener { public: //============================================================================== PluginGui (AdlibBlasterAudioProcessor* ownerFilter); ~PluginGui() override; //============================================================================== //[UserMethods] -- You can add your own custom methods in this section. void updateFromParameters(); bool isInterestedInFileDrag (const StringArray& files) override; void fileDragEnter (const StringArray& files, int x, int y) override; void fileDragMove (const StringArray& files, int x, int y) override; void fileDragExit (const StringArray& files) override; void filesDropped (const StringArray& files, int x, int y) override; void timerCallback() override; void setRecordButtonState(bool recording); bool showLoadMenu(); bool loadBrowserFile(); void loadPreNextFile(bool pre = true); void syncGUI(); void sliderDragStarted (Slider* sliderThatWasMoved) override; void sliderDragEnded (Slider* sliderThatWasMoved) override; //[/UserMethods] void paint (juce::Graphics& g) override; void resized() override; void comboBoxChanged (juce::ComboBox* comboBoxThatHasChanged) override; void sliderValueChanged (juce::Slider* sliderThatWasMoved) override; void buttonClicked (juce::Button* buttonThatWasClicked) override; // Binary resources: static const char* full_sine_png; static const int full_sine_pngSize; static const char* half_sine_png; static const int half_sine_pngSize; static const char* abs_sine_png; static const int abs_sine_pngSize; static const char* quarter_sine_png; static const int quarter_sine_pngSize; static const char* camel_sine_png; static const int camel_sine_pngSize; static const char* alternating_sine_png; static const int alternating_sine_pngSize; static const char* square_png; static const int square_pngSize; static const char* logarithmic_saw_png; static const int logarithmic_saw_pngSize; static const char* channeloff_png; static const int channeloff_pngSize; static const char* channelon_png; static const int channelon_pngSize; static const char* toggle_off_sq_png; static const int toggle_off_sq_pngSize; static const char* toggle_on_sq_png; static const int toggle_on_sq_pngSize; static const char* line_border_horiz_png; static const int line_border_horiz_pngSize; static const char* line_border_vert_png; static const int line_border_vert_pngSize; static const char* algo_switch_off_png; static const int algo_switch_off_pngSize; static const char* algo_switch_on_png; static const int algo_switch_on_pngSize; static const char* algo_switch_on2_png; static const int algo_switch_on2_pngSize; static const char* algo_switch_on3_png; static const int algo_switch_on3_pngSize; static const char* twoopAm_png; static const int twoopAm_pngSize; static const char* twoopFm_png; static const int twoopFm_pngSize; static const char* bassdrum_png; static const int bassdrum_pngSize; static const char* snare_png; static const int snare_pngSize; static const char* disabled_png; static const int disabled_pngSize; static const char* tom_png; static const int tom_pngSize; static const char* hihat_png; static const int hihat_pngSize; static const char* cymbal_png; static const int cymbal_pngSize; static const char* adlib_png; static const int adlib_pngSize; static const char* gui_svg; static const int gui_svgSize; private: //[UserVariables] -- You can add your own custom variables in this section. bool updateFromHost = true; void loadandUpdateInstrument(String path); class OPLComboBoxLookAndFeelMethods: public OPLLookAndFeel { virtual PopupMenu::Options getOptionsForComboBoxPopupMenu (ComboBox& comBox, Label& label) override{ PopupMenu::Options options = OPLLookAndFeel::getOptionsForComboBoxPopupMenu(comBox, label); #if JUCE_IOS if (PluginHostType::getPluginLoadedAs() == AudioProcessor::wrapperType_AudioUnitv3) { if (options.getTargetComponent() != nullptr) return options.withParentComponent(options.getTargetComponent()->getTopLevelComponent()); } #endif return options; }; }; std::unique_ptr oplComboBoxLookAndFeel; static const uint32 COLOUR_MID = 0xff007f00; static const uint32 COLOUR_RECORDING = 0xffff0000; AdlibBlasterAudioProcessor* processor; std::array, Hiopl::CHANNELS> channels; TooltipWindow tooltipWindow; PopupMenu menuLoad; Array allSbiFiles; #if!JUCE_IOS File instrumentLoadDirectory = File::getSpecialLocation(File::userDocumentsDirectory).getChildFile("discoDSP").getChildFile("OPL"); // File(); File instrumentSaveDirectory = File::getSpecialLocation(File::userDocumentsDirectory).getChildFile("discoDSP").getChildFile("OPL"); // File(); #endif #if JUCE_IOS File instrumentLoadDirectory = File::getSpecialLocation (File::invokedExecutableFile).getParentDirectory().getChildFile("sbi"); // File(); File instrumentSaveDirectory = File::getSpecialLocation(File::userDocumentsDirectory); // File(); #endif std::unique_ptr oplLookAndFeel; std::unique_ptr channelButtonLookAndFeel; //[/UserVariables] //============================================================================== std::unique_ptr groupComponent2; std::unique_ptr groupComponent4; std::unique_ptr groupComponent11; std::unique_ptr groupComponent10; std::unique_ptr groupComponent9; std::unique_ptr groupComponent; std::unique_ptr frequencyComboBox; std::unique_ptr frequencyLabel; std::unique_ptr aSlider; std::unique_ptr aLabel; std::unique_ptr dSlider; std::unique_ptr dLabel; std::unique_ptr sSlider; std::unique_ptr dLabel2; std::unique_ptr rSlider; std::unique_ptr rLabel; std::unique_ptr attenuationSlider; std::unique_ptr attenuationLabel; std::unique_ptr dbLabel; std::unique_ptr sineImageButton; std::unique_ptr halfsineImageButton; std::unique_ptr abssineImageButton; std::unique_ptr quartersineImageButton; std::unique_ptr waveLabel; std::unique_ptr tremoloButton; std::unique_ptr vibratoButton; std::unique_ptr sustainButton; std::unique_ptr keyscaleEnvButton; std::unique_ptr dbLabel2; std::unique_ptr frequencyComboBox2; std::unique_ptr frequencyLabel3; std::unique_ptr aSlider2; std::unique_ptr aLabel2; std::unique_ptr dSlider2; std::unique_ptr dLabel3; std::unique_ptr sSlider2; std::unique_ptr dLabel4; std::unique_ptr rSlider2; std::unique_ptr rLabel2; std::unique_ptr attenuationSlider2; std::unique_ptr attenuationLabel2; std::unique_ptr dbLabel3; std::unique_ptr sineImageButton2; std::unique_ptr halfsineImageButton2; std::unique_ptr abssineImageButton2; std::unique_ptr quartersineImageButton2; std::unique_ptr waveLabel2; std::unique_ptr tremoloButton2; std::unique_ptr vibratoButton2; std::unique_ptr sustainButton2; std::unique_ptr keyscaleEnvButton2; std::unique_ptr frequencyLabel4; std::unique_ptr groupComponent3; std::unique_ptr tremoloSlider; std::unique_ptr frequencyLabel5; std::unique_ptr dbLabel5; std::unique_ptr vibratoSlider; std::unique_ptr frequencyLabel6; std::unique_ptr dbLabel6; std::unique_ptr feedbackSlider; std::unique_ptr frequencyLabel7; std::unique_ptr velocityComboBox; std::unique_ptr velocityComboBox2; std::unique_ptr attenuationLabel4; std::unique_ptr alternatingsineImageButton; std::unique_ptr camelsineImageButton; std::unique_ptr squareImageButton; std::unique_ptr logsawImageButton; std::unique_ptr alternatingsineImageButton2; std::unique_ptr camelsineImageButton2; std::unique_ptr squareImageButton2; std::unique_ptr logsawImageButton2; std::unique_ptr dbLabel4; std::unique_ptr keyscaleAttenuationComboBox2; std::unique_ptr keyscaleAttenuationComboBox; std::unique_ptr groupComponent5; std::unique_ptr emulatorSlider; std::unique_ptr emulatorLabel; std::unique_ptr emulatorLabel2; std::unique_ptr recordButton; std::unique_ptr exportButton; std::unique_ptr loadButton; std::unique_ptr versionLabel; std::unique_ptr ToggleButtonOffExample; std::unique_ptr ToggleButtonOnExample; std::unique_ptr label; std::unique_ptr label2; std::unique_ptr LineBorderButton1C; std::unique_ptr LineBorderButton1A; std::unique_ptr LineBorderButton1B; std::unique_ptr label3; std::unique_ptr LineBorderButton1C2; std::unique_ptr LineBorderButton1A2; std::unique_ptr LineBorderButton1B2; std::unique_ptr LineBorderButton1C3; std::unique_ptr LineBorderButton1B3; std::unique_ptr algoSwitchButtonOffEx1; std::unique_ptr algoSwitchButtonOffEx2; std::unique_ptr algoSwitchButtonOnEx1; std::unique_ptr algoSwitchButtonOnEx2; std::unique_ptr label4; std::unique_ptr label5; std::unique_ptr label6; std::unique_ptr label7; std::unique_ptr label8; std::unique_ptr algoSwitchButtonOn2Ex1; std::unique_ptr algoSwitchButtonOn2Ex2; std::unique_ptr label9; std::unique_ptr label10; std::unique_ptr algoSwitchButtonOn3Ex1; std::unique_ptr algoSwitchButtonOn3Ex2; std::unique_ptr label11; std::unique_ptr label12; std::unique_ptr TwoOpAMButton; std::unique_ptr TwoOpFMButton; std::unique_ptr label13; std::unique_ptr label14; std::unique_ptr label15; std::unique_ptr label16; std::unique_ptr label17; std::unique_ptr groupComponent6; std::unique_ptr algoSwitchButtonOnEx3; std::unique_ptr label18; std::unique_ptr algoSwitchButtonOffEx3; std::unique_ptr label19; std::unique_ptr TwoOpAMButton2; std::unique_ptr label20; std::unique_ptr label21; std::unique_ptr label22; std::unique_ptr algoSwitchButtonOffEx4; std::unique_ptr label23; std::unique_ptr algoSwitchButtonOn3Ex3; std::unique_ptr label24; std::unique_ptr TwoOpFMButton2; std::unique_ptr label25; std::unique_ptr label26; std::unique_ptr groupComponent7; std::unique_ptr algoSwitchButtonOffEx5; std::unique_ptr label27; std::unique_ptr algoSwitchButtonOn3Ex4; std::unique_ptr label28; std::unique_ptr groupComponent8; std::unique_ptr frequencyLabel9; std::unique_ptr label29; std::unique_ptr label30; std::unique_ptr frequencyLabel10; std::unique_ptr attenuationLabel5; std::unique_ptr fmButton; std::unique_ptr additiveButton; std::unique_ptr bassDrumButton; std::unique_ptr snareDrumButton; std::unique_ptr disablePercussionButton; std::unique_ptr tomTomButton; std::unique_ptr cymbalButton; std::unique_ptr hiHatButton; std::unique_ptr dbLabel7; std::unique_ptr dbLabel8; std::unique_ptr previousButton; std::unique_ptr nextButton; std::unique_ptr drawable1; //============================================================================== JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PluginGui) }; //[EndFile] You can add extra defines here... //[/EndFile]