Mema
Memory Matrix — multi-channel audio matrix monitor and router
Loading...
Searching...
No Matches
MainComponent Class Reference

Top-level application component for Mema.Mo (MenubarMatrixMonitor). More...

#include <MainComponent.h>

+ Inheritance diagram for MainComponent:
+ Collaboration diagram for MainComponent:

Public Types

enum  Status {
  Discovering ,
  Connecting ,
  Monitoring ,
  Discovering ,
  Connecting ,
  Monitoring
}
 Connection/application phase driven by the TCP session lifecycle. More...
 
enum  MemaMoSettingsOption {
  LookAndFeel_First = 1 ,
  LookAndFeel_FollowHost = LookAndFeel_First ,
  LookAndFeel_Dark ,
  LookAndFeel_Light ,
  LookAndFeel_Last = LookAndFeel_Light ,
  OutputVisuType_First ,
  OutputVisuType_Meterbridge = OutputVisuType_First ,
  OutputVisuType_LRS ,
  OutputVisuType_LCRS ,
  OutputVisuType_5point0 ,
  OutputVisuType_5point1 ,
  OutputVisuType_5point1point2 ,
  OutputVisuType_7point0 ,
  OutputVisuType_7point1 ,
  OutputVisuType_7point1point4 ,
  OutputVisuType_9point1point6 ,
  OutputVisuType_Quadrophonic ,
  OutputVisuType_Waveform ,
  OutputVisuType_Spectrum ,
  OutputVisuType_Last = OutputVisuType_Spectrum ,
  MeteringColour_First ,
  MeteringColour_Green = MeteringColour_First ,
  MeteringColour_Red ,
  MeteringColour_Blue ,
  MeteringColour_Pink ,
  MeteringColour_Laser ,
  MeteringColour_Last = MeteringColour_Laser ,
  FullscreenWindowMode
}
 Identifiers for all user-configurable settings exposed via the settings popup menu. More...
 
enum  Status {
  Discovering ,
  Connecting ,
  Monitoring ,
  Discovering ,
  Connecting ,
  Monitoring
}
 Connection/application phase driven by the TCP session lifecycle. More...
 
enum  MemaReSettingsOption {
  LookAndFeel_First = 1 ,
  LookAndFeel_FollowHost = LookAndFeel_First ,
  LookAndFeel_Dark ,
  LookAndFeel_Light ,
  LookAndFeel_Last = LookAndFeel_Light ,
  ControlFormat_First ,
  ControlFormat_RawChannels = ControlFormat_First ,
  ControlFormat_PanningType_LRS ,
  ControlFormat_PanningType_LCRS ,
  ControlFormat_PanningType_5point0 ,
  ControlFormat_PanningType_5point1 ,
  ControlFormat_PanningType_5point1point2 ,
  ControlFormat_PanningType_7point0 ,
  ControlFormat_PanningType_7point1 ,
  ControlFormat_PanningType_7point1point4 ,
  ControlFormat_PanningType_9point1point6 ,
  ControlFormat_PanningType_Quadrophonic ,
  ControlFormat_PluginParameterControl ,
  ControlFormat_Last = ControlFormat_PluginParameterControl ,
  ControlColour_First ,
  ControlColour_Green = ControlColour_First ,
  ControlColour_Red ,
  ControlColour_Blue ,
  ControlColour_Pink ,
  ControlColour_Laser ,
  ControlColour_Last = ControlColour_Laser ,
  ControlsSize_First ,
  ControlsSize_S = ControlsSize_First ,
  ControlsSize_M ,
  ControlsSize_L ,
  ControlsSize_Last = ControlsSize_L ,
  ExternalControl ,
  FullscreenWindowMode
}
 Identifiers for all user-configurable settings exposed via the settings popup menu. More...
 

Public Member Functions

 MainComponent ()
 
 ~MainComponent () override
 
void applySettingsOption (const MemaMoSettingsOption &option)
 Applies a settings menu selection, updating look-and-feel, visualisation type, or colour.
 
void resized () override
 Lays out the active child component to fill the window.
 
void paint (juce::Graphics &g) override
 Paints the background and any status overlay.
 
void lookAndFeelChanged () override
 Propagates a look-and-feel change to all owned child components.
 
void timerCallback () override
 Periodic callback used to retry TCP connections and poll network status.
 
