Mema
Memory Matrix — multi-channel audio matrix monitor and router
Loading...
Searching...
No Matches
InputControlComponent.h
Go to the documentation of this file.
1/* Copyright (c) 2024, 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#include "../MemaProcessor/MemaCommanders.h"
25
26
27namespace Mema
28{
29
33class MeterbridgeComponent;
34
42 public MemaInputCommander,
43 public juce::TextButton::Listener
44{
45public:
48
49 //==============================================================================
50 void paint (Graphics&) override;
51 void resized() override;
52
53 //==============================================================================
55
56 //==============================================================================
57 virtual void processChanges() override;
58
59 //==============================================================================
60 void setInputMute(std::uint16_t channel, bool muteState, int userId = -1) override;
61
62 //==============================================================================
63 void buttonClicked(juce::Button*) override;
64
65 //==============================================================================
66 juce::Rectangle<int> getRequiredSize();
67 std::function<void()> onBoundsRequirementChange;
68
69 //==============================================================================
70 void setChannelCount(std::uint16_t channelCount) override;
71
72private:
73 //==============================================================================
74 ProcessorLevelData m_levelData;
75 std::unique_ptr<MeterbridgeComponent> m_inputLevels;
76 std::map<std::uint16_t, std::unique_ptr<TextButton>> m_inputMutes;
77 std::uint16_t m_channelCount = 0;
78
79 static constexpr int s_channelSize = 24;
80 static constexpr double s_channelGap = 1;
81
82 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (InputControlComponent)
83};
84
85}
Base class for all audio-data visualisation components in the Mema processor editor.
Base class for all data objects exchanged between the audio processor and its analyzers/visualisers.
Input-channel control strip — shows level meters and mute buttons for all input channels.
void processingDataChanged(AbstractProcessorData *data) override
void paint(Graphics &) override
void buttonClicked(juce::Button *) override
void setChannelCount(std::uint16_t channelCount) override
virtual void processChanges() override
Called on the message thread to update cached data before repainting.
void setInputMute(std::uint16_t channel, bool muteState, int userId=-1) override
std::function< void()> onBoundsRequirementChange
juce::Rectangle< int > getRequiredSize()
Definition Mema.cpp:27