Mema
Memory Matrix — multi-channel audio matrix monitor and router
Loading...
Searching...
No Matches
PluginControlComponent.h
Go to the documentation of this file.
1/* Copyright (c) 2026, Christian Ahrens
2 *
3 * This file is part of Mema <https://github.com/ChristianAhrens/Mema>
4 *
5 * This tool is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU Lesser General Public License version 3.0 as published
7 * by the Free Software Foundation.
8 *
9 * This tool is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12 * details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this tool; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18
19#pragma once
20
21#include <JuceHeader.h>
22
24
26
27
31namespace JUCEAppBasics
32{
33 class ToggleStateSlider;
34}
35
36namespace Mema
37{
38
39
42{
43public:
46
47 //==============================================================================
48 void paint(Graphics&) override;
49 void resized() override;
50 void lookAndFeelChanged() override;
51
52 //==============================================================================
53 void resetCtrl() override;
54
55 //==============================================================================
56 void setControlsSize(const ControlsSize& ctrlsSize) override;
57
58 //==============================================================================
59 const std::string& getPluginName();
60 void setPluginName(const std::string& pluginName);
61
62 const std::vector<Mema::PluginParameterInfo>& getParameterInfos();
63 void setParameterInfos(const std::vector<Mema::PluginParameterInfo>& parameterInfos);
64
65 void setParameterValue(std::uint16_t index, std::string id, float value);
66
67 //==============================================================================
68 std::function<void(std::uint16_t, std::string, float)> onPluginParameterValueChanged;
69
70protected:
71 //==============================================================================
72 void rebuildControls();
73 void rebuildLayout();
74
75private:
76 //==============================================================================
77 std::unique_ptr<juce::Grid> m_parameterControlsGrid;
78
79 std::unique_ptr<juce::Label> m_pluginNameLabel;
80 std::map<std::uint16_t, std::unique_ptr<juce::Label>> m_parameterNameLabels;
81 std::map<std::uint16_t, std::unique_ptr<juce::TextButton>> m_parameterValueButtons;
82 std::map<std::uint16_t, std::unique_ptr<JUCEAppBasics::ToggleStateSlider>> m_parameterValueSliders;
83 std::map<std::uint16_t, std::unique_ptr<juce::ComboBox>> m_parameterValueComboBoxes;
84
85 std::string m_pluginName;
86 std::vector<Mema::PluginParameterInfo> m_pluginParameterInfos;
87
88 juce::Rectangle<int> m_parameterBounds;
89
90 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(PluginControlComponent)
91};
92
93
94}; // namespace Mema
Abstract base for all Mema.Re client control panels.
ControlsSize
Size category for rendered control elements.
void setControlsSize(const ControlsSize &ctrlsSize) override
std::function< void(std::uint16_t, std::string, float)> onPluginParameterValueChanged
void setParameterInfos(const std::vector< Mema::PluginParameterInfo > &parameterInfos)
void setParameterValue(std::uint16_t index, std::string id, float value)
const std::vector< Mema::PluginParameterInfo > & getParameterInfos()
void setPluginName(const std::string &pluginName)
Definition Mema.cpp:27