bool keyPressed (const juce::KeyPress &key) override
 Handles keyboard shortcuts (e.g. Escape to disconnect).
 
void performConfigurationDump () override
 Serialises the current configuration to the XML file on disk.
 
void onConfigUpdated () override
 Reacts to external configuration changes.
 
bool isFullscreenEnabled ()
 Returns whether the window is currently displayed in fullscreen mode.
 
 MainComponent ()
 
 ~MainComponent () override
 
void applySettingsOption (const MemaReSettingsOption &option)
 Applies a settings menu selection, updating look-and-feel, control format, colour, size, or ADM-OSC settings.
 
void resized () override
 Lays out the active child component to fill the window.
 
void paint (juce::Graphics &g) override
 Paints the background and any status overlay.
 
void lookAndFeelChanged () override
 Propagates a look-and-feel change to all owned child components.
 
void timerCallback () override
 Periodic callback used to retry TCP connections and poll status.
 
bool keyPressed (const juce::KeyPress &key) override
 Handles keyboard shortcuts (e.g. Escape to disconnect).
 
void performConfigurationDump () override
 Serialises the current configuration to the XML file on disk.
 
void onConfigUpdated () override
 Reacts to external configuration changes.
 
bool isFullscreenEnabled ()
 Returns whether the window is currently displayed in fullscreen mode.
 

Public Attributes

std::function< void(int, bool)> onPaletteStyleChange
 Called when the user changes the look-and-feel or metering colour.
 
std::function< void(bool)> onSetFullscreenWindow
 Called to request a fullscreen/windowed transition from the application shell.
 

Detailed Description

Top-level application component for Mema.Mo (MenubarMatrixMonitor).

Top-level application component for Mema.Re (MenubarMatrixRemote).

MainComponent drives the three-phase connection state machine of Mema.Mo and owns all child components that are active in each phase:

Phase Active child Description
Discovering MemaClientDiscoverComponent Listens for multicast service announcements from Mema instances on the local network.
Connecting MemaClientConnectingComponent Establishes the TCP connection to the selected Mema server.
Monitoring MemaMoComponent Receives streaming audio buffers and renders the chosen visualisation.

It also owns the TCP socket (InterprocessConnectionImpl), exposes a settings menu for choosing look-and-feel, output visualisation type, and metering colour, and persists all choices via MemaMoAppConfiguration.

Role in the Mema tool suite

Mema.Mo is the read-only monitoring companion to the Mema audio-matrix server.

  • Mema streams audio output buffers continuously over TCP (port 55668).
  • Mema.Mo receives these buffers, feeds them into a local ProcessorDataAnalyzer, and renders one of four selectable visualisations.
  • No control messages are ever sent from Mema.Mo to Mema (use Mema.Re for control).
See also
MemaMoComponent the active monitoring panel.
MemaMoAppConfiguration XML persistence of settings.

MainComponent drives the three-phase connection state machine of Mema.Re and owns all child components that are active in each phase:

Phase Active child Description
Discovering MemaClientDiscoverComponent Listens for multicast service announcements from Mema instances on the local network.
Connecting MemaClientConnectingComponent Establishes the TCP connection to the selected Mema server.
Controlling MemaReComponent Sends user control gestures to Mema and keeps local state in sync with incoming snapshots.

It also owns the TCP socket (InterprocessConnectionImpl), exposes a settings menu for choosing look-and-feel, control format, accent colour, control size, and ADM-OSC settings, and persists all choices via MemaReAppConfiguration.

Role in the Mema tool suite

Mema.Re is the bidirectional remote-control companion to the Mema audio-matrix server.

  • On connect, Mema sends a full ControlParametersMessage state snapshot so Mema.Re can initialise its UI to the current server state.
  • User interactions produce updated ControlParametersMessage or PluginParameterValueMessage payloads that are sent back to Mema over the same TCP connection.
  • Optionally, an external spatial-audio controller (e.g. Grapes) can send ADM-OSC UDP packets to ADMOSController, which feeds position/mute updates into the 2-D panning view.
See also
MemaReComponent the active remote-control panel.
MemaReAppConfiguration XML persistence of settings.

Definition at line 60 of file MainComponent.h.

Member Enumeration Documentation

◆ MemaMoSettingsOption

Identifiers for all user-configurable settings exposed via the settings popup menu.

Enumerator
LookAndFeel_First 
LookAndFeel_FollowHost 

Match the host OS appearance.

