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