juicysfplugin/Source/SlidersComponent.h

59 lines
1.5 KiB
C
Raw Normal View History

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