LookAndFeel_Dark 

Force dark look-and-feel.

LookAndFeel_Light 

Force light look-and-feel.

LookAndFeel_Last 
OutputVisuType_First 
OutputVisuType_Meterbridge 

Level-bar meterbridge (default).

OutputVisuType_LRS 

3-channel Left/Right/Surround 2-D field.

OutputVisuType_LCRS 

4-channel LCRS 2-D field.

OutputVisuType_5point0 

5.0 surround 2-D field.

OutputVisuType_5point1 

5.1 surround 2-D field.

OutputVisuType_5point1point2 

5.1.2 with two height channels.

OutputVisuType_7point0 

7.0 surround 2-D field.

OutputVisuType_7point1 

7.1 surround 2-D field.

OutputVisuType_7point1point4 

7.1.4 Dolby Atmos layout.

OutputVisuType_9point1point6 

9.1.6 ATMOS full-3D layout.

OutputVisuType_Quadrophonic 

Classic 4-channel quadrophonic 2-D field.

OutputVisuType_Waveform 

Scrolling waveform plot.

OutputVisuType_Spectrum 

FFT frequency-spectrum display.

OutputVisuType_Last 
MeteringColour_First 
MeteringColour_Green 

Green metering bars (default).

MeteringColour_Red 

Red metering bars.

MeteringColour_Blue 

Blue metering bars.

MeteringColour_Pink 

Pink metering bars.

MeteringColour_Laser 

High-visibility laser-green metering bars.

MeteringColour_Last 
FullscreenWindowMode 

Toggle between popup and fullscreen window mode.

Definition at line 75 of file MainComponent.h.

◆ MemaReSettingsOption

Identifiers for all user-configurable settings exposed via the settings popup menu.

Enumerator
LookAndFeel_First 
LookAndFeel_FollowHost 

Match the host OS appearance.

LookAndFeel_Dark 

Force dark look-and-feel.

LookAndFeel_Light 

Force light look-and-feel.

LookAndFeel_Last 
ControlFormat_First 
ControlFormat_RawChannels 

Faderbank crosspoint control (raw input × output).

ControlFormat_PanningType_LRS 

2-D spatial panning — LRS 3-channel.

ControlFormat_PanningType_LCRS 

2-D spatial panning — LCRS 4-channel.

ControlFormat_PanningType_5point0 

2-D spatial panning — 5.0 surround.

ControlFormat_PanningType_5point1 

2-D spatial panning — 5.1 surround.

ControlFormat_PanningType_5point1point2 

2-D spatial panning — 5.1.2 with height.

ControlFormat_PanningType_7point0 

2-D spatial panning — 7.0 surround.

ControlFormat_PanningType_7point1 

2-D spatial panning — 7.1 surround.

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.

ControlFormat_PanningType_Quadrophonic 

2-D spatial panning — classic 4-channel quad.

ControlFormat_PluginParameterControl 

Plugin-parameter control panel.

ControlFormat_Last 
ControlColour_First 
ControlColour_Green 

Green accent colour (default).

ControlColour_Red 

Red accent colour.

ControlColour_Blue 

Blue accent colour.

ControlColour_Pink 

Pink accent colour.

ControlColour_Laser 

High-visibility laser-green accent colour.

ControlColour_Last 
ControlsSize_First 
ControlsSize_S 

Small control elements.

ControlsSize_M 

Medium control elements.

ControlsSize_L 

Large control elements (good for touch screens).

ControlsSize_Last 
ExternalControl 

Opens the ADM-OSC external-control settings dialog.

FullscreenWindowMode 

Toggle between popup and fullscreen window mode.

Definition at line 79 of file MainComponent.h.

◆ Status [1/2]

Connection/application phase driven by the TCP session lifecycle.

Enumerator
Discovering 

Searching for Mema instances via multicast.

Connecting 

TCP handshake in progress.

Monitoring 

Connected and actively receiving audio data.

Connected and actively sending/receiving control data.

Discovering 

Searching for Mema instances via multicast.

Connecting 

TCP handshake in progress.

Monitoring 

Connected and actively receiving audio data.

Connected and actively sending/receiving control data.

Definition at line 67 of file MainComponent.h.

◆ Status [2/2]

Connection/application phase driven by the TCP session lifecycle.

Enumerator
Discovering 

Searching for Mema instances via multicast.

Connecting 

TCP handshake in progress.

