21#include <JuceHeader.h>
27#include <ServiceTopologyManager.h>
66 public MemaReAppConfiguration::Dumper,
67 public MemaReAppConfiguration::Watcher
162 class InterprocessConnectionImpl :
public juce::InterprocessConnection
165 InterprocessConnectionImpl() : juce::InterprocessConnection() {};
166 virtual ~InterprocessConnectionImpl() {
disconnect(); };
169 void connectionMade()
override {
if (onConnectionMade) onConnectionMade(); };
172 void connectionLost()
override {
if (onConnectionLost) onConnectionLost(); };
185 bool RetryConnectToSocket() {
190 std::function<
void()> onConnectionMade;
191 std::function<
void()> onConnectionLost;
195 juce::String m_hostName;
196 int m_portNumber = 0;
200 void handleSettingsMenuResult(
int selectedId);
201 void handleSettingsLookAndFeelMenuResult(
int selectedId);
202 void handleSettingsControlFormatMenuResult(
int selectedId);
203 void handleSettingsControlColourMenuResult(
int selectedId);
204 void handleSettingsControlsSizeMenuResult(
int selectedId);
205 void handleSettingsFullscreenModeToggleResult();
206 void showExternalControlSettings();
209 void applyControlColour();
213 void toggleFullscreenMode();
215 void setStatus(
const Status&
s);
218 void connectToMema();
221 JUCEAppBasics::SessionMasterAwareService m_selectedService;
222 std::unique_ptr<InterprocessConnectionImpl> m_networkConnection;
224 std::unique_ptr<MemaReComponent> m_remoteComponent;
225 std::unique_ptr<MemaClientDiscoverComponent> m_discoverComponent;
226 std::unique_ptr<MemaClientConnectingComponent> m_connectingComponent;
228 std::unique_ptr<juce::DrawableButton> m_settingsButton;
229 std::map<int, std::pair<std::string, int>> m_settingsItems;
230 int m_settingsHostLookAndFeelId = -1;
232 std::unique_ptr<juce::DrawableButton> m_disconnectButton;
234 std::unique_ptr<juce::DrawableButton> m_aboutButton;
235 std::unique_ptr<AboutComponent> m_aboutComponent;
237 std::unique_ptr<juce::AlertWindow> m_messageBox;
239 Status m_currentStatus = Status::Discovering;
241 juce::Colour m_controlColour = juce::Colours::forestgreen;
243 std::unique_ptr<MemaReAppConfiguration> m_config;
Top-level application component for Mema.Mo (MenubarMatrixMonitor).
void paint(juce::Graphics &g) override
Paints the background and any status overlay.
void performConfigurationDump() override
Serialises the current configuration to the XML file on disk.
std::function< void(int, bool)> onPaletteStyleChange
Called when the user changes the look-and-feel or metering colour.
void resized() override
Lays out the active child component to fill the window.
MemaReSettingsOption
Identifiers for all user-configurable settings exposed via the settings popup menu.
@ ControlsSize_M
Medium control elements.
@ ControlsSize_S
Small control elements.
@ ControlFormat_PanningType_5point0
2-D spatial panning — 5.0 surround.
@ LookAndFeel_Light
Force light look-and-feel.
@ ControlFormat_PanningType_7point1point4
2-D spatial panning — 7.1.4 Dolby Atmos.
@ ControlFormat_PanningType_9point1point6
2-D spatial panning — 9.1.6 ATMOS full-3D.
@ ControlColour_Blue
Blue accent colour.
@ LookAndFeel_FollowHost
Match the host OS appearance.
@ ControlFormat_PanningType_7point0
2-D spatial panning — 7.0 surround.
@ ControlColour_Laser
High-visibility laser-green accent colour.
@ ExternalControl
Opens the ADM-OSC external-control settings dialog.
@ LookAndFeel_Dark
Force dark look-and-feel.
@ ControlColour_Pink
Pink accent colour.
@ ControlFormat_PanningType_LCRS
2-D spatial panning — LCRS 4-channel.
@ ControlFormat_PanningType_LRS
2-D spatial panning — LRS 3-channel.
@ ControlFormat_PanningType_Quadrophonic
2-D spatial panning — classic 4-channel quad.
@ ControlsSize_L
Large control elements (good for touch screens).
@ ControlColour_Red
Red accent colour.
@ ControlColour_Green
Green accent colour (default).
@ ControlFormat_RawChannels
Faderbank crosspoint control (raw input × output).
@ ControlFormat_PanningType_5point1point2
2-D spatial panning — 5.1.2 with height.
@ ControlFormat_PluginParameterControl
Plugin-parameter control panel.
@ ControlFormat_PanningType_7point1
2-D spatial panning — 7.1 surround.
@ ControlFormat_PanningType_5point1
2-D spatial panning — 5.1 surround.
@ FullscreenWindowMode
Toggle between popup and fullscreen window mode.
Status
Connection/application phase driven by the TCP session lifecycle.
@ Connecting
TCP handshake in progress.
@ Monitoring
Connected and actively receiving audio data.
@ Discovering
Searching for Mema instances via multicast.
void lookAndFeelChanged() override
Propagates a look-and-feel change to all owned child components.
bool keyPressed(const juce::KeyPress &key) override
Handles keyboard shortcuts (e.g. Escape to disconnect).
void applySettingsOption(const MemaMoSettingsOption &option)
Applies a settings menu selection, updating look-and-feel, visualisation type, or colour.
void onConfigUpdated() override
Reacts to external configuration changes.
bool isFullscreenEnabled()
Returns whether the window is currently displayed in fullscreen mode.
void timerCallback() override
Periodic callback used to retry TCP connections and poll status.
std::function< void(bool)> onSetFullscreenWindow
Called to request a fullscreen/windowed transition from the application shell.
~MainComponent() override
Central remote-control panel of the Mema.Re application.
ControlsSize
Size category for rendered control elements.