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

XML-backed configuration manager for the Mema.Mo monitor application. More...

#include <MemaMoAppConfiguration.h>

+ Inheritance diagram for MemaMoAppConfiguration:
+ Collaboration diagram for MemaMoAppConfiguration:

Public Types

enum  TagID {
  CONNECTIONCONFIG ,
  SERVICEDESCRIPTION ,
  VISUCONFIG ,
  OUTPUTVISUTYPE ,
  METERINGCOLOUR ,
  LOOKANDFEEL
}
 XML element tag identifiers used when serialising/deserialising the configuration. More...
 
enum  AttributeID {
  ENABLED ,
  COUNT
}
 XML attribute identifiers used alongside TagID elements. More...
 

Public Member Functions

 MemaMoAppConfiguration (const File &file)
 Constructs the configuration, loading from or creating the given XML file.
 
 ~MemaMoAppConfiguration () override
 
bool isValid () override
 Returns true when the loaded XML contains all required Mema.Mo 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.Mo monitor application.

Persists the user's chosen Mema service (host/port), output visualization type, metering colour, and look-and-feel selection across application launches. Inherits the dump/watch/version-conflict infrastructure from AppConfigurationBase.

Note
Part of the Mema tool suite. Mema.Mo is the monitoring companion to the Mema audio-matrix server: it receives streamed audio buffers over TCP and renders them as level meters, 2-D spatial field, waveform, or spectrum. This configuration class stores everything Mema.Mo needs to reconnect and restore its last visual state.

Definition at line 41 of file MemaMoAppConfiguration.h.

Member Enumeration Documentation

◆ AttributeID

XML attribute identifiers used alongside TagID elements.

Enumerator
ENABLED 

Boolean flag indicating whether a feature or connection is active.

COUNT 

Integer storing a channel or item count.

Definition at line 77 of file MemaMoAppConfiguration.h.

◆ TagID

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

Enumerator
CONNECTIONCONFIG 

Root element for connection settings (host, port).

SERVICEDESCRIPTION 

Stores the multicast service descriptor of the last connected Mema instance.

VISUCONFIG 

Root element for visualisation settings.

OUTPUTVISUTYPE 

Active output visualisation mode (meterbridge, 2-D field, waveform, …).

METERINGCOLOUR 

User-selected metering bar colour.

LOOKANDFEEL 

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

Definition at line 46 of file MemaMoAppConfiguration.h.

Constructor & Destructor Documentation

◆ MemaMoAppConfiguration()

MemaMoAppConfiguration::MemaMoAppConfiguration ( const File &  file)
explicit

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

Definition at line 22 of file MemaMoAppConfiguration.cpp.

References Mema_CONFIG_VERSION.

◆ ~MemaMoAppConfiguration()

MemaMoAppConfiguration::~MemaMoAppConfiguration ( )
override

Definition at line 28 of file MemaMoAppConfiguration.cpp.

Member Function Documentation

◆ getAttributeName()

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

◆ getTagName()

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

◆ HandleConfigVersionConflict()

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

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

Definition at line 132 of file MemaMoAppConfiguration.cpp.

References Mema_CONFIG_VERSION, and ResetToDefault().

◆ isValid() [1/2]

bool MemaMoAppConfiguration::isValid ( )
override

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

Definition at line 32 of file MemaMoAppConfiguration.cpp.

References isValid().

Referenced by isValid(), and ResetToDefault().

◆ isValid() [2/2]

bool MemaMoAppConfiguration::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 MemaMoAppConfiguration.cpp.

References CONNECTIONCONFIG, getTagName(), LOOKANDFEEL, METERINGCOLOUR, OUTPUTVISUTYPE, SERVICEDESCRIPTION, and VISUCONFIG.

◆ ResetToDefault()

bool MemaMoAppConfiguration::ResetToDefault ( )

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

Definition at line 89 of file MemaMoAppConfiguration.cpp.

References isValid().

Referenced by HandleConfigVersionConflict().


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