juicysfplugin/Source/SlidersComponent.h
2021-09-07 14:05:56 +08:00

59 lines
1.5 KiB
C++

# pragma once
#include <JuceHeader.h>
#include "FluidSynthModel.h"
using namespace std;
using SliderAttachment = AudioProcessorValueTreeState::SliderAttachment;
class SlidersComponent : public Component
{
public:
SlidersComponent(
AudioProcessorValueTreeState& valueTreeState,
FluidSynthModel& fluidSynthModel);
~SlidersComponent();
void resized() override;
const int getDesiredWidth();
void acceptMidiControlEvent(int controller, int value);
private:
std::function<void()> makeSliderListener(Slider& slider, int controller);
AudioProcessorValueTreeState& valueTreeState;
FluidSynthModel& fluidSynthModel;
GroupComponent envelopeGroup;
Slider attackSlider;
Label attackLabel;
unique_ptr<SliderAttachment> attackSliderAttachment;
Slider decaySlider;
Label decayLabel;
unique_ptr<SliderAttachment> decaySliderAttachment;
Slider sustainSlider;
Label sustainLabel;
unique_ptr<SliderAttachment> sustainSliderAttachment;
Slider releaseSlider;
Label releaseLabel;
unique_ptr<SliderAttachment> releaseSliderAttachment;
GroupComponent filterGroup;
Slider filterCutOffSlider;
Label filterCutOffLabel;
unique_ptr<SliderAttachment> filterCutOffSliderAttachment;
Slider filterResonanceSlider;
Label filterResonanceLabel;
unique_ptr<SliderAttachment> filterResonanceSliderAttachment;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (SlidersComponent)
};