fsh::stk
fantastic spatial holophonic synthesis toolkit
Loading...
Searching...
No Matches
OptionPicker.h
1/***************************************************************************************************
2 ██████ █████ █████ █████
3 ███░░███ ░░███ ░░███ ░░███
4 ░███ ░░░ █████ ░███████ ██ ██ █████ ███████ ░███ █████
5 ███████ ███░░ ░███░░███ ░░ ░░ ███░░ ░░░███░ ░███░░███
6 ░░░███░ ░░█████ ░███ ░███ ░░█████ ░███ ░██████░
7 ░███ ░░░░███ ░███ ░███ ░░░░███ ░███ ███ ░███░░███
8 █████ ██████ ████ █████ ██ ██ ██████ ░░█████ ████ █████
9 ░░░░░ ░░░░░░ ░░░░ ░░░░░ ░░ ░░ ░░░░░░ ░░░░░ ░░░░ ░░░░░
10
11 fantastic spatial holophonic synthesis tool kit
12
13 copyright (c) fabian hummel
14 www.github.com/fshstk
15 www.fshstk.com
16
17 this file is part of the fantastic spatial holophonic synthesis toolkit (fsh::stk)
18 fsh::stk is free software: it is provided under the terms of the gnu general public license v3.0
19 www.gnu.org/licenses/gpl-3.0
20***************************************************************************************************/
21
22#pragma once
23#include "OptionButton.h"
24#include <cstddef>
25#include <juce_audio_processors/juce_audio_processors.h>
26#include <juce_gui_basics/juce_gui_basics.h>
27#include <spdlog/spdlog.h>
28
29namespace fsh::gui
30{
35 : public juce::Component
36 , public juce::AudioProcessorParameter::Listener
37{
38public:
40 struct Params
41 {
42 juce::AudioParameterChoice* choice;
43 juce::Colour color;
44 juce::Colour highlightColor;
45 };
46
48 explicit OptionPicker(const Params&);
49
51 ~OptionPicker() override;
52
53private:
54 OptionPicker(const OptionPicker&) = delete;
55 OptionPicker& operator=(const OptionPicker&) = delete;
56 OptionPicker(OptionPicker&&) = delete;
57 OptionPicker& operator=(OptionPicker&&) = delete;
58
59 void parameterValueChanged(int, float) override { repaint(); }
60 void parameterGestureChanged(int, bool) override { repaint(); }
61 auto getSelectedIndex() const -> size_t;
62 void buttonClicked(size_t i);
63 void paint(juce::Graphics&) override;
64 void resized() override;
65
66 Params _params;
67 std::vector<std::unique_ptr<OptionButton>> _options;
68};
69} // namespace fsh::gui
Class for displaying a list of options as buttons.
Definition OptionPicker.h:37
~OptionPicker() override
Destructor.
Definition OptionPicker.cpp:54
OptionPicker(const Params &)
Constructor.
Definition OptionPicker.cpp:27
Parameters for the OptionPicker.
Definition OptionPicker.h:41
juce::AudioParameterChoice * choice
The parameter to be controlled.
Definition OptionPicker.h:42
juce::Colour highlightColor
The color of the selected button.
Definition OptionPicker.h:44
juce::Colour color
The color of the buttons.
Definition OptionPicker.h:43