andrewm@0: /* andrewm@0: ============================================================================== andrewm@0: andrewm@0: This is an automatically generated GUI class created by the Introjucer! andrewm@0: andrewm@0: Be careful when adding custom code to these files, as only the code within andrewm@0: the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded andrewm@0: and re-saved. andrewm@0: andrewm@0: Created with Introjucer version: 3.1.0 andrewm@0: andrewm@0: ------------------------------------------------------------------------------ andrewm@0: andrewm@0: The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions" andrewm@0: Copyright 2004-13 by Raw Material Software Ltd. andrewm@0: andrewm@0: ============================================================================== andrewm@0: */ andrewm@0: andrewm@0: //[Headers] You can add your own extra header files here... andrewm@0: #include "PluginProcessor.h" andrewm@0: //[/Headers] andrewm@0: andrewm@0: #include "PluginEditor.h" andrewm@0: andrewm@0: andrewm@0: //[MiscUserDefs] You can add your own user definitions and misc code here... andrewm@0: andrewm@0: //LookAndFeelCustom* AutoWahAudioProcessorEditor::customLookAndFeel = NULL; andrewm@0: andrewm@0: //[/MiscUserDefs] andrewm@0: andrewm@0: //============================================================================== andrewm@0: AutoWahAudioProcessorEditor::AutoWahAudioProcessorEditor (AutoWahAudioProcessor* ownerFilter) andrewm@0: : AudioProcessorEditor (ownerFilter) andrewm@0: { andrewm@0: addAndMakeVisible (baseFrequencySlider_ = new Slider ("new slider")); andrewm@0: baseFrequencySlider_->setRange (200, 1000, 0.1); andrewm@0: baseFrequencySlider_->setSliderStyle (Slider::RotaryHorizontalVerticalDrag); andrewm@0: baseFrequencySlider_->setTextBoxStyle (Slider::TextBoxBelow, false, 60, 20); andrewm@0: baseFrequencySlider_->setColour (Slider::rotarySliderFillColourId, Colour (0x7fffffff)); andrewm@0: baseFrequencySlider_->setColour (Slider::textBoxTextColourId, Colours::white); andrewm@0: baseFrequencySlider_->setColour (Slider::textBoxBackgroundColourId, Colour (0x00000000)); andrewm@0: baseFrequencySlider_->setColour (Slider::textBoxOutlineColourId, Colour (0x00808080)); andrewm@0: baseFrequencySlider_->addListener (this); andrewm@0: andrewm@0: addAndMakeVisible (qSlider_ = new Slider ("new slider")); andrewm@0: qSlider_->setRange (2, 20, 0.1); andrewm@0: qSlider_->setSliderStyle (Slider::RotaryHorizontalVerticalDrag); andrewm@0: qSlider_->setTextBoxStyle (Slider::TextBoxBelow, false, 60, 20); andrewm@0: qSlider_->setColour (Slider::rotarySliderFillColourId, Colour (0x7fffffff)); andrewm@0: qSlider_->setColour (Slider::textBoxTextColourId, Colours::white); andrewm@0: qSlider_->setColour (Slider::textBoxBackgroundColourId, Colour (0x00000000)); andrewm@0: qSlider_->setColour (Slider::textBoxOutlineColourId, Colour (0x00808080)); andrewm@0: qSlider_->addListener (this); andrewm@0: andrewm@0: addAndMakeVisible (lfoFrequencySlider_ = new Slider ("new slider")); andrewm@0: lfoFrequencySlider_->setRange (0.2, 20, 0.1); andrewm@0: lfoFrequencySlider_->setSliderStyle (Slider::RotaryHorizontalVerticalDrag); andrewm@0: lfoFrequencySlider_->setTextBoxStyle (Slider::TextBoxBelow, false, 60, 20); andrewm@0: lfoFrequencySlider_->setColour (Slider::rotarySliderFillColourId, Colour (0x7fffffff)); andrewm@0: lfoFrequencySlider_->setColour (Slider::textBoxTextColourId, Colours::white); andrewm@0: lfoFrequencySlider_->setColour (Slider::textBoxBackgroundColourId, Colour (0x00000000)); andrewm@0: lfoFrequencySlider_->setColour (Slider::textBoxOutlineColourId, Colour (0x00808080)); andrewm@0: lfoFrequencySlider_->addListener (this); andrewm@0: andrewm@0: addAndMakeVisible (lfoWidthSlider_ = new Slider ("new slider")); andrewm@0: lfoWidthSlider_->setRange (0, 2000, 0.1); andrewm@0: lfoWidthSlider_->setSliderStyle (Slider::RotaryHorizontalVerticalDrag); andrewm@0: lfoWidthSlider_->setTextBoxStyle (Slider::TextBoxBelow, false, 60, 20); andrewm@0: lfoWidthSlider_->setColour (Slider::rotarySliderFillColourId, Colour (0x7fffffff)); andrewm@0: lfoWidthSlider_->setColour (Slider::textBoxTextColourId, Colours::white); andrewm@0: lfoWidthSlider_->setColour (Slider::textBoxBackgroundColourId, Colour (0x00000000)); andrewm@0: lfoWidthSlider_->setColour (Slider::textBoxOutlineColourId, Colour (0x00808080)); andrewm@0: lfoWidthSlider_->addListener (this); andrewm@0: andrewm@0: addAndMakeVisible (envelopeWidthSlider_ = new Slider ("new slider")); andrewm@0: envelopeWidthSlider_->setRange (0, 4000, 0.1); andrewm@0: envelopeWidthSlider_->setSliderStyle (Slider::RotaryHorizontalVerticalDrag); andrewm@0: envelopeWidthSlider_->setTextBoxStyle (Slider::TextBoxBelow, false, 60, 20); andrewm@0: envelopeWidthSlider_->setColour (Slider::rotarySliderFillColourId, Colour (0x7fffffff)); andrewm@0: envelopeWidthSlider_->setColour (Slider::textBoxTextColourId, Colours::white); andrewm@0: envelopeWidthSlider_->setColour (Slider::textBoxBackgroundColourId, Colour (0x00000000)); andrewm@0: envelopeWidthSlider_->setColour (Slider::textBoxOutlineColourId, Colour (0x00808080)); andrewm@0: envelopeWidthSlider_->addListener (this); andrewm@0: andrewm@0: addAndMakeVisible (envelopeAttackSlider_ = new Slider ("new slider")); andrewm@0: envelopeAttackSlider_->setRange (0, 0.1, 0.0001); andrewm@0: envelopeAttackSlider_->setSliderStyle (Slider::RotaryHorizontalVerticalDrag); andrewm@0: envelopeAttackSlider_->setTextBoxStyle (Slider::TextBoxBelow, false, 60, 20); andrewm@0: envelopeAttackSlider_->setColour (Slider::rotarySliderFillColourId, Colour (0x7fffffff)); andrewm@0: envelopeAttackSlider_->setColour (Slider::textBoxTextColourId, Colours::white); andrewm@0: envelopeAttackSlider_->setColour (Slider::textBoxBackgroundColourId, Colour (0x00000000)); andrewm@0: envelopeAttackSlider_->setColour (Slider::textBoxOutlineColourId, Colour (0x00808080)); andrewm@0: envelopeAttackSlider_->addListener (this); andrewm@0: envelopeAttackSlider_->setSkewFactor (0.02); andrewm@0: andrewm@0: addAndMakeVisible (envelopeDecaySlider_ = new Slider ("new slider")); andrewm@0: envelopeDecaySlider_->setRange (0, 2, 0.001); andrewm@0: envelopeDecaySlider_->setSliderStyle (Slider::RotaryHorizontalVerticalDrag); andrewm@0: envelopeDecaySlider_->setTextBoxStyle (Slider::TextBoxBelow, false, 60, 20); andrewm@0: envelopeDecaySlider_->setColour (Slider::rotarySliderFillColourId, Colour (0x7fffffff)); andrewm@0: envelopeDecaySlider_->setColour (Slider::textBoxTextColourId, Colours::white); andrewm@0: envelopeDecaySlider_->setColour (Slider::textBoxBackgroundColourId, Colour (0x00000000)); andrewm@0: envelopeDecaySlider_->setColour (Slider::textBoxOutlineColourId, Colour (0x00808080)); andrewm@0: envelopeDecaySlider_->addListener (this); andrewm@0: envelopeDecaySlider_->setSkewFactor (0.4); andrewm@0: andrewm@0: andrewm@0: //[UserPreSize] andrewm@0: addAndMakeVisible(resizer_ = new ResizableCornerComponent (this, &resizeLimits_)); andrewm@0: resizeLimits_.setSizeLimits(550, 200, 550, 200); andrewm@0: //[/UserPreSize] andrewm@0: andrewm@0: setSize (354, 380); andrewm@0: andrewm@0: andrewm@0: //[Constructor] You can add your own custom stuff here.. andrewm@0: //AutoWahAudioProcessor* ourProcessor = getProcessor(); // UNUSED (include when necessary) andrewm@0: andrewm@0: UpdateInterfaceValues(); andrewm@0: andrewm@0: // set our component's initial size to be the last one that was stored in the filter's settings andrewm@0: setSize(ownerFilter->lastUIWidth_, andrewm@0: ownerFilter->lastUIHeight_); andrewm@0: andrewm@0: //************************************ SET LOOKANDFEEL ********************************** andrewm@0: // if( customLookAndFeel == NULL ) andrewm@0: // { andrewm@0: // customLookAndFeel = new LookAndFeelCustom(); andrewm@0: // LookAndFeel::setDefaultLookAndFeel (/*&*/customLookAndFeel); andrewm@0: // } andrewm@0: andrewm@0: //*************************************************************************************** andrewm@0: andrewm@0: andrewm@0: startTimer(50); andrewm@0: andrewm@0: //[/Constructor] andrewm@0: } andrewm@0: andrewm@0: AutoWahAudioProcessorEditor::~AutoWahAudioProcessorEditor() andrewm@0: { andrewm@0: //[Destructor_pre]. You can add your own custom destruction code here.. andrewm@0: //[/Destructor_pre] andrewm@0: andrewm@0: baseFrequencySlider_ = nullptr; andrewm@0: qSlider_ = nullptr; andrewm@0: lfoFrequencySlider_ = nullptr; andrewm@0: lfoWidthSlider_ = nullptr; andrewm@0: envelopeWidthSlider_ = nullptr; andrewm@0: envelopeAttackSlider_ = nullptr; andrewm@0: envelopeDecaySlider_ = nullptr; andrewm@0: andrewm@0: andrewm@0: //[Destructor]. You can add your own custom destruction code here.. andrewm@0: //[/Destructor] andrewm@0: } andrewm@0: andrewm@0: //============================================================================== andrewm@0: void AutoWahAudioProcessorEditor::paint (Graphics& g) andrewm@0: { andrewm@0: //[UserPrePaint] Add your own custom painting code here.. andrewm@0: //[/UserPrePaint] andrewm@0: andrewm@0: g.fillAll (Colour (0xffa7998c)); andrewm@0: andrewm@0: g.setColour (Colour (0xff9e8365)); andrewm@0: g.fillRoundedRectangle (11.0f, 12.0f, 333.0f, 94.0f, 10.000f); andrewm@0: andrewm@0: g.setColour (Colour (0xff9e8365)); andrewm@0: g.fillRoundedRectangle (11.0f, 115.0f, 333.0f, 94.0f, 10.000f); andrewm@0: andrewm@0: g.setColour (Colour (0xff9e8365)); andrewm@0: g.fillRoundedRectangle (11.0f, 217.0f, 333.0f, 152.0f, 10.000f); andrewm@0: andrewm@0: g.setColour (Colour (0xff992b13)); andrewm@0: g.setFont (Font (15.00f, Font::plain)); andrewm@0: g.drawText (TRANS("Q"), andrewm@0: 190, 32, 72, 30, andrewm@0: Justification::centred, true); andrewm@0: andrewm@0: g.setColour (Colour (0xff992b13)); andrewm@0: g.setFont (Font (15.00f, Font::plain)); andrewm@0: g.drawText (TRANS("Depth"), andrewm@0: 190, 138, 72, 30, andrewm@0: Justification::centred, true); andrewm@0: andrewm@0: g.setColour (Colour (0xff992b13)); andrewm@0: g.setFont (Font (15.00f, Font::plain)); andrewm@0: g.drawText (TRANS("Attack"), andrewm@0: 190, 233, 72, 30, andrewm@0: Justification::centred, true); andrewm@0: andrewm@0: g.setColour (Colour (0xff992b13)); andrewm@0: g.setFont (Font (15.00f, Font::plain)); andrewm@0: g.drawText (TRANS("Release"), andrewm@0: 192, 304, 72, 30, andrewm@0: Justification::centred, true); andrewm@0: andrewm@0: g.setColour (Colour (0xff992b13)); andrewm@0: g.setFont (Font (15.00f, Font::plain)); andrewm@0: g.drawText (TRANS("Frequency"), andrewm@0: 12, 32, 72, 30, andrewm@0: Justification::centred, true); andrewm@0: andrewm@0: g.setColour (Colour (0xff992b13)); andrewm@0: g.setFont (Font (15.00f, Font::plain)); andrewm@0: g.drawText (TRANS("Frequency"), andrewm@0: 3, 138, 89, 30, andrewm@0: Justification::centred, true); andrewm@0: andrewm@0: g.setColour (Colour (0xff992b13)); andrewm@0: g.setFont (Font (15.00f, Font::plain)); andrewm@0: g.drawText (TRANS("Depth"), andrewm@0: 0, 233, 95, 30, andrewm@0: Justification::centred, true); andrewm@0: andrewm@0: g.setColour (Colour (0xff992b13)); andrewm@0: g.setFont (Font (28.00f, Font::bold)); andrewm@0: g.drawText (TRANS("AutoWah"), andrewm@0: 2, -2, 111, 28, andrewm@0: Justification::centred, true); andrewm@0: andrewm@0: g.setColour (Colour (0xff992b13)); andrewm@0: g.setFont (Font (24.00f, Font::plain)); andrewm@0: g.drawText (TRANS("LFO"), andrewm@0: 1, 176, 69, 34, andrewm@0: Justification::centred, true); andrewm@0: andrewm@0: g.setColour (Colour (0xff992b13)); andrewm@0: g.setFont (Font (24.00f, Font::plain)); andrewm@0: g.drawText (TRANS("ENVELOPE"), andrewm@0: 10, 334, 112, 34, andrewm@0: Justification::centred, true); andrewm@0: andrewm@0: //[UserPaint] Add your own custom painting code here.. andrewm@0: //[/UserPaint] andrewm@0: } andrewm@0: andrewm@0: void AutoWahAudioProcessorEditor::resized() andrewm@0: { andrewm@0: baseFrequencySlider_->setBounds (86, 20, 80, 80); andrewm@0: qSlider_->setBounds (261, 20, 80, 80); andrewm@0: lfoFrequencySlider_->setBounds (86, 126, 80, 80); andrewm@0: lfoWidthSlider_->setBounds (261, 126, 80, 80); andrewm@0: envelopeWidthSlider_->setBounds (86, 223, 80, 80); andrewm@0: envelopeAttackSlider_->setBounds (269, 223, 66, 66); andrewm@0: envelopeDecaySlider_->setBounds (270, 299, 66, 66); andrewm@0: //[UserResized] Add your own custom resize handling here.. andrewm@0: getProcessor()->lastUIWidth_ = getWidth(); andrewm@0: getProcessor()->lastUIHeight_ = getHeight(); andrewm@0: //[/UserResized] andrewm@0: } andrewm@0: andrewm@0: void AutoWahAudioProcessorEditor::sliderValueChanged (Slider* sliderThatWasMoved) andrewm@0: { andrewm@0: //[UsersliderValueChanged_Pre] andrewm@0: AutoWahAudioProcessor* ourProcessor = getProcessor(); andrewm@0: //[/UsersliderValueChanged_Pre] andrewm@0: andrewm@0: if (sliderThatWasMoved == baseFrequencySlider_) andrewm@0: { andrewm@0: //[UserSliderCode_baseFrequencySlider_] -- add your slider handling code here.. andrewm@0: ourProcessor->setParameterNotifyingHost (AutoWahAudioProcessor::kBaseFrequencyParam, andrewm@0: (float)baseFrequencySlider_->getValue()); andrewm@0: //[/UserSliderCode_baseFrequencySlider_] andrewm@0: } andrewm@0: else if (sliderThatWasMoved == qSlider_) andrewm@0: { andrewm@0: //[UserSliderCode_qSlider_] -- add your slider handling code here.. andrewm@0: ourProcessor->setParameterNotifyingHost (AutoWahAudioProcessor::kQParam, andrewm@0: (float)qSlider_->getValue()); andrewm@0: //[/UserSliderCode_qSlider_] andrewm@0: } andrewm@0: else if (sliderThatWasMoved == lfoFrequencySlider_) andrewm@0: { andrewm@0: //[UserSliderCode_lfoFrequencySlider_] -- add your slider handling code here.. andrewm@0: ourProcessor->setParameterNotifyingHost (AutoWahAudioProcessor::kLFOFrequencyParam, andrewm@0: (float)lfoFrequencySlider_->getValue()); andrewm@0: //[/UserSliderCode_lfoFrequencySlider_] andrewm@0: } andrewm@0: else if (sliderThatWasMoved == lfoWidthSlider_) andrewm@0: { andrewm@0: //[UserSliderCode_lfoWidthSlider_] -- add your slider handling code here.. andrewm@0: ourProcessor->setParameterNotifyingHost (AutoWahAudioProcessor::kLFOWidthParam, andrewm@0: (float)lfoWidthSlider_->getValue()); andrewm@0: //[/UserSliderCode_lfoWidthSlider_] andrewm@0: } andrewm@0: else if (sliderThatWasMoved == envelopeWidthSlider_) andrewm@0: { andrewm@0: //[UserSliderCode_envelopeWidthSlider_] -- add your slider handling code here.. andrewm@0: ourProcessor->setParameterNotifyingHost (AutoWahAudioProcessor::kEnvelopeWidthParam, andrewm@0: (float)envelopeWidthSlider_->getValue()); andrewm@0: //[/UserSliderCode_envelopeWidthSlider_] andrewm@0: } andrewm@0: else if (sliderThatWasMoved == envelopeAttackSlider_) andrewm@0: { andrewm@0: //[UserSliderCode_envelopeAttackSlider_] -- add your slider handling code here.. andrewm@0: ourProcessor->setParameterNotifyingHost (AutoWahAudioProcessor::kEnvelopeAttackParam, andrewm@0: (float)envelopeAttackSlider_->getValue()); andrewm@0: //[/UserSliderCode_envelopeAttackSlider_] andrewm@0: } andrewm@0: else if (sliderThatWasMoved == envelopeDecaySlider_) andrewm@0: { andrewm@0: //[UserSliderCode_envelopeDecaySlider_] -- add your slider handling code here.. andrewm@0: ourProcessor->setParameterNotifyingHost (AutoWahAudioProcessor::kEnvelopeDecayParam, andrewm@0: (float)envelopeDecaySlider_->getValue()); andrewm@0: //[/UserSliderCode_envelopeDecaySlider_] andrewm@0: } andrewm@0: andrewm@0: //[UsersliderValueChanged_Post] andrewm@0: //[/UsersliderValueChanged_Post] andrewm@0: } andrewm@0: andrewm@0: andrewm@0: andrewm@0: //[MiscUserCode] You can add your own definitions of your custom methods or any other code here... andrewm@0: void AutoWahAudioProcessorEditor::UpdateInterfaceValues() andrewm@0: { andrewm@0: AutoWahAudioProcessor* ourProcessor = getProcessor(); andrewm@0: andrewm@0: // Update Sliders andrewm@0: baseFrequencySlider_ ->setValue(ourProcessor->baseFrequency_, dontSendNotification); andrewm@0: qSlider_ ->setValue(ourProcessor->q_, dontSendNotification); andrewm@0: lfoFrequencySlider_ ->setValue(ourProcessor->lfoFrequency_); andrewm@0: lfoWidthSlider_ ->setValue(ourProcessor->lfoWidth_); andrewm@0: envelopeWidthSlider_ ->setValue(ourProcessor->envelopeWidth_); andrewm@0: envelopeAttackSlider_ ->setValue(ourProcessor->envelopeAttack_); andrewm@0: envelopeDecaySlider_ ->setValue(ourProcessor->envelopeDecay_); andrewm@0: andrewm@0: } andrewm@0: andrewm@0: // This timer periodically checks whether any of the filter's parameters have changed... andrewm@0: void AutoWahAudioProcessorEditor::timerCallback() andrewm@0: { andrewm@0: // AutoWahAudioProcessor* ourProcessor = getProcessor(); andrewm@0: } andrewm@0: andrewm@0: //[/MiscUserCode] andrewm@0: andrewm@0: andrewm@0: //============================================================================== andrewm@0: #if 0 andrewm@0: /* -- Introjucer information section -- andrewm@0: andrewm@0: This is where the Introjucer stores the metadata that describe this GUI layout, so andrewm@0: make changes in here at your peril! andrewm@0: andrewm@0: BEGIN_JUCER_METADATA andrewm@0: andrewm@0: andrewm@0: andrewm@0: andrewm@0: andrewm@0: andrewm@0: andrewm@0: andrewm@0: andrewm@0: andrewm@0: andrewm@0: andrewm@0: andrewm@0: andrewm@0: andrewm@0: andrewm@0: andrewm@0: andrewm@0: andrewm@0: andrewm@0: andrewm@0: andrewm@0: andrewm@0: andrewm@0: andrewm@0: andrewm@0: END_JUCER_METADATA andrewm@0: */ andrewm@0: #endif andrewm@0: andrewm@0: andrewm@0: //[EndFile] You can add extra defines here... andrewm@0: //[/EndFile]