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

XML-backed configuration manager for the Mema.Re remote-control application. More...

#include <MemaReAppConfiguration.h>

+ Inheritance diagram for MemaReAppConfiguration:
+ Collaboration diagram for MemaReAppConfiguration:

Public Types

enum  TagID {
  CONNECTIONCONFIG ,
  SERVICEDESCRIPTION ,
  VISUCONFIG ,
  CONTROLFORMAT ,
  CONTROLCOLOUR ,
  LOOKANDFEEL ,
  CONTROLSSIZE ,
  EXTCTRLCONFIG ,
  ADMOSCHOST ,
  ADMOSCCLIENT
}
 XML element tag identifiers used when serialising/deserialising the configuration. More...
 
enum  AttributeID {
  ENABLED ,
  IP ,
  PORT
}
 XML attribute identifiers used alongside TagID elements. More...
 

Public Member Functions

 MemaReAppConfiguration (const File &file)
 Constructs the configuration, loading from or creating the given XML file.
 
 ~MemaReAppConfiguration () override
 
bool isValid () override
 Returns true when the loaded XML contains all required Mema.Re configuration nodes.
 
bool ResetToDefault ()
 Resets every configuration value to its factory default and triggers a dump.
 

Static Public Member Functions

static juce::String getTagName (TagID ID)
 
static juce::String getAttributeName (AttributeID ID)
 
static bool isValid (const std::unique_ptr< juce::XmlElement > &xmlConfig)
 Static variant — validates an already-parsed XmlElement without a file on disk.
 

Protected Member Functions

bool HandleConfigVersionConflict (const Version &configVersionFound) override
 Called when the persisted config version differs from the current app version.
 

Detailed Description

XML-backed configuration manager for the Mema.Re remote-control application.

Persists the user's chosen Mema service, active control format, accent colour, look-and-feel, control element size, and ADM-OSC external-control settings across application launches.

Note
Part of the Mema tool suite. Mema.Re is the remote-control companion to the Mema audio-matrix server. Unlike Mema.Mo (which only receives audio data), Mema.Re sends ControlParametersMessage updates back to Mema over the same TCP connection and can also receive ADM-OSC UDP packets from an external spatial-audio controller (e.g. Grapes).

Definition at line 42 of file MemaReAppConfiguration.h.

Member Enumeration Documentation

◆ AttributeID

XML attribute identifiers used alongside TagID elements.

Enumerator
ENABLED 

Boolean flag indicating whether a feature or connection is active.

IP 

IP address string (used for ADM-OSC remote client address).

PORT 

UDP/TCP port number.

Definition at line 90 of file MemaReAppConfiguration.h.

◆ TagID

XML element tag identifiers used when serialising/deserialising the configuration.

Enumerator
CONNECTIONCONFIG 

Root element for TCP connection settings.

SERVICEDESCRIPTION 

Stored multicast service descriptor of the last connected Mema instance.

VISUCONFIG 

Root element for visualisation/control settings.

CONTROLFORMAT 

Active control mode (faderbank, 2-D panning layout, plugin parameters).

CONTROLCOLOUR 

User-selected accent colour for control elements.

LOOKANDFEEL 

Active look-and-feel (follow host / dark / light).

CONTROLSSIZE 

Size category for control widgets (S / M / L).

EXTCTRLCONFIG 

Root element for external ADM-OSC controller settings.

ADMOSCHOST 

ADM-OSC host (local UDP listen port).

ADMOSCCLIENT 

ADM-OSC client (remote IP and port for outgoing messages).

Definition at line 47 of file MemaReAppConfiguration.h.

Constructor & Destructor Documentation

◆ MemaReAppConfiguration()

MemaReAppConfiguration::MemaReAppConfiguration ( const File &  file)
explicit

Constructs the configuration, loading from or creating the given XML file.

Definition at line 22 of file MemaReAppConfiguration.cpp.

References Mema_CONFIG_VERSION.

◆ ~MemaReAppConfiguration()

MemaReAppConfiguration::~MemaReAppConfiguration ( )
override

Definition at line 28 of file MemaReAppConfiguration.cpp.

Member Function Documentation

◆ getAttributeName()

static juce::String MemaReAppConfiguration::getAttributeName ( AttributeID  ID)
inlinestatic

Definition at line 96 of file MemaReAppConfiguration.h.

References ENABLED, IP, and PORT.

◆ getTagName()

static juce::String MemaReAppConfiguration::getTagName ( TagID  ID)
inlinestatic

◆ HandleConfigVersionConflict()

bool MemaReAppConfiguration::HandleConfigVersionConflict ( const Version &  configVersionFound)
overrideprotected

Called when the persisted config version differs from the current app version.

Definition at line 132 of file MemaReAppConfiguration.cpp.

References Mema_CONFIG_VERSION, and ResetToDefault().

◆ isValid() [1/2]

bool MemaReAppConfiguration::isValid ( )
override

Returns true when the loaded XML contains all required Mema.Re configuration nodes.

Definition at line 32 of file MemaReAppConfiguration.cpp.

References isValid().

Referenced by isValid(), and ResetToDefault().

◆ isValid() [2/2]

bool MemaReAppConfiguration::isValid ( const std::unique_ptr< juce::XmlElement > &  xmlConfig)
static

Static variant — validates an already-parsed XmlElement without a file on disk.

Definition at line 37 of file MemaReAppConfiguration.cpp.

References CONNECTIONCONFIG, CONTROLCOLOUR, CONTROLFORMAT, getTagName(), LOOKANDFEEL, SERVICEDESCRIPTION, and VISUCONFIG.

◆ ResetToDefault()

bool MemaReAppConfiguration::ResetToDefault ( )

Resets every configuration value to its factory default and triggers a dump.

Definition at line 89 of file MemaReAppConfiguration.cpp.

References isValid().

Referenced by HandleConfigVersionConflict().


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