|
@@ -0,0 +1,127 @@
|
|
|
|
|
+/*
|
|
|
|
|
+ ==============================================================================
|
|
|
|
|
+
|
|
|
|
|
+ This file contains the basic framework code for a JUCE plugin editor.
|
|
|
|
|
+
|
|
|
|
|
+ ==============================================================================
|
|
|
|
|
+*/
|
|
|
|
|
+
|
|
|
|
|
+#include "PluginProcessor.h"
|
|
|
|
|
+#include "PluginEditor.h"
|
|
|
|
|
+
|
|
|
|
|
+//==============================================================================
|
|
|
|
|
+CMLSProjectAudioProcessorEditor::CMLSProjectAudioProcessorEditor (CMLSProjectAudioProcessor& p)
|
|
|
|
|
+ : AudioProcessorEditor (&p), audioProcessor (p)
|
|
|
|
|
+{
|
|
|
|
|
+ // Make sure that before the constructor has finished, you've set the
|
|
|
|
|
+ // editor's size to whatever you need it to be.
|
|
|
|
|
+ setSize (400, 300);
|
|
|
|
|
+
|
|
|
|
|
+ // Add aliders to the editor (Chorus)
|
|
|
|
|
+ this->chorusDryWetSlider.setRange(0.0, 1.0);
|
|
|
|
|
+ this->chorusDryWetSlider.setTextBoxStyle(juce::Slider::TextBoxRight, false, 100, 20);
|
|
|
|
|
+ this->chorusDryWetSlider.addListener(this);
|
|
|
|
|
+ this->chorusDryWetLabel.setText("Chorus Dry/Wet", juce::dontSendNotification);
|
|
|
|
|
+
|
|
|
|
|
+ addAndMakeVisible(this->chorusDryWetSlider);
|
|
|
|
|
+ addAndMakeVisible(this->chorusDryWetLabel);
|
|
|
|
|
+
|
|
|
|
|
+ this->chorusAmountSlider.setRange(0.0, 1.0);
|
|
|
|
|
+ this->chorusAmountSlider.setTextBoxStyle(juce::Slider::TextBoxRight, false, 100, 20);
|
|
|
|
|
+ this->chorusAmountSlider.addListener(this);
|
|
|
|
|
+ this->chorusAmountLabel.setText("Chorus Amount", juce::dontSendNotification);
|
|
|
|
|
+
|
|
|
|
|
+ addAndMakeVisible(this->chorusAmountSlider);
|
|
|
|
|
+ addAndMakeVisible(this->chorusAmountLabel);
|
|
|
|
|
+
|
|
|
|
|
+ // Add sliders to the editor (Reverb)
|
|
|
|
|
+ this->reverbDryWetSlider.setRange(0.0, 1.0);
|
|
|
|
|
+ this->reverbDryWetSlider.setTextBoxStyle(juce::Slider::TextBoxRight, false, 100, 20);
|
|
|
|
|
+ this->reverbDryWetSlider.addListener(this);
|
|
|
|
|
+ this->reverbDryWetLabel.setText("Reverb Dry/Wet", juce::dontSendNotification);
|
|
|
|
|
+
|
|
|
|
|
+ addAndMakeVisible(this->reverbDryWetSlider);
|
|
|
|
|
+ addAndMakeVisible(this->reverbDryWetLabel);
|
|
|
|
|
+
|
|
|
|
|
+ this->reverbRoomSizeSlider.setRange(0.0, 1.0);
|
|
|
|
|
+ this->reverbRoomSizeSlider.setTextBoxStyle(juce::Slider::TextBoxRight, false, 100, 20);
|
|
|
|
|
+ this->reverbRoomSizeSlider.addListener(this);
|
|
|
|
|
+ this->reverbRoomSizeLabel.setText("Reverb Room Size", juce::dontSendNotification);
|
|
|
|
|
+
|
|
|
|
|
+ addAndMakeVisible(this->reverbRoomSizeSlider);
|
|
|
|
|
+ addAndMakeVisible(this->reverbRoomSizeLabel);
|
|
|
|
|
+
|
|
|
|
|
+ // Add sliders to the editor (Delay)
|
|
|
|
|
+ this->delayDryWetSlider.setRange(0.0, 1.0);
|
|
|
|
|
+ this->delayDryWetSlider.setTextBoxStyle(juce::Slider::TextBoxRight, false, 100, 20);
|
|
|
|
|
+ this->delayDryWetSlider.addListener(this);
|
|
|
|
|
+ this->delayDryWetLabel.setText("Delay Dry/Wet", juce::dontSendNotification);
|
|
|
|
|
+
|
|
|
|
|
+ addAndMakeVisible(this->delayDryWetSlider);
|
|
|
|
|
+ addAndMakeVisible(this->delayDryWetLabel);
|
|
|
|
|
+
|
|
|
|
|
+ this->delayAmountSlider.setRange(0.0, 1.0);
|
|
|
|
|
+ this->delayAmountSlider.setTextBoxStyle(juce::Slider::TextBoxRight, false, 100, 20);
|
|
|
|
|
+ this->delayAmountSlider.addListener(this);
|
|
|
|
|
+ this->delayAmountLabel.setText("Delay Amount", juce::dontSendNotification);
|
|
|
|
|
+
|
|
|
|
|
+ addAndMakeVisible(this->delayAmountSlider);
|
|
|
|
|
+ addAndMakeVisible(this->delayAmountLabel);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+CMLSProjectAudioProcessorEditor::~CMLSProjectAudioProcessorEditor()
|
|
|
|
|
+{
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+//==============================================================================
|
|
|
|
|
+void CMLSProjectAudioProcessorEditor::paint (juce::Graphics& g)
|
|
|
|
|
+{
|
|
|
|
|
+ // (Our component is opaque, so we must completely fill the background with a solid colour)
|
|
|
|
|
+ g.fillAll (getLookAndFeel().findColour (juce::ResizableWindow::backgroundColourId));
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+void CMLSProjectAudioProcessorEditor::resized()
|
|
|
|
|
+{
|
|
|
|
|
+ //titleLabel.setBounds(10, 10, getWidth() - 20, 20);
|
|
|
|
|
+ chorusDryWetSlider.setBounds(130, 10, getWidth() - 130, 20);
|
|
|
|
|
+ chorusDryWetLabel.setBounds(10, 10, 100, 20);
|
|
|
|
|
+ chorusAmountSlider.setBounds(130, 30, getWidth() - 130, 20);
|
|
|
|
|
+ chorusAmountLabel.setBounds(10, 30, 100, 20);
|
|
|
|
|
+
|
|
|
|
|
+ reverbDryWetSlider.setBounds(130, 70, getWidth() - 130, 20);
|
|
|
|
|
+ reverbDryWetLabel.setBounds(10, 70, 100, 20);
|
|
|
|
|
+ reverbRoomSizeSlider.setBounds(130, 90, getWidth() - 130, 20);
|
|
|
|
|
+ reverbRoomSizeLabel.setBounds(10, 90, 100, 20);
|
|
|
|
|
+
|
|
|
|
|
+ delayDryWetSlider.setBounds(130, 130, getWidth() - 130, 20);
|
|
|
|
|
+ delayDryWetLabel.setBounds(10, 130, 100, 20);
|
|
|
|
|
+ delayAmountSlider.setBounds(130, 150, getWidth() - 130, 20);
|
|
|
|
|
+ delayAmountLabel.setBounds(10, 150, 100, 20);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+void CMLSProjectAudioProcessorEditor::sliderValueChanged(juce::Slider* slider){
|
|
|
|
|
+ if (slider == &this->chorusDryWetSlider)
|
|
|
|
|
+ {
|
|
|
|
|
+ this->audioProcessor.setChorusDryWet(slider->getValue());
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (slider == &this->chorusAmountSlider)
|
|
|
|
|
+ {
|
|
|
|
|
+ this->audioProcessor.setChorusAmount(slider->getValue());
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (slider == &this->reverbDryWetSlider)
|
|
|
|
|
+ {
|
|
|
|
|
+ this->audioProcessor.setReverbDryWet(slider->getValue());
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (slider == &this->reverbRoomSizeSlider)
|
|
|
|
|
+ {
|
|
|
|
|
+ this->audioProcessor.setReverbRoomSize(slider->getValue());
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (slider == &this->delayDryWetSlider)
|
|
|
|
|
+ {
|
|
|
|
|
+ this->audioProcessor.setDelayDryWet(slider->getValue());
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (slider == &this->delayAmountSlider)
|
|
|
|
|
+ {
|
|
|
|
|
+ this->audioProcessor.setDelayAmount(slider->getValue());
|
|
|
|
|
+ }
|
|
|
|
|
+}
|