Monitoring 

Connected and actively receiving audio data.

Connected and actively sending/receiving control data.

Discovering 

Searching for Mema instances via multicast.

Connecting 

TCP handshake in progress.

Monitoring 

Connected and actively receiving audio data.

Connected and actively sending/receiving control data.

Definition at line 71 of file MainComponent.h.

Constructor & Destructor Documentation

◆ MainComponent() [1/2]

◆ ~MainComponent() [1/2]

MainComponent::~MainComponent ( )
override

Definition at line 244 of file MainComponent.cpp.

◆ MainComponent() [2/2]

MainComponent::MainComponent ( )

◆ ~MainComponent() [2/2]

MainComponent::~MainComponent ( )
override

Member Function Documentation

◆ applySettingsOption() [1/2]

void MainComponent::applySettingsOption ( const MemaMoSettingsOption option)

Applies a settings menu selection, updating look-and-feel, visualisation type, or colour.

Definition at line 307 of file MainComponent.cpp.

◆ applySettingsOption() [2/2]

void MainComponent::applySettingsOption ( const MemaReSettingsOption option)

Applies a settings menu selection, updating look-and-feel, control format, colour, size, or ADM-OSC settings.

Definition at line 329 of file MainComponent.cpp.

References LookAndFeel_First.

◆ isFullscreenEnabled() [1/2]

bool MainComponent::isFullscreenEnabled ( )

Returns whether the window is currently displayed in fullscreen mode.

Definition at line 705 of file MainComponent.cpp.

References LookAndFeel_First.

◆ isFullscreenEnabled() [2/2]

bool MainComponent::isFullscreenEnabled ( )

Returns whether the window is currently displayed in fullscreen mode.

◆ keyPressed() [1/2]

bool MainComponent::keyPressed ( const juce::KeyPress &  key)
override

Handles keyboard shortcuts (e.g. Escape to disconnect).

Definition at line 596 of file MainComponent.cpp.

References LookAndFeel_First.

◆ keyPressed() [2/2]

bool MainComponent::keyPressed ( const juce::KeyPress &  key)
override

Handles keyboard shortcuts (e.g. Escape to disconnect).

◆ lookAndFeelChanged() [1/2]

void MainComponent::lookAndFeelChanged ( )
override

Propagates a look-and-feel change to all owned child components.

Definition at line 290 of file MainComponent.cpp.

◆ lookAndFeelChanged() [2/2]

void MainComponent::lookAndFeelChanged ( )
override

Propagates a look-and-feel change to all owned child components.

◆ onConfigUpdated() [1/2]

◆ onConfigUpdated() [2/2]

void MainComponent::onConfigUpdated ( )
override

Reacts to external configuration changes.

◆ paint() [1/2]

void MainComponent::paint ( juce::Graphics &  g)
override

Paints the background and any status overlay.

Definition at line 285 of file MainComponent.cpp.

◆ paint() [2/2]

void MainComponent::paint ( juce::Graphics &  g)
override

Paints the background and any status overlay.

◆ performConfigurationDump() [1/2]

◆ performConfigurationDump() [2/2]

void MainComponent::performConfigurationDump ( )
override

Serialises the current configuration to the XML file on disk.

◆ resized() [1/2]

void MainComponent::resized ( )
override

Lays out the active child component to fill the window.

Definition at line 248 of file MainComponent.cpp.

◆ resized() [2/2]

void MainComponent::resized ( )
override

Lays out the active child component to fill the window.

◆ timerCallback() [1/2]

void MainComponent::timerCallback ( )
override

Periodic callback used to retry TCP connections and poll network status.

Definition at line 574 of file MainComponent.cpp.

References LookAndFeel_First.

◆ timerCallback() [2/2]

void MainComponent::timerCallback ( )
override

Periodic callback used to retry TCP connections and poll status.

Member Data Documentation

◆ onPaletteStyleChange

std::function< void(int, bool)> MainComponent::onPaletteStyleChange

Called when the user changes the look-and-feel or metering colour.

Called when the user changes the look-and-feel or accent colour.

Definition at line 139 of file MainComponent.h.

Referenced by MainComponent().

◆ onSetFullscreenWindow

std::function< void(bool)> MainComponent::onSetFullscreenWindow

Called to request a fullscreen/windowed transition from the application shell.

Definition at line 142 of file MainComponent.h.


The documentation for this class was generated from the following files: