rotaryStyle.h (851B)
1 #pragma once 2 3 #include "uiObjectStyle.h" 4 5 namespace genericUI 6 { 7 class RotaryStyle : public UiObjectStyle 8 { 9 public: 10 enum class Style 11 { 12 Rotary, 13 LinearVertical, 14 LinearHorizontal 15 }; 16 17 explicit RotaryStyle(Editor& _editor) : UiObjectStyle(_editor) {} 18 19 void apply(Editor& _editor, const UiObject& _object) override; 20 21 Style getStyle() const { return m_style; } 22 23 private: 24 void drawRotarySlider(juce::Graphics&, int x, int y, int width, int height, float sliderPosProportional, float rotaryStartAngle, float rotaryEndAngle, juce::Slider&) override; 25 void drawLinearSlider(juce::Graphics&, int x, int y, int width, int height, float sliderPos, float minSliderPos, float maxSliderPos, const juce::Slider::SliderStyle, juce::Slider&) override; 26 int getSliderThumbRadius(juce::Slider&) override; 27 28 Style m_style = Style::Rotary; 29 }; 30 }