2023-07-02 17:47:04 +00:00
|
|
|
#pragma once
|
|
|
|
#include <JuceHeader.h>
|
|
|
|
#include "../PluginProcessor.h"
|
|
|
|
#include "../audio/Effect.h"
|
2023-07-17 13:37:36 +00:00
|
|
|
#include "LabelledTextBox.h"
|
2024-01-01 15:09:46 +00:00
|
|
|
#include "SvgButton.h"
|
2023-07-02 17:47:04 +00:00
|
|
|
|
2023-12-12 22:54:36 +00:00
|
|
|
class EffectComponent : public juce::Component, public juce::AudioProcessorParameter::Listener, juce::AsyncUpdater, public juce::SettableTooltipClient {
|
2023-07-02 17:47:04 +00:00
|
|
|
public:
|
2023-07-21 10:08:55 +00:00
|
|
|
EffectComponent(OscirenderAudioProcessor& p, Effect& effect, int index);
|
|
|
|
EffectComponent(OscirenderAudioProcessor& p, Effect& effect);
|
2023-07-02 17:47:04 +00:00
|
|
|
~EffectComponent();
|
|
|
|
|
|
|
|
void resized() override;
|
|
|
|
void paint(juce::Graphics& g) override;
|
2023-07-17 13:37:36 +00:00
|
|
|
void mouseDown(const juce::MouseEvent& event) override;
|
2023-07-18 17:28:09 +00:00
|
|
|
void parameterValueChanged(int parameterIndex, float newValue) override;
|
|
|
|
void parameterGestureChanged(int parameterIndex, bool gestureIsStarting) override;
|
|
|
|
void handleAsyncUpdate() override;
|
2023-07-02 17:47:04 +00:00
|
|
|
|
2023-07-05 17:17:11 +00:00
|
|
|
void setComponent(std::shared_ptr<juce::Component> component);
|
2024-01-07 19:48:02 +00:00
|
|
|
void setSliderOnValueChange();
|
2023-07-02 17:47:04 +00:00
|
|
|
|
|
|
|
juce::Slider slider;
|
2023-07-21 10:41:01 +00:00
|
|
|
juce::Slider lfoSlider;
|
2023-07-17 13:37:36 +00:00
|
|
|
Effect& effect;
|
2024-01-01 15:09:46 +00:00
|
|
|
int index = 0;
|
2023-07-20 16:24:34 +00:00
|
|
|
juce::ComboBox lfo;
|
2023-07-02 17:47:04 +00:00
|
|
|
|
|
|
|
private:
|
2024-01-01 15:09:46 +00:00
|
|
|
const int TEXT_BOX_WIDTH = 70;
|
|
|
|
const int SMALL_TEXT_BOX_WIDTH = 50;
|
|
|
|
|
|
|
|
const int TEXT_WIDTH = 120;
|
|
|
|
const int SMALL_TEXT_WIDTH = 60;
|
|
|
|
|
2023-07-18 17:28:09 +00:00
|
|
|
void setupComponent();
|
2023-07-21 10:08:55 +00:00
|
|
|
bool lfoEnabled = true;
|
2024-01-01 16:21:10 +00:00
|
|
|
bool sidechainEnabled = true;
|
2023-07-05 17:17:11 +00:00
|
|
|
std::shared_ptr<juce::Component> component;
|
2023-07-21 10:08:55 +00:00
|
|
|
OscirenderAudioProcessor& audioProcessor;
|
2023-07-02 17:47:04 +00:00
|
|
|
|
2024-01-01 16:21:10 +00:00
|
|
|
std::unique_ptr<SvgButton> sidechainButton;
|
2024-01-01 15:09:46 +00:00
|
|
|
|
2023-07-17 13:37:36 +00:00
|
|
|
juce::Label popupLabel;
|
2023-12-17 21:32:56 +00:00
|
|
|
juce::Label label;
|
2023-07-17 13:37:36 +00:00
|
|
|
LabelledTextBox min{"Min"};
|
|
|
|
LabelledTextBox max{"Max"};
|
|
|
|
|
2023-07-02 17:47:04 +00:00
|
|
|
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(EffectComponent)
|
|
|
|
};
|