From a687e75714837b53ecb1546ae0e93c2b5455c473 Mon Sep 17 00:00:00 2001 From: bruce Date: Sun, 29 Sep 2013 01:43:59 +0800 Subject: [PATCH] Added Carrier into UI, fixed bugs. --- Source/PluginGui.cpp | 765 ++++++++++++++++++++++++++++++++++++++++--- Source/PluginGui.h | 33 ++ 2 files changed, 751 insertions(+), 47 deletions(-) diff --git a/Source/PluginGui.cpp b/Source/PluginGui.cpp index 3035d3f..ee08ac6 100644 --- a/Source/PluginGui.cpp +++ b/Source/PluginGui.cpp @@ -211,6 +211,287 @@ PluginGui::PluginGui (JuceOplvstiAudioProcessor* ownerFilter) waveLabel->setColour (TextEditor::textColourId, Colours::black); waveLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + addAndMakeVisible (tremoloButton = new ToggleButton ("tremolo button")); + tremoloButton->setButtonText ("Tremolo"); + tremoloButton->addListener (this); + tremoloButton->setColour (ToggleButton::textColourId, Colour (0xff007f00)); + + addAndMakeVisible (vibratoButton = new ToggleButton ("vibrato button")); + vibratoButton->setButtonText ("Vibrato"); + vibratoButton->addListener (this); + vibratoButton->setColour (ToggleButton::textColourId, Colour (0xff007f00)); + + addAndMakeVisible (sustainButton = new ToggleButton ("sustain button")); + sustainButton->setButtonText ("Sustain"); + sustainButton->addListener (this); + sustainButton->setColour (ToggleButton::textColourId, Colour (0xff007f00)); + + addAndMakeVisible (keyscaleEnvButton = new ToggleButton ("keyscale env button")); + keyscaleEnvButton->setButtonText ("Keyscale Envelope Rate"); + keyscaleEnvButton->addListener (this); + keyscaleEnvButton->setColour (ToggleButton::textColourId, Colour (0xff007f00)); + + addAndMakeVisible (keyscaleSlider = new Slider ("keyscale slider")); + keyscaleSlider->setRange (-6, 0, 1.5); + keyscaleSlider->setSliderStyle (Slider::LinearHorizontal); + keyscaleSlider->setTextBoxStyle (Slider::TextBoxLeft, false, 44, 20); + keyscaleSlider->setColour (Slider::thumbColourId, Colour (0xff00af00)); + keyscaleSlider->setColour (Slider::trackColourId, Colour (0x7f007f00)); + keyscaleSlider->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); + keyscaleSlider->setColour (Slider::textBoxBackgroundColourId, Colours::black); + keyscaleSlider->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); + keyscaleSlider->addListener (this); + + addAndMakeVisible (frequencyLabel2 = new Label ("frequency label", + "Keyscale Attenuation")); + frequencyLabel2->setFont (Font (15.00f, Font::plain)); + frequencyLabel2->setJustificationType (Justification::centred); + frequencyLabel2->setEditable (false, false, false); + frequencyLabel2->setColour (Label::textColourId, Colour (0xff007f00)); + frequencyLabel2->setColour (TextEditor::textColourId, Colours::black); + frequencyLabel2->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (dbLabel2 = new Label ("db label", + "dB/\n8ve\n")); + dbLabel2->setFont (Font (15.00f, Font::plain)); + dbLabel2->setJustificationType (Justification::centred); + dbLabel2->setEditable (false, false, false); + dbLabel2->setColour (Label::textColourId, Colour (0xff007f00)); + dbLabel2->setColour (Label::outlineColourId, Colour (0x00000000)); + dbLabel2->setColour (TextEditor::textColourId, Colours::black); + dbLabel2->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (groupComponent2 = new GroupComponent ("new group", + "Carrier")); + groupComponent2->setTextLabelPosition (Justification::centredLeft); + groupComponent2->setColour (GroupComponent::outlineColourId, Colour (0xff007f00)); + groupComponent2->setColour (GroupComponent::textColourId, Colour (0xff007f00)); + + addAndMakeVisible (frequencyComboBox2 = new ComboBox ("frequency combo box")); + frequencyComboBox2->setEditableText (false); + frequencyComboBox2->setJustificationType (Justification::centredLeft); + frequencyComboBox2->setTextWhenNothingSelected (String::empty); + frequencyComboBox2->setTextWhenNoChoicesAvailable ("(no choices)"); + frequencyComboBox2->addListener (this); + + addAndMakeVisible (frequencyLabel3 = new Label ("frequency label", + "Frequency")); + frequencyLabel3->setFont (Font (15.00f, Font::plain)); + frequencyLabel3->setJustificationType (Justification::centred); + frequencyLabel3->setEditable (false, false, false); + frequencyLabel3->setColour (Label::textColourId, Colour (0xff007f00)); + frequencyLabel3->setColour (TextEditor::textColourId, Colours::black); + frequencyLabel3->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (aSlider2 = new Slider ("a slider")); + aSlider2->setRange (0, 15, 1); + aSlider2->setSliderStyle (Slider::LinearVertical); + aSlider2->setTextBoxStyle (Slider::TextBoxBelow, false, 40, 20); + aSlider2->setColour (Slider::thumbColourId, Colour (0xff00af00)); + aSlider2->setColour (Slider::trackColourId, Colour (0x7f007f00)); + aSlider2->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); + aSlider2->setColour (Slider::textBoxBackgroundColourId, Colours::black); + aSlider2->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); + aSlider2->addListener (this); + + addAndMakeVisible (aLabel2 = new Label ("a label", + "A")); + aLabel2->setFont (Font (15.00f, Font::plain)); + aLabel2->setJustificationType (Justification::centred); + aLabel2->setEditable (false, false, false); + aLabel2->setColour (Label::textColourId, Colour (0xff007f00)); + aLabel2->setColour (TextEditor::textColourId, Colours::black); + aLabel2->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (dSlider2 = new Slider ("d slider")); + dSlider2->setRange (0, 15, 1); + dSlider2->setSliderStyle (Slider::LinearVertical); + dSlider2->setTextBoxStyle (Slider::TextBoxBelow, false, 40, 20); + dSlider2->setColour (Slider::thumbColourId, Colour (0xff00af00)); + dSlider2->setColour (Slider::trackColourId, Colour (0x7f007f00)); + dSlider2->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); + dSlider2->setColour (Slider::textBoxBackgroundColourId, Colours::black); + dSlider2->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); + dSlider2->addListener (this); + + addAndMakeVisible (dLabel3 = new Label ("d label", + "D")); + dLabel3->setFont (Font (15.00f, Font::plain)); + dLabel3->setJustificationType (Justification::centred); + dLabel3->setEditable (false, false, false); + dLabel3->setColour (Label::textColourId, Colour (0xff007f00)); + dLabel3->setColour (TextEditor::textColourId, Colours::black); + dLabel3->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (sSlider2 = new Slider ("s slider")); + sSlider2->setRange (0, 15, 1); + sSlider2->setSliderStyle (Slider::LinearVertical); + sSlider2->setTextBoxStyle (Slider::TextBoxBelow, false, 40, 20); + sSlider2->setColour (Slider::thumbColourId, Colour (0xff00af00)); + sSlider2->setColour (Slider::trackColourId, Colour (0x7f007f00)); + sSlider2->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); + sSlider2->setColour (Slider::textBoxBackgroundColourId, Colours::black); + sSlider2->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); + sSlider2->addListener (this); + + addAndMakeVisible (dLabel4 = new Label ("d label", + "S")); + dLabel4->setFont (Font (15.00f, Font::plain)); + dLabel4->setJustificationType (Justification::centred); + dLabel4->setEditable (false, false, false); + dLabel4->setColour (Label::textColourId, Colour (0xff007f00)); + dLabel4->setColour (TextEditor::textColourId, Colours::black); + dLabel4->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (rSlider2 = new Slider ("r slider")); + rSlider2->setRange (0, 15, 1); + rSlider2->setSliderStyle (Slider::LinearVertical); + rSlider2->setTextBoxStyle (Slider::TextBoxBelow, false, 40, 20); + rSlider2->setColour (Slider::thumbColourId, Colour (0xff00af00)); + rSlider2->setColour (Slider::trackColourId, Colour (0x7f007f00)); + rSlider2->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); + rSlider2->setColour (Slider::textBoxBackgroundColourId, Colours::black); + rSlider2->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); + rSlider2->addListener (this); + + addAndMakeVisible (rLabel2 = new Label ("r label", + "R")); + rLabel2->setFont (Font (15.00f, Font::plain)); + rLabel2->setJustificationType (Justification::centred); + rLabel2->setEditable (false, false, false); + rLabel2->setColour (Label::textColourId, Colour (0xff007f00)); + rLabel2->setColour (TextEditor::textColourId, Colours::black); + rLabel2->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (attenuationSlider2 = new Slider ("attenuation slider")); + attenuationSlider2->setRange (-47.25, 0, 0.75); + attenuationSlider2->setSliderStyle (Slider::LinearVertical); + attenuationSlider2->setTextBoxStyle (Slider::TextBoxBelow, false, 64, 20); + attenuationSlider2->setColour (Slider::thumbColourId, Colour (0xff00af00)); + attenuationSlider2->setColour (Slider::trackColourId, Colour (0x7f007f00)); + attenuationSlider2->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); + attenuationSlider2->setColour (Slider::textBoxBackgroundColourId, Colours::black); + attenuationSlider2->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); + attenuationSlider2->addListener (this); + + addAndMakeVisible (attenuationLabel2 = new Label ("attenuation label", + "Attenuation")); + attenuationLabel2->setFont (Font (15.00f, Font::plain)); + attenuationLabel2->setJustificationType (Justification::centred); + attenuationLabel2->setEditable (false, false, false); + attenuationLabel2->setColour (Label::textColourId, Colour (0xff007f00)); + attenuationLabel2->setColour (TextEditor::textColourId, Colours::black); + attenuationLabel2->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (dbLabel3 = new Label ("db label", + "dB")); + dbLabel3->setFont (Font (15.00f, Font::plain)); + dbLabel3->setJustificationType (Justification::centred); + dbLabel3->setEditable (false, false, false); + dbLabel3->setColour (Label::textColourId, Colour (0xff007f00)); + dbLabel3->setColour (Label::outlineColourId, Colour (0x00000000)); + dbLabel3->setColour (TextEditor::textColourId, Colours::black); + dbLabel3->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (sineImageButton2 = new ImageButton ("sine image button")); + sineImageButton2->setTooltip ("sine"); + sineImageButton2->setButtonText ("Sine"); + sineImageButton2->setRadioGroupId (1); + sineImageButton2->addListener (this); + + sineImageButton2->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 (halfsineImageButton2 = new ImageButton ("half sine image button")); + halfsineImageButton2->setTooltip ("half sine"); + halfsineImageButton2->setButtonText ("Half Sine"); + halfsineImageButton2->setRadioGroupId (1); + halfsineImageButton2->addListener (this); + + halfsineImageButton2->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 (abssineImageButton2 = new ImageButton ("abs sine image button")); + abssineImageButton2->setTooltip ("abs sine"); + abssineImageButton2->setButtonText ("Abs Sine"); + abssineImageButton2->setRadioGroupId (1); + abssineImageButton2->addListener (this); + + abssineImageButton2->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 (quartersineImageButton2 = new ImageButton ("quarter sine image button")); + quartersineImageButton2->setTooltip ("quarter sine"); + quartersineImageButton2->setButtonText ("Quarter Sine"); + quartersineImageButton2->setRadioGroupId (1); + quartersineImageButton2->addListener (this); + + quartersineImageButton2->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 (waveLabel2 = new Label ("wave label", + "Wave")); + waveLabel2->setFont (Font (15.00f, Font::plain)); + waveLabel2->setJustificationType (Justification::centred); + waveLabel2->setEditable (false, false, false); + waveLabel2->setColour (Label::textColourId, Colour (0xff007f00)); + waveLabel2->setColour (TextEditor::textColourId, Colours::black); + waveLabel2->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (tremoloButton2 = new ToggleButton ("tremolo button")); + tremoloButton2->setButtonText ("Tremolo"); + tremoloButton2->addListener (this); + tremoloButton2->setColour (ToggleButton::textColourId, Colour (0xff007f00)); + + addAndMakeVisible (vibratoButton2 = new ToggleButton ("vibrato button")); + vibratoButton2->setButtonText ("Vibrato"); + vibratoButton2->addListener (this); + vibratoButton2->setColour (ToggleButton::textColourId, Colour (0xff007f00)); + + addAndMakeVisible (sustainButton2 = new ToggleButton ("sustain button")); + sustainButton2->setButtonText ("Sustain"); + sustainButton2->addListener (this); + sustainButton2->setColour (ToggleButton::textColourId, Colour (0xff007f00)); + + addAndMakeVisible (keyscaleEnvButton2 = new ToggleButton ("keyscale env button")); + keyscaleEnvButton2->setButtonText ("Keyscale Envelope Rate"); + keyscaleEnvButton2->addListener (this); + keyscaleEnvButton2->setColour (ToggleButton::textColourId, Colour (0xff007f00)); + + addAndMakeVisible (keyscaleSlider2 = new Slider ("keyscale slider")); + keyscaleSlider2->setRange (-6, 0, 1.5); + keyscaleSlider2->setSliderStyle (Slider::LinearHorizontal); + keyscaleSlider2->setTextBoxStyle (Slider::TextBoxLeft, false, 44, 20); + keyscaleSlider2->setColour (Slider::thumbColourId, Colour (0xff00af00)); + keyscaleSlider2->setColour (Slider::trackColourId, Colour (0x7f007f00)); + keyscaleSlider2->setColour (Slider::textBoxTextColourId, Colour (0xff007f00)); + keyscaleSlider2->setColour (Slider::textBoxBackgroundColourId, Colours::black); + keyscaleSlider2->setColour (Slider::textBoxHighlightColourId, Colour (0xff00af00)); + keyscaleSlider2->addListener (this); + + addAndMakeVisible (frequencyLabel4 = new Label ("frequency label", + "Keyscale Attenuation")); + frequencyLabel4->setFont (Font (15.00f, Font::plain)); + frequencyLabel4->setJustificationType (Justification::centred); + frequencyLabel4->setEditable (false, false, false); + frequencyLabel4->setColour (Label::textColourId, Colour (0xff007f00)); + frequencyLabel4->setColour (TextEditor::textColourId, Colours::black); + frequencyLabel4->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + addAndMakeVisible (dbLabel4 = new Label ("db label", + "dB/\n8ve\n")); + dbLabel4->setFont (Font (15.00f, Font::plain)); + dbLabel4->setJustificationType (Justification::centred); + dbLabel4->setEditable (false, false, false); + dbLabel4->setColour (Label::textColourId, Colour (0xff007f00)); + dbLabel4->setColour (Label::outlineColourId, Colour (0x00000000)); + dbLabel4->setColour (TextEditor::textColourId, Colours::black); + dbLabel4->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + //[UserPreSize] frequencyComboBox->setColour (ComboBox::textColourId, Colour (COLOUR_MID)); @@ -219,7 +500,7 @@ PluginGui::PluginGui (JuceOplvstiAudioProcessor* ownerFilter) frequencyComboBox->setColour (ComboBox::buttonColourId, Colours::black); frequencyComboBox->setColour (ComboBox::backgroundColourId, Colours::black); - frequencyComboBox->addItem ("x1/2", 0); + frequencyComboBox->addItem ("x1/2", 16); // can't use 0 :( frequencyComboBox->addItem ("x1", 1); frequencyComboBox->addItem ("x2", 2); frequencyComboBox->addItem ("x3", 3); @@ -233,6 +514,25 @@ PluginGui::PluginGui (JuceOplvstiAudioProcessor* ownerFilter) frequencyComboBox->addItem ("x12", 12); frequencyComboBox->addItem ("x15", 15); + frequencyComboBox2->setColour (ComboBox::textColourId, Colour (COLOUR_MID)); + frequencyComboBox2->setColour (ComboBox::outlineColourId, Colour (COLOUR_MID)); + frequencyComboBox2->setColour (ComboBox::arrowColourId, Colour (COLOUR_MID)); + frequencyComboBox2->setColour (ComboBox::buttonColourId, Colours::black); + frequencyComboBox2->setColour (ComboBox::backgroundColourId, Colours::black); + frequencyComboBox2->addItem ("x1/2", 16); // can't use 0 :( + frequencyComboBox2->addItem ("x1", 1); + frequencyComboBox2->addItem ("x2", 2); + frequencyComboBox2->addItem ("x3", 3); + frequencyComboBox2->addItem ("x4", 4); + frequencyComboBox2->addItem ("x5", 5); + frequencyComboBox2->addItem ("x6", 6); + frequencyComboBox2->addItem ("x7", 7); + frequencyComboBox2->addItem ("x8", 8); + frequencyComboBox2->addItem ("x9", 9); + frequencyComboBox2->addItem ("x10", 10); + frequencyComboBox2->addItem ("x12", 12); + frequencyComboBox2->addItem ("x15", 15); + sineImageButton->setClickingTogglesState(true); sineImageButton->setRepaintsOnMouseActivity(false); abssineImageButton->setClickingTogglesState(true); @@ -241,9 +541,26 @@ PluginGui::PluginGui (JuceOplvstiAudioProcessor* ownerFilter) halfsineImageButton->setRepaintsOnMouseActivity(false); quartersineImageButton->setClickingTogglesState(true); quartersineImageButton->setRepaintsOnMouseActivity(false); + sineImageButton2->setClickingTogglesState(true); + sineImageButton2->setRepaintsOnMouseActivity(false); + abssineImageButton2->setClickingTogglesState(true); + abssineImageButton2->setRepaintsOnMouseActivity(false); + halfsineImageButton2->setClickingTogglesState(true); + halfsineImageButton2->setRepaintsOnMouseActivity(false); + quartersineImageButton2->setClickingTogglesState(true); + quartersineImageButton2->setRepaintsOnMouseActivity(false); + + tremoloButton->setColour(TextButton::buttonColourId, Colour(COLOUR_MID)); + vibratoButton->setColour(TextButton::buttonColourId, Colour(COLOUR_MID)); + keyscaleEnvButton->setColour(TextButton::buttonColourId, Colour(COLOUR_MID)); + sustainButton->setColour(TextButton::buttonColourId, Colour(COLOUR_MID)); + tremoloButton2->setColour(TextButton::buttonColourId, Colour(COLOUR_MID)); + vibratoButton2->setColour(TextButton::buttonColourId, Colour(COLOUR_MID)); + keyscaleEnvButton2->setColour(TextButton::buttonColourId, Colour(COLOUR_MID)); + sustainButton2->setColour(TextButton::buttonColourId, Colour(COLOUR_MID)); //[/UserPreSize] - setSize (600, 400); + setSize (600, 620); //[Constructor] You can add your own custom stuff here.. @@ -275,6 +592,39 @@ PluginGui::~PluginGui() abssineImageButton = nullptr; quartersineImageButton = nullptr; waveLabel = nullptr; + tremoloButton = nullptr; + vibratoButton = nullptr; + sustainButton = nullptr; + keyscaleEnvButton = nullptr; + keyscaleSlider = nullptr; + frequencyLabel2 = nullptr; + dbLabel2 = nullptr; + groupComponent2 = nullptr; + frequencyComboBox2 = nullptr; + frequencyLabel3 = nullptr; + aSlider2 = nullptr; + aLabel2 = nullptr; + dSlider2 = nullptr; + dLabel3 = nullptr; + sSlider2 = nullptr; + dLabel4 = nullptr; + rSlider2 = nullptr; + rLabel2 = nullptr; + attenuationSlider2 = nullptr; + attenuationLabel2 = nullptr; + dbLabel3 = nullptr; + sineImageButton2 = nullptr; + halfsineImageButton2 = nullptr; + abssineImageButton2 = nullptr; + quartersineImageButton2 = nullptr; + waveLabel2 = nullptr; + tremoloButton2 = nullptr; + vibratoButton2 = nullptr; + sustainButton2 = nullptr; + keyscaleEnvButton2 = nullptr; + keyscaleSlider2 = nullptr; + frequencyLabel4 = nullptr; + dbLabel4 = nullptr; //[Destructor]. You can add your own custom destruction code here.. @@ -295,25 +645,58 @@ void PluginGui::paint (Graphics& g) 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); + groupComponent->setBounds (16, 8, 392, 296); + frequencyComboBox->setBounds (120, 80, 72, 24); + frequencyLabel->setBounds (16, 80, 96, 24); + aSlider->setBounds (40, 192, 48, 72); + aLabel->setBounds (40, 264, 48, 24); + dSlider->setBounds (104, 192, 48, 72); + dLabel->setBounds (104, 264, 48, 24); + sSlider->setBounds (168, 192, 48, 72); + dLabel2->setBounds (168, 264, 48, 24); + rSlider->setBounds (232, 192, 48, 72); + rLabel->setBounds (232, 264, 48, 24); + attenuationSlider->setBounds (296, 152, 72, 112); + attenuationLabel->setBounds (296, 264, 96, 24); + dbLabel->setBounds (360, 240, 40, 24); + sineImageButton->setBounds (120, 40, 34, 30); + halfsineImageButton->setBounds (176, 40, 34, 30); + abssineImageButton->setBounds (232, 40, 34, 30); + quartersineImageButton->setBounds (288, 40, 34, 30); + waveLabel->setBounds (16, 40, 96, 24); + tremoloButton->setBounds (40, 120, 96, 24); + vibratoButton->setBounds (40, 152, 96, 24); + sustainButton->setBounds (128, 120, 96, 24); + keyscaleEnvButton->setBounds (128, 152, 184, 24); + keyscaleSlider->setBounds (256, 96, 112, 24); + frequencyLabel2->setBounds (248, 120, 152, 24); + dbLabel2->setBounds (368, 88, 40, 40); + groupComponent2->setBounds (16, 320, 392, 296); + frequencyComboBox2->setBounds (120, 392, 72, 24); + frequencyLabel3->setBounds (16, 392, 96, 24); + aSlider2->setBounds (40, 504, 48, 72); + aLabel2->setBounds (40, 576, 48, 24); + dSlider2->setBounds (104, 504, 48, 72); + dLabel3->setBounds (104, 576, 48, 24); + sSlider2->setBounds (168, 504, 48, 72); + dLabel4->setBounds (168, 576, 48, 24); + rSlider2->setBounds (232, 504, 48, 72); + rLabel2->setBounds (232, 576, 48, 24); + attenuationSlider2->setBounds (296, 464, 72, 112); + attenuationLabel2->setBounds (296, 576, 96, 24); + dbLabel3->setBounds (360, 552, 40, 24); + sineImageButton2->setBounds (120, 352, 34, 30); + halfsineImageButton2->setBounds (176, 352, 34, 30); + abssineImageButton2->setBounds (232, 352, 34, 30); + quartersineImageButton2->setBounds (288, 352, 34, 30); + waveLabel2->setBounds (16, 352, 96, 24); + tremoloButton2->setBounds (40, 432, 96, 24); + vibratoButton2->setBounds (40, 464, 96, 24); + sustainButton2->setBounds (128, 432, 96, 24); + keyscaleEnvButton2->setBounds (128, 464, 184, 24); + keyscaleSlider2->setBounds (256, 408, 112, 24); + frequencyLabel4->setBounds (248, 432, 152, 24); + dbLabel4->setBounds (368, 400, 40, 40); //[UserResized] Add your own custom resize handling here.. //[/UserResized] } @@ -326,9 +709,19 @@ void PluginGui::comboBoxChanged (ComboBox* comboBoxThatHasChanged) if (comboBoxThatHasChanged == frequencyComboBox) { //[UserComboBoxCode_frequencyComboBox] -- add your combo box handling code here.. - processor->setEnumParameter("Modulator Frequency", frequencyComboBox->getSelectedId()); + int id = comboBoxThatHasChanged->getSelectedId(); + if (id > 15) id = 0; + processor->setEnumParameter("Modulator Frequency Multiplier", id); //[/UserComboBoxCode_frequencyComboBox] } + else if (comboBoxThatHasChanged == frequencyComboBox2) + { + //[UserComboBoxCode_frequencyComboBox2] -- add your combo box handling code here.. + int id = comboBoxThatHasChanged->getSelectedId(); + if (id > 15) id = 0; + processor->setEnumParameter("Carrier Frequency Multiplier", id); + //[/UserComboBoxCode_frequencyComboBox2] + } //[UsercomboBoxChanged_Post] //[/UsercomboBoxChanged_Post] @@ -342,33 +735,75 @@ void PluginGui::sliderValueChanged (Slider* sliderThatWasMoved) if (sliderThatWasMoved == aSlider) { //[UserSliderCode_aSlider] -- add your slider handling code here.. - processor->setIntParameter("Modulator Attack", (int)aSlider->getValue()); + processor->setIntParameter("Modulator Attack", (int)sliderThatWasMoved->getValue()); //[/UserSliderCode_aSlider] } else if (sliderThatWasMoved == dSlider) { //[UserSliderCode_dSlider] -- add your slider handling code here.. - processor->setIntParameter("Modulator Decay", (int)dSlider->getValue()); + processor->setIntParameter("Modulator Decay", (int)sliderThatWasMoved->getValue()); //[/UserSliderCode_dSlider] } else if (sliderThatWasMoved == sSlider) { //[UserSliderCode_sSlider] -- add your slider handling code here.. - processor->setIntParameter("Modulator Sustain", (int)sSlider->getValue()); + processor->setIntParameter("Modulator Sustain Level", (int)sliderThatWasMoved->getValue()); //[/UserSliderCode_sSlider] } else if (sliderThatWasMoved == rSlider) { //[UserSliderCode_rSlider] -- add your slider handling code here.. - processor->setIntParameter("Modulator Release", (int)rSlider->getValue()); + processor->setIntParameter("Modulator Release", (int)sliderThatWasMoved->getValue()); //[/UserSliderCode_rSlider] } else if (sliderThatWasMoved == attenuationSlider) { //[UserSliderCode_attenuationSlider] -- add your slider handling code here.. - processor->setEnumParameter("Modulator Attenuation", -(int)(attenuationSlider->getValue()/0.75)); + processor->setEnumParameter("Modulator Attenuation", -(int)(sliderThatWasMoved->getValue()/0.75)); //[/UserSliderCode_attenuationSlider] } + else if (sliderThatWasMoved == keyscaleSlider) + { + //[UserSliderCode_keyscaleSlider] -- add your slider handling code here.. + processor->setEnumParameter("Modulator Keyscale Level", -(int)(sliderThatWasMoved->getValue()/1.5)); + //[/UserSliderCode_keyscaleSlider] + } + else if (sliderThatWasMoved == aSlider2) + { + //[UserSliderCode_aSlider2] -- add your slider handling code here.. + processor->setIntParameter("Carrier Attack", (int)sliderThatWasMoved->getValue()); + //[/UserSliderCode_aSlider2] + } + else if (sliderThatWasMoved == dSlider2) + { + //[UserSliderCode_dSlider2] -- add your slider handling code here.. + processor->setIntParameter("Carrier Decay", (int)sliderThatWasMoved->getValue()); + //[/UserSliderCode_dSlider2] + } + else if (sliderThatWasMoved == sSlider2) + { + //[UserSliderCode_sSlider2] -- add your slider handling code here.. + processor->setIntParameter("Carrier Sustain Level", (int)sliderThatWasMoved->getValue()); + //[/UserSliderCode_sSlider2] + } + else if (sliderThatWasMoved == rSlider2) + { + //[UserSliderCode_rSlider2] -- add your slider handling code here.. + processor->setIntParameter("Carrier Release", (int)sliderThatWasMoved->getValue()); + //[/UserSliderCode_rSlider2] + } + else if (sliderThatWasMoved == attenuationSlider2) + { + //[UserSliderCode_attenuationSlider2] -- add your slider handling code here.. + processor->setEnumParameter("Carrier Attenuation", -(int)(sliderThatWasMoved->getValue()/0.75)); + //[/UserSliderCode_attenuationSlider2] + } + else if (sliderThatWasMoved == keyscaleSlider2) + { + //[UserSliderCode_keyscaleSlider2] -- add your slider handling code here.. + processor->setEnumParameter("Carrier Keyscale Level", -(int)(sliderThatWasMoved->getValue()/1.5)); + //[/UserSliderCode_keyscaleSlider2] + } //[UsersliderValueChanged_Post] //[/UsersliderValueChanged_Post] @@ -403,6 +838,78 @@ void PluginGui::buttonClicked (Button* buttonThatWasClicked) processor->setEnumParameter("Modulator Wave", 3); //[/UserButtonCode_quartersineImageButton] } + else if (buttonThatWasClicked == tremoloButton) + { + //[UserButtonCode_tremoloButton] -- add your button handler code here.. + processor->setEnumParameter("Modulator Tremolo", buttonThatWasClicked->getToggleState() ? 1 : 0); + //[/UserButtonCode_tremoloButton] + } + else if (buttonThatWasClicked == vibratoButton) + { + //[UserButtonCode_vibratoButton] -- add your button handler code here.. + processor->setEnumParameter("Modulator Vibrato", buttonThatWasClicked->getToggleState() ? 1 : 0); + //[/UserButtonCode_vibratoButton] + } + else if (buttonThatWasClicked == sustainButton) + { + //[UserButtonCode_sustainButton] -- add your button handler code here.. + processor->setEnumParameter("Modulator Sustain", buttonThatWasClicked->getToggleState() ? 1 : 0); + //[/UserButtonCode_sustainButton] + } + else if (buttonThatWasClicked == keyscaleEnvButton) + { + //[UserButtonCode_keyscaleEnvButton] -- add your button handler code here.. + processor->setEnumParameter("Modulator Keyscale Rate", buttonThatWasClicked->getToggleState() ? 1 : 0); + //[/UserButtonCode_keyscaleEnvButton] + } + else if (buttonThatWasClicked == sineImageButton2) + { + //[UserButtonCode_sineImageButton2] -- add your button handler code here.. + processor->setEnumParameter("Carrier Wave", 0); + //[/UserButtonCode_sineImageButton2] + } + else if (buttonThatWasClicked == halfsineImageButton2) + { + //[UserButtonCode_halfsineImageButton2] -- add your button handler code here.. + processor->setEnumParameter("Carrier Wave", 1); + //[/UserButtonCode_halfsineImageButton2] + } + else if (buttonThatWasClicked == abssineImageButton2) + { + //[UserButtonCode_abssineImageButton2] -- add your button handler code here.. + processor->setEnumParameter("Carrier Wave", 2); + //[/UserButtonCode_abssineImageButton2] + } + else if (buttonThatWasClicked == quartersineImageButton2) + { + //[UserButtonCode_quartersineImageButton2] -- add your button handler code here.. + processor->setEnumParameter("Carrier Wave", 3); + //[/UserButtonCode_quartersineImageButton2] + } + else if (buttonThatWasClicked == tremoloButton2) + { + //[UserButtonCode_tremoloButton2] -- add your button handler code here.. + processor->setEnumParameter("Carrier Tremolo", buttonThatWasClicked->getToggleState() ? 1 : 0); + //[/UserButtonCode_tremoloButton2] + } + else if (buttonThatWasClicked == vibratoButton2) + { + //[UserButtonCode_vibratoButton2] -- add your button handler code here.. + processor->setEnumParameter("Carrier Vibrato", buttonThatWasClicked->getToggleState() ? 1 : 0); + //[/UserButtonCode_vibratoButton2] + } + else if (buttonThatWasClicked == sustainButton2) + { + //[UserButtonCode_sustainButton2] -- add your button handler code here.. + processor->setEnumParameter("Carrier Sustain", buttonThatWasClicked->getToggleState() ? 1 : 0); + //[/UserButtonCode_sustainButton2] + } + else if (buttonThatWasClicked == keyscaleEnvButton2) + { + //[UserButtonCode_keyscaleEnvButton2] -- add your button handler code here.. + processor->setEnumParameter("Carrier Keyscale Rate", buttonThatWasClicked->getToggleState() ? 1 : 0); + //[/UserButtonCode_keyscaleEnvButton2] + } //[UserbuttonClicked_Post] //[/UserbuttonClicked_Post] @@ -427,108 +934,272 @@ BEGIN_JUCER_METADATA parentClasses="public AudioProcessorEditor" constructorParams="JuceOplvstiAudioProcessor* ownerFilter" variableInitialisers=" AudioProcessorEditor (ownerFilter)" snapPixels="8" snapActive="1" snapShown="1" overlayOpacity="0.33" fixedSize="0" - initialWidth="600" initialHeight="400"> + initialWidth="600" initialHeight="620">