| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187 |
- /*
- ==============================================================================
- 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 (Equalizer)
- this->equalizerLowGainSlider.setRange(0.0, 1.0);
- this->equalizerLowGainSlider.setTextBoxStyle(juce::Slider::TextBoxRight, false, 100, 20);
- this->equalizerLowGainSlider.addListener(this);
- this->equalizerLowGainLabel.setText("Equalizer Low Gain", juce::dontSendNotification);
- addAndMakeVisible(this->equalizerLowGainSlider);
- addAndMakeVisible(this->equalizerLowGainLabel);
- this->equalizerHighGainSlider.setRange(0.0, 1.0);
- this->equalizerHighGainSlider.setTextBoxStyle(juce::Slider::TextBoxRight, false, 100, 20);
- this->equalizerHighGainSlider.addListener(this);
- this->equalizerHighGainLabel.setText("Equalizer High Gain", juce::dontSendNotification);
- addAndMakeVisible(this->equalizerHighGainSlider);
- addAndMakeVisible(this->equalizerHighGainLabel);
- // Add aliders to the editor (Distortion)
- this->distortionDriveSlider.setRange(0.0, 1.0);
- this->distortionDriveSlider.setTextBoxStyle(juce::Slider::TextBoxRight, false, 100, 20);
- this->distortionDriveSlider.addListener(this);
- this->distortionDriveLabel.setText("Distortion Drive", juce::dontSendNotification);
- addAndMakeVisible(this->distortionDriveSlider);
- addAndMakeVisible(this->distortionDriveLabel);
- this->distortionMixSlider.setRange(0.0, 1.0);
- this->distortionMixSlider.setTextBoxStyle(juce::Slider::TextBoxRight, false, 100, 20);
- this->distortionMixSlider.addListener(this);
- this->distortionMixLabel.setText("Distortion Mix", juce::dontSendNotification);
- addAndMakeVisible(this->distortionMixSlider);
- addAndMakeVisible(this->distortionMixLabel);
- // 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);
- equalizerLowGainSlider.setBounds(130, 10, getWidth() - 130, 20);
- equalizerLowGainLabel.setBounds(10, 10, 100, 20);
- equalizerHighGainSlider.setBounds(130, 30, getWidth() - 130, 20);
- equalizerHighGainLabel.setBounds(10, 30, 100, 20);
- distortionDriveSlider.setBounds(130, 70, getWidth() - 130, 20);
- distortionDriveLabel.setBounds(10, 70, 100, 20);
- distortionMixSlider.setBounds(130, 90, getWidth() - 130, 20);
- distortionMixLabel.setBounds(10, 90, 100, 20);
- chorusDryWetSlider.setBounds(130, 130, getWidth() - 130, 20);
- chorusDryWetLabel.setBounds(10, 130, 100, 20);
- chorusAmountSlider.setBounds(130, 150, getWidth() - 130, 20);
- chorusAmountLabel.setBounds(10, 150, 100, 20);
- reverbDryWetSlider.setBounds(130, 190, getWidth() - 130, 20);
- reverbDryWetLabel.setBounds(10, 190, 100, 20);
- reverbRoomSizeSlider.setBounds(130, 210, getWidth() - 130, 20);
- reverbRoomSizeLabel.setBounds(10, 210, 100, 20);
- delayDryWetSlider.setBounds(130, 250, getWidth() - 130, 20);
- delayDryWetLabel.setBounds(10, 250, 100, 20);
- delayAmountSlider.setBounds(130, 270, getWidth() - 130, 20);
- delayAmountLabel.setBounds(10, 270, 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());
- }
- else if (slider == &this->equalizerLowGainSlider)
- {
- this->audioProcessor.setEqLowGain(slider->getValue());
- }
- else if (slider == &this->equalizerHighGainSlider)
- {
- this->audioProcessor.setEqHighGain(slider->getValue());
- }
- else if (slider == &this->distortionDriveSlider)
- {
- this->audioProcessor.setDistortionDrive(slider->getValue());
- }
- else if (slider == &this->distortionMixSlider)
- {
- this->audioProcessor.setDistortionMix(slider->getValue());
- }
- }
|