Mema
Memory Matrix — multi-channel audio matrix monitor and router
Loading...
Searching...
No Matches
MemaMoComponent.h
Go to the documentation of this file.
1/* Copyright (c) 2024-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
23namespace Mema
24{
25 class ProcessorDataAnalyzer;
26 class MeterbridgeComponent;
27 class TwoDFieldOutputComponent;
28 class WaveformAudioComponent;
29 class SpectrumAudioComponent;
30}
31
56class MemaMoComponent : public juce::Component, juce::MessageListener
57{
58public:
66
67public:
69 ~MemaMoComponent() override;
70
74 void setOutputFieldVisuActive(const juce::AudioChannelSet& channelConfiguration);
79
81 std::optional<std::uint16_t> getNumVisibleChannels();
83 void setNumVisibleChannels(std::uint16_t count);
84
85 //==============================================================================
87 void resized() override;
89 void paint(juce::Graphics& g) override;
90
91 //==============================================================================
93 void handleMessage(const Message& message) override;
94
95 //==============================================================================
96 std::function<void()> onExitClick;
97
98private:
99 //==============================================================================
100 std::unique_ptr<Mema::ProcessorDataAnalyzer> m_inputDataAnalyzer;
101 std::unique_ptr<Mema::ProcessorDataAnalyzer> m_outputDataAnalyzer;
102
103 std::unique_ptr<Mema::MeterbridgeComponent> m_inputMeteringComponent;
104 std::unique_ptr<Mema::MeterbridgeComponent> m_outputMeteringComponent;
105 std::unique_ptr<Mema::TwoDFieldOutputComponent> m_outputFieldComponent;
106 std::unique_ptr<Mema::WaveformAudioComponent> m_waveformComponent;
107 std::unique_ptr<Mema::SpectrumAudioComponent> m_spectrumComponent;
108
109 //==============================================================================
110 RunningStatus m_runningStatus = RunningStatus::Inactive;
111 static constexpr int sc_connectionTimeout = 5000;
112
113 std::pair<int, int> m_currentIOCount = { 0, 0 };
114
115 float m_ioRatio = 0.5f;
116
117 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MemaMoComponent)
118};
119
Central monitoring panel of the Mema.Mo application.
void setSpectrumVisuActive()
Switches to the FFT spectrum visualisation mode.
RunningStatus
Lifecycle state of the monitor panel driven by the network connection status.
@ Inactive
No TCP connection; component renders a placeholder.
@ Active
Actively receiving and visualising audio data from Mema.
@ Standby
Connection established but no audio data received yet.
void setNumVisibleChannels(std::uint16_t count)
Propagates a channel-count change to the active visualisation component.
void resized() override
Lays out visualisation components to fill the available area.
std::function< void()> onExitClick
Invoked when the user triggers a disconnection.
void paint(juce::Graphics &g) override
Paints the background when no visualisation is active.
void setWaveformVisuActive()
Switches to the scrolling waveform visualisation mode.
void setOutputFieldVisuActive(const juce::AudioChannelSet &channelConfiguration)
Switches to the 2-D spatial field visualisation for the given speaker layout.
std::optional< std::uint16_t > getNumVisibleChannels()
Returns the number of channels currently shown, or empty if no active visualiser.
void handleMessage(const Message &message) override
Dispatches inbound network messages to the appropriate analyzer or state handler.
~MemaMoComponent() override
void setOutputMeteringVisuActive()
Switches to the meterbridge (level-bar) visualisation mode.
Definition Mema.cpp:27