Mema
Memory Matrix — multi-channel audio matrix monitor and router
Loading...
Searching...
No Matches
PanningControlComponent.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
29namespace JUCEAppBasics
30{
31 class ToggleStateSlider;
32}
33namespace Mema
34{
35
36
37class ADMOSController;
38class InputPositionMapper;
39class TwoDFieldMultisliderComponent;
40
41
50{
51public:
54
55 //==============================================================================
56 void paint(Graphics&) override;
57 void resized() override;
58 void lookAndFeelChanged() override;
59
60 //==============================================================================
61 void resetCtrl() override;
62
63 //==============================================================================
64 void setControlsSize(const ControlsSize& ctrlsSize) override;
65
66 //==============================================================================
67 void setIOCount(const std::pair<int, int>& ioCount) override;
68 void setInputMuteStates(const std::map<std::uint16_t, bool>& inputMuteStates) override;
69 void setCrosspointStates(const std::map<std::uint16_t, std::map<std::uint16_t, bool>>& crosspointStates) override;
70 void setCrosspointValues(const std::map<std::uint16_t, std::map<std::uint16_t, float>>& crosspointValues) override;
71
72 //==============================================================================
73 void setChannelConfig(const juce::AudioChannelSet& channelConfiguration);
74 const juce::AudioChannelSet& getChannelConfig();
75
76 void setExternalControlSettings(int ADMOSCPort, const juce::IPAddress& ADMOSCControllerIP, int ADMOSCControllerPort);
77
78 void handleExternalControlParameter(int objNum, std::uint16_t objType, void* sender = nullptr);
79
80protected:
81 //==============================================================================
82 void changeInputPosition(std::uint16_t channel, std::optional<float> xValOpt, std::optional<float> yValOpt, std::optional<float> sharpnessOpt, std::optional<int> layerOpt, juce::NotificationType notification = juce::dontSendNotification);
83 void processOutputDistances(std::uint16_t channel, const std::map<juce::AudioChannelSet::ChannelType, float>& channelToOutputsDists);
84 void selectInputChannel(std::uint16_t channel);
85 void rebuildControls(bool force = false);
86 void rebuildInputControls(bool force = false);
87
88private:
89 //==============================================================================
90 std::unique_ptr<juce::Viewport> m_horizontalScrollViewport;
91 std::unique_ptr<juce::Component> m_horizontalScrollContainerComponent;
92
93 std::unique_ptr<juce::Grid> m_inputControlsGrid;
94 std::vector<std::unique_ptr<juce::TextButton>> m_inputSelectButtons;
95 std::vector<std::unique_ptr<juce::TextButton>> m_inputMuteButtons;
96 std::unique_ptr<ADMOSController> m_admOsController;
97 std::unique_ptr<InputPositionMapper> m_positionMapper;
98 std::unique_ptr<TwoDFieldMultisliderComponent> m_multiSlider;
99
100 juce::AudioChannelSet m_channelConfiguration;
101
102 std::uint16_t m_currentInputChannel = 0;
103
104 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(PanningControlComponent)
105};
106
107
108}; // namespace Mema
Abstract base for all Mema.Re client control panels.
ControlsSize
Size category for rendered control elements.
2-D spatial panning remote control for Mema.Re.
void handleExternalControlParameter(int objNum, std::uint16_t objType, void *sender=nullptr)
void setChannelConfig(const juce::AudioChannelSet &channelConfiguration)
void processOutputDistances(std::uint16_t channel, const std::map< juce::AudioChannelSet::ChannelType, float > &channelToOutputsDists)
void changeInputPosition(std::uint16_t channel, std::optional< float > xValOpt, std::optional< float > yValOpt, std::optional< float > sharpnessOpt, std::optional< int > layerOpt, juce::NotificationType notification=juce::dontSendNotification)
void setIOCount(const std::pair< int, int > &ioCount) override
void selectInputChannel(std::uint16_t channel)
void setCrosspointStates(const std::map< std::uint16_t, std::map< std::uint16_t, bool > > &crosspointStates) override
void setExternalControlSettings(int ADMOSCPort, const juce::IPAddress &ADMOSCControllerIP, int ADMOSCControllerPort)
void setCrosspointValues(const std::map< std::uint16_t, std::map< std::uint16_t, float > > &crosspointValues) override
void setControlsSize(const ControlsSize &ctrlsSize) override
void setInputMuteStates(const std::map< std::uint16_t, bool > &inputMuteStates) override
const juce::AudioChannelSet & getChannelConfig()
Definition Mema.cpp:27