From 8c8e2dda78e685a7dc103b4379ef771e5bbe47d7 Mon Sep 17 00:00:00 2001 From: bruce Date: Thu, 26 Sep 2013 00:28:34 +0800 Subject: [PATCH] Halfway through adding a nice GUI. --- JuceOPLVSTi.jucer | 14 + Source/PluginGui.cpp | 575 +++++++++++++++++++++++++++++++++++++ Source/PluginGui.h | 104 +++++++ Source/PluginProcessor.cpp | 6 +- img/abs_sine.png | Bin 0 -> 134 bytes img/full_sine.png | Bin 0 -> 154 bytes img/half_sine.png | Bin 0 -> 126 bytes img/quarter_sine.png | Bin 0 -> 130 bytes 8 files changed, 696 insertions(+), 3 deletions(-) create mode 100644 Source/PluginGui.cpp create mode 100644 Source/PluginGui.h create mode 100644 img/abs_sine.png create mode 100644 img/full_sine.png create mode 100644 img/half_sine.png create mode 100644 img/quarter_sine.png diff --git a/JuceOPLVSTi.jucer b/JuceOPLVSTi.jucer index 105248d..c63e04d 100644 --- a/JuceOPLVSTi.jucer +++ b/JuceOPLVSTi.jucer @@ -10,6 +10,20 @@ pluginAAXCategory="AAX_ePlugInCategory_Dynamics" jucerVersion="3.1.0"> + + + + + + + + diff --git a/Source/PluginGui.cpp b/Source/PluginGui.cpp new file mode 100644 index 0000000..3035d3f --- /dev/null +++ b/Source/PluginGui.cpp @@ -0,0 +1,575 @@ +/* + ============================================================================== + + This is an automatically generated GUI class created by the Introjucer! + + 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 Introjucer version: 3.1.0 + + ------------------------------------------------------------------------------ + + The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions" + Copyright 2004-13 by Raw Material Software Ltd. + + ============================================================================== +*/ + +//[Headers] You can add your own extra header files here... +//[/Headers] + +#include "PluginGui.h" + + +//[MiscUserDefs] You can add your own user definitions and misc code here... +//[/MiscUserDefs] + +//============================================================================== +PluginGui::PluginGui (JuceOplvstiAudioProcessor* ownerFilter) + : AudioProcessorEditor (ownerFilter) +{ + addAndMakeVisible (groupComponent = new GroupComponent ("new group", + "Modulator")); + groupComponent->setTextLabelPosition (Justification::centredLeft); + groupComponent->setColour (GroupComponent::outlineColourId, Colour (0xff007f00)); + groupComponent->setColour (GroupComponent::textColourId, Colour (0xff007f00)); + + addAndMakeVisible (frequencyComboBox = new ComboBox ("frequency combo box")); + frequencyComboBox->setEditableText (false); + frequencyComboBox->setJustificationType (Justification::centredLeft); + frequencyComboBox->setTextWhenNothingSelected (String::empty); + frequencyComboBox->setTextWhenNoChoicesAvailable ("(no choices)"); + frequencyComboBox->addListener (this); + + addAndMakeVisible (frequencyLabel = new Label ("frequency label", + "Frequency")); + frequencyLabel->setFont (Font (15.00f, Font::plain)); + frequencyLabel->setJustificationType (Justification::centred); + frequencyLabel->setEditable (false, false, false); + frequencyLabel->setColour (Label::textColourId, Colour (0xff007f00)); + frequencyLabel->setColour (TextEditor::textColourId, Colours::black); + frequencyLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (aSlider = new Slider ("a slider")); + aSlider->setRange (0, 15, 1); + aSlider->setSliderStyle (Slider::LinearVertical); + aSlider->setTextBoxStyle (Slider::TextBoxBelow, false, 40, 20); + aSlider->setColour (Slider::thumbColourId, Colour (0xff00af00)); + aSlider->setColour (Slider::trackColourId, Colour (0x7f007f00)); + aSlider->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); + aSlider->setColour (Slider::textBoxBackgroundColourId, Colours::black); + aSlider->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); + aSlider->addListener (this); + + addAndMakeVisible (aLabel = new Label ("a label", + "A")); + aLabel->setFont (Font (15.00f, Font::plain)); + aLabel->setJustificationType (Justification::centred); + aLabel->setEditable (false, false, false); + aLabel->setColour (Label::textColourId, Colour (0xff007f00)); + aLabel->setColour (TextEditor::textColourId, Colours::black); + aLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (dSlider = new Slider ("d slider")); + dSlider->setRange (0, 15, 1); + dSlider->setSliderStyle (Slider::LinearVertical); + dSlider->setTextBoxStyle (Slider::TextBoxBelow, false, 40, 20); + dSlider->setColour (Slider::thumbColourId, Colour (0xff00af00)); + dSlider->setColour (Slider::trackColourId, Colour (0x7f007f00)); + dSlider->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); + dSlider->setColour (Slider::textBoxBackgroundColourId, Colours::black); + dSlider->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); + dSlider->addListener (this); + + addAndMakeVisible (dLabel = new Label ("d label", + "D")); + dLabel->setFont (Font (15.00f, Font::plain)); + dLabel->setJustificationType (Justification::centred); + dLabel->setEditable (false, false, false); + dLabel->setColour (Label::textColourId, Colour (0xff007f00)); + dLabel->setColour (TextEditor::textColourId, Colours::black); + dLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (sSlider = new Slider ("s slider")); + sSlider->setRange (0, 15, 1); + sSlider->setSliderStyle (Slider::LinearVertical); + sSlider->setTextBoxStyle (Slider::TextBoxBelow, false, 40, 20); + sSlider->setColour (Slider::thumbColourId, Colour (0xff00af00)); + sSlider->setColour (Slider::trackColourId, Colour (0x7f007f00)); + sSlider->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); + sSlider->setColour (Slider::textBoxBackgroundColourId, Colours::black); + sSlider->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); + sSlider->addListener (this); + + addAndMakeVisible (dLabel2 = new Label ("d label", + "S")); + dLabel2->setFont (Font (15.00f, Font::plain)); + dLabel2->setJustificationType (Justification::centred); + dLabel2->setEditable (false, false, false); + dLabel2->setColour (Label::textColourId, Colour (0xff007f00)); + dLabel2->setColour (TextEditor::textColourId, Colours::black); + dLabel2->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (rSlider = new Slider ("r slider")); + rSlider->setRange (0, 15, 1); + rSlider->setSliderStyle (Slider::LinearVertical); + rSlider->setTextBoxStyle (Slider::TextBoxBelow, false, 40, 20); + rSlider->setColour (Slider::thumbColourId, Colour (0xff00af00)); + rSlider->setColour (Slider::trackColourId, Colour (0x7f007f00)); + rSlider->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); + rSlider->setColour (Slider::textBoxBackgroundColourId, Colours::black); + rSlider->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); + rSlider->addListener (this); + + addAndMakeVisible (rLabel = new Label ("r label", + "R")); + rLabel->setFont (Font (15.00f, Font::plain)); + rLabel->setJustificationType (Justification::centred); + rLabel->setEditable (false, false, false); + rLabel->setColour (Label::textColourId, Colour (0xff007f00)); + rLabel->setColour (TextEditor::textColourId, Colours::black); + rLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (attenuationSlider = new Slider ("attenuation slider")); + attenuationSlider->setRange (-47.25, 0, 0.75); + attenuationSlider->setSliderStyle (Slider::LinearVertical); + attenuationSlider->setTextBoxStyle (Slider::TextBoxBelow, false, 64, 20); + attenuationSlider->setColour (Slider::thumbColourId, Colour (0xff00af00)); + attenuationSlider->setColour (Slider::trackColourId, Colour (0x7f007f00)); + attenuationSlider->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); + attenuationSlider->setColour (Slider::textBoxBackgroundColourId, Colours::black); + attenuationSlider->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); + attenuationSlider->addListener (this); + + addAndMakeVisible (attenuationLabel = new Label ("attenuation label", + "Attenuation")); + attenuationLabel->setFont (Font (15.00f, Font::plain)); + attenuationLabel->setJustificationType (Justification::centred); + attenuationLabel->setEditable (false, false, false); + attenuationLabel->setColour (Label::textColourId, Colour (0xff007f00)); + attenuationLabel->setColour (TextEditor::textColourId, Colours::black); + attenuationLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (dbLabel = new Label ("db label", + "dB")); + dbLabel->setFont (Font (15.00f, Font::plain)); + dbLabel->setJustificationType (Justification::centred); + dbLabel->setEditable (false, false, false); + dbLabel->setColour (Label::textColourId, Colour (0xff007f00)); + dbLabel->setColour (Label::outlineColourId, Colour (0x00000000)); + dbLabel->setColour (TextEditor::textColourId, Colours::black); + dbLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (sineImageButton = new ImageButton ("sine image button")); + sineImageButton->setTooltip ("sine"); + sineImageButton->setButtonText ("Sine"); + sineImageButton->setRadioGroupId (1); + sineImageButton->addListener (this); + + sineImageButton->setImages (false, true, true, + ImageCache::getFromMemory (full_sine_png, full_sine_pngSize), 0.500f, Colour (0x00000000), + Image(), 0.500f, Colour (0x00000000), + Image(), 1.000f, Colour (0x00000000)); + addAndMakeVisible (halfsineImageButton = new ImageButton ("half sine image button")); + halfsineImageButton->setTooltip ("half sine"); + halfsineImageButton->setButtonText ("Half Sine"); + halfsineImageButton->setRadioGroupId (1); + halfsineImageButton->addListener (this); + + halfsineImageButton->setImages (false, true, true, + ImageCache::getFromMemory (half_sine_png, half_sine_pngSize), 0.500f, Colour (0x00000000), + Image(), 0.500f, Colour (0x00000000), + Image(), 1.000f, Colour (0x00000000)); + addAndMakeVisible (abssineImageButton = new ImageButton ("abs sine image button")); + abssineImageButton->setTooltip ("abs sine"); + abssineImageButton->setButtonText ("Abs Sine"); + abssineImageButton->setRadioGroupId (1); + abssineImageButton->addListener (this); + + abssineImageButton->setImages (false, true, true, + ImageCache::getFromMemory (abs_sine_png, abs_sine_pngSize), 0.500f, Colour (0x00000000), + Image(), 0.500f, Colour (0x00000000), + Image(), 1.000f, Colour (0x00000000)); + addAndMakeVisible (quartersineImageButton = new ImageButton ("quarter sine image button")); + quartersineImageButton->setTooltip ("quarter sine"); + quartersineImageButton->setButtonText ("Quarter Sine"); + quartersineImageButton->setRadioGroupId (1); + quartersineImageButton->addListener (this); + + quartersineImageButton->setImages (false, true, true, + ImageCache::getFromMemory (quarter_sine_png, quarter_sine_pngSize), 0.500f, Colour (0x00000000), + Image(), 0.500f, Colour (0x00000000), + Image(), 1.000f, Colour (0x00000000)); + addAndMakeVisible (waveLabel = new Label ("wave label", + "Wave")); + waveLabel->setFont (Font (15.00f, Font::plain)); + waveLabel->setJustificationType (Justification::centred); + waveLabel->setEditable (false, false, false); + waveLabel->setColour (Label::textColourId, Colour (0xff007f00)); + waveLabel->setColour (TextEditor::textColourId, Colours::black); + waveLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + + //[UserPreSize] + frequencyComboBox->setColour (ComboBox::textColourId, Colour (COLOUR_MID)); + frequencyComboBox->setColour (ComboBox::outlineColourId, Colour (COLOUR_MID)); + frequencyComboBox->setColour (ComboBox::arrowColourId, Colour (COLOUR_MID)); + frequencyComboBox->setColour (ComboBox::buttonColourId, Colours::black); + frequencyComboBox->setColour (ComboBox::backgroundColourId, Colours::black); + + frequencyComboBox->addItem ("x1/2", 0); + frequencyComboBox->addItem ("x1", 1); + frequencyComboBox->addItem ("x2", 2); + frequencyComboBox->addItem ("x3", 3); + frequencyComboBox->addItem ("x4", 4); + frequencyComboBox->addItem ("x5", 5); + frequencyComboBox->addItem ("x6", 6); + frequencyComboBox->addItem ("x7", 7); + frequencyComboBox->addItem ("x8", 8); + frequencyComboBox->addItem ("x9", 9); + frequencyComboBox->addItem ("x10", 10); + frequencyComboBox->addItem ("x12", 12); + frequencyComboBox->addItem ("x15", 15); + + sineImageButton->setClickingTogglesState(true); + sineImageButton->setRepaintsOnMouseActivity(false); + abssineImageButton->setClickingTogglesState(true); + abssineImageButton->setRepaintsOnMouseActivity(false); + halfsineImageButton->setClickingTogglesState(true); + halfsineImageButton->setRepaintsOnMouseActivity(false); + quartersineImageButton->setClickingTogglesState(true); + quartersineImageButton->setRepaintsOnMouseActivity(false); + //[/UserPreSize] + + setSize (600, 400); + + + //[Constructor] You can add your own custom stuff here.. + processor = ownerFilter; + //[/Constructor] +} + +PluginGui::~PluginGui() +{ + //[Destructor_pre]. You can add your own custom destruction code here.. + //[/Destructor_pre] + + groupComponent = nullptr; + frequencyComboBox = nullptr; + frequencyLabel = nullptr; + aSlider = nullptr; + aLabel = nullptr; + dSlider = nullptr; + dLabel = nullptr; + sSlider = nullptr; + dLabel2 = nullptr; + rSlider = nullptr; + rLabel = nullptr; + attenuationSlider = nullptr; + attenuationLabel = nullptr; + dbLabel = nullptr; + sineImageButton = nullptr; + halfsineImageButton = nullptr; + abssineImageButton = nullptr; + quartersineImageButton = nullptr; + waveLabel = nullptr; + + + //[Destructor]. You can add your own custom destruction code here.. + //[/Destructor] +} + +//============================================================================== +void PluginGui::paint (Graphics& g) +{ + //[UserPrePaint] Add your own custom painting code here.. + //[/UserPrePaint] + + g.fillAll (Colours::black); + + //[UserPaint] Add your own custom painting code here.. + //[/UserPaint] +} + +void PluginGui::resized() +{ + groupComponent->setBounds (16, 16, 392, 240); + frequencyComboBox->setBounds (120, 96, 72, 24); + frequencyLabel->setBounds (16, 96, 96, 24); + aSlider->setBounds (40, 136, 48, 72); + aLabel->setBounds (40, 208, 48, 24); + dSlider->setBounds (104, 136, 48, 72); + dLabel->setBounds (104, 208, 48, 24); + sSlider->setBounds (168, 136, 48, 72); + dLabel2->setBounds (168, 208, 48, 24); + rSlider->setBounds (232, 136, 48, 72); + rLabel->setBounds (232, 208, 48, 24); + attenuationSlider->setBounds (296, 96, 72, 112); + attenuationLabel->setBounds (296, 208, 96, 24); + dbLabel->setBounds (360, 184, 40, 24); + sineImageButton->setBounds (120, 48, 34, 30); + halfsineImageButton->setBounds (176, 48, 34, 30); + abssineImageButton->setBounds (232, 48, 34, 30); + quartersineImageButton->setBounds (288, 48, 34, 30); + waveLabel->setBounds (16, 48, 96, 24); + //[UserResized] Add your own custom resize handling here.. + //[/UserResized] +} + +void PluginGui::comboBoxChanged (ComboBox* comboBoxThatHasChanged) +{ + //[UsercomboBoxChanged_Pre] + //[/UsercomboBoxChanged_Pre] + + if (comboBoxThatHasChanged == frequencyComboBox) + { + //[UserComboBoxCode_frequencyComboBox] -- add your combo box handling code here.. + processor->setEnumParameter("Modulator Frequency", frequencyComboBox->getSelectedId()); + //[/UserComboBoxCode_frequencyComboBox] + } + + //[UsercomboBoxChanged_Post] + //[/UsercomboBoxChanged_Post] +} + +void PluginGui::sliderValueChanged (Slider* sliderThatWasMoved) +{ + //[UsersliderValueChanged_Pre] + //[/UsersliderValueChanged_Pre] + + if (sliderThatWasMoved == aSlider) + { + //[UserSliderCode_aSlider] -- add your slider handling code here.. + processor->setIntParameter("Modulator Attack", (int)aSlider->getValue()); + //[/UserSliderCode_aSlider] + } + else if (sliderThatWasMoved == dSlider) + { + //[UserSliderCode_dSlider] -- add your slider handling code here.. + processor->setIntParameter("Modulator Decay", (int)dSlider->getValue()); + //[/UserSliderCode_dSlider] + } + else if (sliderThatWasMoved == sSlider) + { + //[UserSliderCode_sSlider] -- add your slider handling code here.. + processor->setIntParameter("Modulator Sustain", (int)sSlider->getValue()); + //[/UserSliderCode_sSlider] + } + else if (sliderThatWasMoved == rSlider) + { + //[UserSliderCode_rSlider] -- add your slider handling code here.. + processor->setIntParameter("Modulator Release", (int)rSlider->getValue()); + //[/UserSliderCode_rSlider] + } + else if (sliderThatWasMoved == attenuationSlider) + { + //[UserSliderCode_attenuationSlider] -- add your slider handling code here.. + processor->setEnumParameter("Modulator Attenuation", -(int)(attenuationSlider->getValue()/0.75)); + //[/UserSliderCode_attenuationSlider] + } + + //[UsersliderValueChanged_Post] + //[/UsersliderValueChanged_Post] +} + +void PluginGui::buttonClicked (Button* buttonThatWasClicked) +{ + //[UserbuttonClicked_Pre] + //[/UserbuttonClicked_Pre] + + if (buttonThatWasClicked == sineImageButton) + { + //[UserButtonCode_sineImageButton] -- add your button handler code here.. + processor->setEnumParameter("Modulator Wave", 0); + //[/UserButtonCode_sineImageButton] + } + else if (buttonThatWasClicked == halfsineImageButton) + { + //[UserButtonCode_halfsineImageButton] -- add your button handler code here.. + processor->setEnumParameter("Modulator Wave", 1); + //[/UserButtonCode_halfsineImageButton] + } + else if (buttonThatWasClicked == abssineImageButton) + { + //[UserButtonCode_abssineImageButton] -- add your button handler code here.. + processor->setEnumParameter("Modulator Wave", 2); + //[/UserButtonCode_abssineImageButton] + } + else if (buttonThatWasClicked == quartersineImageButton) + { + //[UserButtonCode_quartersineImageButton] -- add your button handler code here.. + processor->setEnumParameter("Modulator Wave", 3); + //[/UserButtonCode_quartersineImageButton] + } + + //[UserbuttonClicked_Post] + //[/UserbuttonClicked_Post] +} + + + +//[MiscUserCode] You can add your own definitions of your custom methods or any other code here... +//[/MiscUserCode] + + +//============================================================================== +#if 0 +/* -- Introjucer information section -- + + This is where the Introjucer stores the metadata that describe this GUI layout, so + make changes in here at your peril! + +BEGIN_JUCER_METADATA + + + + + + + +END_JUCER_METADATA +*/ +#endif + +//============================================================================== +// Binary resources - be careful not to edit any of these sections! + +// JUCER_RESOURCE: full_sine_png, 154, "../img/full_sine.png" +static const unsigned char resource_PluginGui_full_sine_png[] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,17,0,0,0,15,8,6,0,0,0,2,177,36,17,0,0,0,97,73,68,65,84,56,141,99,100,96,96,248,207, +64,33,96,194,16,89,5,197,36,130,255,112,188,10,7,155,48,198,163,137,72,131,48,189,67,38,192,111,35,17,174,161,138,75,88,224,44,123,60,170,112,201,101,51,48,48,132,65,152,248,157,75,132,87,169,24,176,228, +184,102,21,149,3,150,56,151,16,72,205,140,12,164,100,64,88,158,10,67,21,38,205,16,28,0,0,120,172,116,52,166,46,206,86,0,0,0,0,73,69,78,68,174,66,96,130,0,0}; + +const char* PluginGui::full_sine_png = (const char*) resource_PluginGui_full_sine_png; +const int PluginGui::full_sine_pngSize = 154; + +// JUCER_RESOURCE: half_sine_png, 126, "../img/half_sine.png" +static const unsigned char resource_PluginGui_half_sine_png[] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,17,0,0,0,15,8,6,0,0,0,2,177,36,17,0,0,0,69,73,68,65,84,56,141,99,100,96,96,248,207, +64,33,96,194,16,89,5,197,36,130,255,112,188,10,7,155,48,198,163,137,72,131,48,189,67,38,192,111,35,17,174,161,138,75,88,224,44,123,60,170,240,201,29,100,96,96,100,160,73,58,25,53,100,240,24,2,0,70,254, +59,115,155,0,139,238,0,0,0,0,73,69,78,68,174,66,96,130,0,0}; + +const char* PluginGui::half_sine_png = (const char*) resource_PluginGui_half_sine_png; +const int PluginGui::half_sine_pngSize = 126; + +// JUCER_RESOURCE: abs_sine_png, 134, "../img/abs_sine.png" +static const unsigned char resource_PluginGui_abs_sine_png[] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,17,0,0,0,15,8,6,0,0,0,2,177,36,17,0,0,0,77,73,68,65,84,56,141,99,100,96,96,248,207, +64,33,96,194,16,89,5,197,216,0,30,185,255,112,188,10,7,155,144,28,30,9,132,24,62,57,6,134,255,152,222,33,19,96,183,9,159,11,209,228,168,226,18,22,56,203,30,143,42,124,114,12,12,12,140,12,52,73,39,163, +134,12,30,67,0,177,31,63,88,3,168,147,82,0,0,0,0,73,69,78,68,174,66,96,130,0,0}; + +const char* PluginGui::abs_sine_png = (const char*) resource_PluginGui_abs_sine_png; +const int PluginGui::abs_sine_pngSize = 134; + +// JUCER_RESOURCE: quarter_sine_png, 130, "../img/quarter_sine.png" +static const unsigned char resource_PluginGui_quarter_sine_png[] = { 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,17,0,0,0,15,8,6,0,0,0,2,177,36,17,0,0,0,73,73,68,65,84,56,141,99,100,96,96,248, +207,64,33,96,194,16,89,133,71,53,14,57,38,98,20,17,146,99,66,81,20,134,199,0,92,114,24,46,33,19,48,81,234,10,170,185,132,5,206,178,71,18,181,71,83,133,79,238,32,3,3,35,3,77,210,201,168,33,131,199,16,0, +110,115,10,130,242,45,164,156,0,0,0,0,73,69,78,68,174,66,96,130,0,0}; + +const char* PluginGui::quarter_sine_png = (const char*) resource_PluginGui_quarter_sine_png; +const int PluginGui::quarter_sine_pngSize = 130; + + +//[EndFile] You can add extra defines here... +//[/EndFile] diff --git a/Source/PluginGui.h b/Source/PluginGui.h new file mode 100644 index 0000000..5446166 --- /dev/null +++ b/Source/PluginGui.h @@ -0,0 +1,104 @@ +/* + ============================================================================== + + This is an automatically generated GUI class created by the Introjucer! + + 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 Introjucer version: 3.1.0 + + ------------------------------------------------------------------------------ + + The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions" + Copyright 2004-13 by Raw Material Software Ltd. + + ============================================================================== +*/ + +#ifndef __JUCE_HEADER_450C07F5C14097B8__ +#define __JUCE_HEADER_450C07F5C14097B8__ + +//[Headers] -- You can add your own extra header files here -- +#include "JuceHeader.h" +#include "PluginProcessor.h" +//[/Headers] + + + +//============================================================================== +/** + //[Comments] + An auto-generated component, created by the Introjucer. + + Describe your class and how it works here! + //[/Comments] +*/ +class PluginGui : public AudioProcessorEditor, + public ComboBoxListener, + public SliderListener, + public ButtonListener +{ +public: + //============================================================================== + PluginGui (JuceOplvstiAudioProcessor* ownerFilter); + ~PluginGui(); + + //============================================================================== + //[UserMethods] -- You can add your own custom methods in this section. + //[/UserMethods] + + void paint (Graphics& g); + void resized(); + void comboBoxChanged (ComboBox* comboBoxThatHasChanged); + void sliderValueChanged (Slider* sliderThatWasMoved); + void buttonClicked (Button* buttonThatWasClicked); + + // 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; + + +private: + //[UserVariables] -- You can add your own custom variables in this section. + static const uint32 COLOUR_MID = 0xff007f00; + JuceOplvstiAudioProcessor* processor; + //[/UserVariables] + + //============================================================================== + ScopedPointer groupComponent; + ScopedPointer frequencyComboBox; + ScopedPointer