y@0: /* y@0: ============================================================================== y@0: y@0: This file was auto-generated by the Introjucer! y@0: y@0: It contains the basic startup code for a Juce application. y@0: y@0: ============================================================================== y@0: */ y@0: y@0: #include "PluginProcessor.h" y@0: #include "PluginEditor.h" y@0: y@0: y@0: //============================================================================== y@0: BassPedalRackProcessorEditor::BassPedalRackProcessorEditor (BassPedalRackProcessor* ownerFilter) y@0: : AudioProcessorEditor (ownerFilter), y@0: y@0: y@0: lowCutLabel_("","LowCut:"), y@0: lowCutSlider_("lowcut"), y@0: highCutLabel_("","HighCut:"), y@0: highCutSlider_("highcut"), y@0: y@0: indexLabel_("", "Index:"), y@0: indexSlider_("index"), y@0: gain1Label_("", "Gain1:"), y@0: gain1Slider_("gain1"), y@0: gain2Label_("", "Gain2:"), y@0: gain2Slider_("gain2"), y@0: gain3Label_("", "Gain3:"), y@0: gain3Slider_("gain3"), y@0: gain4Label_("", "Gain4:"), y@0: gain4Slider_("gain4"), y@0: gain5Label_("", "Gain5:"), y@0: gain5Slider_("gain5"), y@0: gain6Label_("", "Gain6:"), y@0: gain6Slider_("gain6"), y@0: gain7Label_("", "Gain7:"), y@0: gain7Slider_("gain7"), y@0: gain8Label_("", "Gain8:"), y@0: gain8Slider_("gain8"), y@0: gain9Label_("", "Gain9:"), y@0: gain9Slider_("gain9"), y@0: y@0: mixLabel_("", "Mix:"), y@0: mixSlider_("mix"), y@0: y@0: gainTreLabel_("", "Treble:"), y@0: gainTreSlider_("treble"), y@0: gainLowLabel_("", "Low:"), y@0: gainLowSlider_("low"), y@0: gainMidLabel_("", "Mid:"), y@0: gainMidSlider_("mid"), y@0: y@0: gainLabel_("", "Gain:"), y@0: gainSlider_("gain") y@0: { y@0: // This is where our plugin's editor size is set. y@0: // setSize(170, 80); y@0: y@0: // Set up the sliders y@0: addAndMakeVisible(&lowCutSlider_); lowCutSlider_.setSliderStyle(Slider::Rotary); lowCutSlider_.addListener(this); y@0: lowCutSlider_.setRange(0, 10, 1); lowCutLabel_.attachToComponent(&lowCutSlider_, false); lowCutLabel_.setFont(Font (11.0f)); y@0: y@0: addAndMakeVisible(&highCutSlider_); highCutSlider_.setSliderStyle(Slider::Rotary); highCutSlider_.addListener(this); y@0: highCutSlider_.setRange(0, 10, 1); highCutLabel_.attachToComponent(&highCutSlider_, false); highCutLabel_.setFont(Font (11.0f)); y@0: y@0: addAndMakeVisible(&indexSlider_); indexSlider_.setSliderStyle(Slider::Rotary); indexSlider_.addListener(this); y@0: indexSlider_.setRange(0.0, 5.0, 0.01); indexLabel_.attachToComponent(&indexSlider_, false); indexLabel_.setFont(Font (11.0f)); y@0: y@0: addAndMakeVisible(&gain1Slider_); gain1Slider_.setSliderStyle(Slider::Rotary); gain1Slider_.addListener(this); y@0: gain1Slider_.setRange(0.0, 5.0, 0.01); gain1Label_.attachToComponent(&gain1Slider_, false); gain1Label_.setFont(Font (11.0f)); y@0: addAndMakeVisible(&gain2Slider_); gain2Slider_.setSliderStyle(Slider::Rotary); gain2Slider_.addListener(this); y@0: gain2Slider_.setRange(0.0, 5.0, 0.01); gain2Label_.attachToComponent(&gain2Slider_, false); gain2Label_.setFont(Font (11.0f)); y@0: addAndMakeVisible(&gain3Slider_); gain3Slider_.setSliderStyle(Slider::Rotary); gain3Slider_.addListener(this); y@0: gain3Slider_.setRange(0.0, 5.0, 0.01); gain3Label_.attachToComponent(&gain3Slider_, false); gain3Label_.setFont(Font (11.0f)); y@0: addAndMakeVisible(&gain4Slider_); gain4Slider_.setSliderStyle(Slider::Rotary); gain4Slider_.addListener(this); y@0: gain4Slider_.setRange(0.0, 5.0, 0.01); gain4Label_.attachToComponent(&gain4Slider_, false); gain4Label_.setFont(Font (11.0f)); y@0: addAndMakeVisible(&gain5Slider_); gain5Slider_.setSliderStyle(Slider::Rotary); gain5Slider_.addListener(this); y@0: gain5Slider_.setRange(0.0, 5.0, 0.01); gain5Label_.attachToComponent(&gain5Slider_, false); gain5Label_.setFont(Font (11.0f)); y@0: addAndMakeVisible(&gain6Slider_); gain6Slider_.setSliderStyle(Slider::Rotary); gain6Slider_.addListener(this); y@0: gain6Slider_.setRange(0.0, 5.0, 0.01); gain6Label_.attachToComponent(&gain6Slider_, false); gain6Label_.setFont(Font (11.0f)); y@0: addAndMakeVisible(&gain7Slider_); gain7Slider_.setSliderStyle(Slider::Rotary); gain7Slider_.addListener(this); y@0: gain7Slider_.setRange(0.0, 5.0, 0.01); gain7Label_.attachToComponent(&gain7Slider_, false); gain7Label_.setFont(Font (11.0f)); y@0: addAndMakeVisible(&gain8Slider_); gain8Slider_.setSliderStyle(Slider::Rotary); gain8Slider_.addListener(this); y@0: gain8Slider_.setRange(0.0, 5.0, 0.01); gain8Label_.attachToComponent(&gain8Slider_, false); gain8Label_.setFont(Font (11.0f)); y@0: addAndMakeVisible(&gain9Slider_); gain9Slider_.setSliderStyle(Slider::Rotary); gain9Slider_.addListener(this); y@0: gain9Slider_.setRange(0.0, 5.0, 0.01); gain9Label_.attachToComponent(&gain9Slider_, false); gain9Label_.setFont(Font (11.0f)); y@0: y@0: y@0: addAndMakeVisible(&mixSlider_); mixSlider_.setSliderStyle(Slider::Rotary); mixSlider_.addListener(this); y@0: mixSlider_.setRange(0.0, 1.0, 0.001); mixLabel_.attachToComponent(&mixSlider_, false); mixLabel_.setFont(Font (11.0f)); y@0: y@0: addAndMakeVisible(&gainTreSlider_); gainTreSlider_.setSliderStyle(Slider::Rotary); gainTreSlider_.addListener(this); y@0: gainTreSlider_.setRange(0.0, 1.0, 0.001); gainTreLabel_.attachToComponent(&gainTreSlider_, false); gainTreLabel_.setFont(Font (11.0f)); y@0: addAndMakeVisible(&gainMidSlider_); gainMidSlider_.setSliderStyle(Slider::Rotary); gainMidSlider_.addListener(this); y@0: gainMidSlider_.setRange(0.0, 1.0, 0.001); gainMidLabel_.attachToComponent(&gainMidSlider_, false); gainMidLabel_.setFont(Font (11.0f)); y@0: addAndMakeVisible(&gainLowSlider_); gainLowSlider_.setSliderStyle(Slider::Rotary); gainLowSlider_.addListener(this); y@0: gainLowSlider_.setRange(0.0, 1.0, 0.001); gainLowLabel_.attachToComponent(&gainLowSlider_, false); gainLowLabel_.setFont(Font (11.0f)); y@0: y@0: addAndMakeVisible(&gainSlider_); gainSlider_.setSliderStyle(Slider::Rotary); gainSlider_.addListener(this); y@0: gainSlider_.setRange(0.0, 10.0, 0.001); gainLabel_.attachToComponent(&gainSlider_, false); gainLabel_.setFont(Font (11.0f)); y@0: y@0: // add the triangular resizer component for the bottom-right of the UI y@0: addAndMakeVisible(resizer_ = new ResizableCornerComponent (this, &resizeLimits_)); y@0: resizeLimits_.setSizeLimits(300, 200, 800, 600); y@0: y@0: // set our component's initial size to be the last one that was stored in the filter's settings y@0: setSize(ownerFilter->lastUIWidth_, y@0: ownerFilter->lastUIHeight_); y@0: y@0: startTimer(50); y@0: } y@0: y@0: BassPedalRackProcessorEditor::~BassPedalRackProcessorEditor() y@0: { y@0: } y@0: y@0: //============================================================================== y@0: void BassPedalRackProcessorEditor::paint (Graphics& g) y@0: { y@0: g.fillAll (Colours::grey); y@0: } y@0: y@0: void BassPedalRackProcessorEditor::resized() y@0: { y@0: y@0: lowCutSlider_.setBounds(20, 20, 150, 40); y@0: highCutSlider_.setBounds(200, 20, 150, 40); y@0: mixSlider_.setBounds(380, 20, 150, 40); y@0: y@0: indexSlider_.setBounds(200, 75, 150, 40); y@0: gain1Slider_.setBounds(380, 75, 150, 40); y@0: gain2Slider_.setBounds(200, 130, 150, 40); y@0: gain3Slider_.setBounds(380, 130, 150, 40); y@0: gain4Slider_.setBounds(200, 185, 150, 40); y@0: gain5Slider_.setBounds(380, 185, 150, 40); y@0: gain6Slider_.setBounds(200, 240, 150, 40); y@0: gain7Slider_.setBounds(380, 240, 150, 40); y@0: gain8Slider_.setBounds(200, 295, 150, 40); y@0: gain9Slider_.setBounds(380, 295, 150, 40); y@0: y@0: y@0: y@0: y@0: gainTreSlider_.setBounds(20,185,150, 40); y@0: gainMidSlider_.setBounds(20,240,150, 40); y@0: gainLowSlider_.setBounds(20,295,150, 40); y@0: y@0: gainSlider_.setBounds(20, 75, 150, 40); y@0: y@0: resizer_->setBounds(getWidth() - 16, getHeight() - 16, 16, 16); y@0: y@0: getProcessor()->lastUIWidth_ = getWidth(); y@0: getProcessor()->lastUIHeight_ = getHeight(); y@0: } y@0: y@0: //============================================================================== y@0: // This timer periodically checks whether any of the filter's parameters have changed... y@0: void BassPedalRackProcessorEditor::timerCallback() y@0: { y@0: BassPedalRackProcessor* ourProcessor = getProcessor(); y@0: y@0: mixSlider_.setValue(ourProcessor->mix_, dontSendNotification); y@0: indexSlider_.setValue(ourProcessor->index_, dontSendNotification); y@0: gainSlider_.setValue(ourProcessor->gain_, dontSendNotification); y@0: lowCutSlider_.setValue(ourProcessor->lowCut_, dontSendNotification); y@0: highCutSlider_.setValue(ourProcessor->highCut_, dontSendNotification); y@0: gainLowSlider_.setValue(ourProcessor->bassGain_, dontSendNotification); y@0: gainMidSlider_.setValue(ourProcessor->midGain_, dontSendNotification); y@0: gainTreSlider_.setValue(ourProcessor->trebleGain_, dontSendNotification); y@0: gain1Slider_.setValue(ourProcessor->gain1_, dontSendNotification); y@0: gain2Slider_.setValue(ourProcessor->gain2_, dontSendNotification); y@0: gain3Slider_.setValue(ourProcessor->gain3_, dontSendNotification); y@0: gain4Slider_.setValue(ourProcessor->gain4_, dontSendNotification); y@0: gain5Slider_.setValue(ourProcessor->gain5_, dontSendNotification); y@0: gain6Slider_.setValue(ourProcessor->gain6_, dontSendNotification); y@0: gain7Slider_.setValue(ourProcessor->gain7_, dontSendNotification); y@0: gain8Slider_.setValue(ourProcessor->gain8_, dontSendNotification); y@0: gain9Slider_.setValue(ourProcessor->gain9_, dontSendNotification); y@0: } y@0: y@0: // This is our Slider::Listener callback, when the user drags a slider. y@0: void BassPedalRackProcessorEditor::sliderValueChanged (Slider* slider) y@0: { y@0: if (slider == &mixSlider_){ y@0: // It's vital to use setParameterNotifyingHost to change any parameters that are automatable y@0: // by the host, rather than just modifying them directly, otherwise the host won't know y@0: // that they've changed. y@0: getProcessor()->setParameterNotifyingHost (BassPedalRackProcessor::kMixParam,(float)mixSlider_.getValue());} y@0: if (slider == &lowCutSlider_){ y@0: getProcessor()->setParameterNotifyingHost (BassPedalRackProcessor::kLowCutParam,(float)lowCutSlider_.getValue());} y@0: if (slider == &highCutSlider_){ y@0: getProcessor()->setParameterNotifyingHost (BassPedalRackProcessor::kHighCutParam,(float)highCutSlider_.getValue());} y@0: if (slider == &indexSlider_){ y@0: getProcessor()->setParameterNotifyingHost (BassPedalRackProcessor::kIndexParam,(float)indexSlider_.getValue());} y@0: if (slider == &gainSlider_){ y@0: getProcessor()->setParameterNotifyingHost (BassPedalRackProcessor::kGainParam,(float)gainSlider_.getValue());} y@0: if (slider == &gainMidSlider_){ y@0: getProcessor()->setParameterNotifyingHost (BassPedalRackProcessor::kGainMidParam,(float)gainMidSlider_.getValue());} y@0: if (slider == &gainLowSlider_){ y@0: getProcessor()->setParameterNotifyingHost (BassPedalRackProcessor::kGainLowParam,(float)gainLowSlider_.getValue());} y@0: if (slider == &gainTreSlider_){ y@0: getProcessor()->setParameterNotifyingHost (BassPedalRackProcessor::kGainTreParam,(float)gainTreSlider_.getValue());} y@0: if (slider == &gain1Slider_){ y@0: getProcessor()->setParameterNotifyingHost (BassPedalRackProcessor::kGain1Param,(float)gain1Slider_.getValue());} y@0: if (slider == &gain2Slider_){ y@0: getProcessor()->setParameterNotifyingHost (BassPedalRackProcessor::kGain2Param,(float)gain2Slider_.getValue());} y@0: if (slider == &gain3Slider_){ y@0: getProcessor()->setParameterNotifyingHost (BassPedalRackProcessor::kGain3Param,(float)gain3Slider_.getValue());} y@0: if (slider == &gain4Slider_){ y@0: getProcessor()->setParameterNotifyingHost (BassPedalRackProcessor::kGain4Param,(float)gain4Slider_.getValue());} y@0: if (slider == &gain5Slider_){ y@0: getProcessor()->setParameterNotifyingHost (BassPedalRackProcessor::kGain5Param,(float)gain5Slider_.getValue());} y@0: if (slider == &gain6Slider_){ y@0: getProcessor()->setParameterNotifyingHost (BassPedalRackProcessor::kGain6Param,(float)gain6Slider_.getValue());} y@0: if (slider == &gain7Slider_){ y@0: getProcessor()->setParameterNotifyingHost (BassPedalRackProcessor::kGain7Param,(float)gain7Slider_.getValue());} y@0: if (slider == &gain8Slider_){ y@0: getProcessor()->setParameterNotifyingHost (BassPedalRackProcessor::kGain8Param,(float)gain8Slider_.getValue());} y@0: if (slider == &gain9Slider_){ y@0: getProcessor()->setParameterNotifyingHost (BassPedalRackProcessor::kGain9Param,(float)gain9Slider_.getValue());} y@0: }