Mema
Memory Matrix — multi-channel audio matrix monitor and router
Loading...
Searching...
No Matches
FaderbankControlComponent.h
Go to the documentation of this file.
1/* Copyright (c) 2025, 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
25
30{
31 class ToggleStateSlider;
32}
33
34namespace Mema
35{
36
37
45{
46public:
49
50 //==============================================================================
51 void paint(Graphics&) override;
52 void resized() override;
53 void lookAndFeelChanged() override;
54
55 //==============================================================================
56 void resetCtrl() override;
57
58 //==============================================================================
59 void setControlsSize(const ControlsSize& ctrlsSize) override;
60
61 //==============================================================================
62 void setIOCount(const std::pair<int, int>& ioCount) override;
63 void setInputMuteStates(const std::map<std::uint16_t, bool>& inputMuteStates) override;
64 void setOutputMuteStates(const std::map<std::uint16_t, bool>& outputMuteStates) override;
65 void setCrosspointStates(const std::map<std::uint16_t, std::map<std::uint16_t, bool>>& crosspointStates) override;
66 void setCrosspointValues(const std::map<std::uint16_t, std::map<std::uint16_t, float>>& crosspointValues) override;
67
68protected:
69 //==============================================================================
70 void selectIOChannel(const ControlDirection& direction, int channel);
71 void rebuildControls(bool force = false);
72 void rebuildInputControls(bool force = false);
73 void rebuildOutputControls(bool force = false);
74 void rebuildCrosspointControls(bool force = false);
76
77private:
78 //==============================================================================
79 std::unique_ptr<juce::Viewport> m_horizontalScrollViewport;
80 std::unique_ptr<juce::Component> m_horizontalScrollContainerComponent;
81 std::unique_ptr<juce::Viewport> m_verticalScrollViewport;
82 std::unique_ptr<juce::Component> m_verticalScrollContainerComponent;
83 std::unique_ptr<juce::Viewport> m_hvScrollViewport;
84 std::unique_ptr<juce::Component> m_hvScrollContainerComponent;
85
86 std::unique_ptr<juce::Grid> m_inputControlsGrid;
87 std::vector<std::unique_ptr<juce::TextButton>> m_inputSelectButtons;
88 std::vector<std::unique_ptr<juce::TextButton>> m_inputMuteButtons;
89
90 std::unique_ptr<juce::Grid> m_outputControlsGrid;
91 std::vector<std::unique_ptr<juce::TextButton>> m_outputSelectButtons;
92 std::vector<std::unique_ptr<juce::TextButton>> m_outputMuteButtons;
93
94 std::unique_ptr<juce::Grid> m_crosspointsControlsGrid;
95 std::vector<std::unique_ptr<JUCEAppBasics::ToggleStateSlider>> m_crosspointGainSliders;
96
97 std::pair<ControlDirection, int> m_currentIOChannel = { ControlDirection::None, 0 };
98
99 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(FaderbankControlComponent)
100};
101
102
103}; // namespace Mema
Fader-bank remote control — presents input×output crosspoint sliders and mute buttons.
void setIOCount(const std::pair< int, int > &ioCount) override
void setInputMuteStates(const std::map< std::uint16_t, bool > &inputMuteStates) override
void selectIOChannel(const ControlDirection &direction, int channel)
void setOutputMuteStates(const std::map< std::uint16_t, bool > &outputMuteStates) override
void setCrosspointValues(const std::map< std::uint16_t, std::map< std::uint16_t, float > > &crosspointValues) override
void setControlsSize(const ControlsSize &ctrlsSize) override
void setCrosspointStates(const std::map< std::uint16_t, std::map< std::uint16_t, bool > > &crosspointStates) override
Abstract base for all Mema.Re client control panels.
ControlDirection
Direction of a control strip within the panel layout.
ControlsSize
Size category for rendered control elements.
Definition Mema.cpp:27