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

XML-backed application configuration manager for the Mema audio matrix tool. More...

#include <MemaAppConfiguration.h>

+ Inheritance diagram for Mema::MemaAppConfiguration:
+ Collaboration diagram for Mema::MemaAppConfiguration:

Public Types

enum  TagID {
  PROCESSORCONFIG ,
  DEVCONFIG ,
  UICONFIG ,
  PLUGINCONFIG ,
  INPUTMUTES ,
  OUTPUTMUTES ,
  CROSSPOINTGAINS ,
  PLUGINPARAM
}
 XML element tag identifiers used when serialising/deserialising the configuration. More...
 
enum  AttributeID {
  ENABLED ,
  POST ,
  PALETTESTYLE ,
  METERINGCOLOR ,
  IDX ,
  CONTROLLABLE
}
 XML attribute identifiers used alongside TagID elements. More...
 

Public Member Functions

 MemaAppConfiguration (const File &file)
 Constructs the configuration, loading from or creating the given XML file.
 
 ~MemaAppConfiguration () override
 
bool isValid () override
 Returns true when the loaded XML contains all required configuration nodes.
 
bool ResetToDefault ()
 Resets every value to factory defaults 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.
 

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 application configuration manager for the Mema audio matrix tool.

Definition at line 33 of file MemaAppConfiguration.h.

Member Enumeration Documentation

◆ AttributeID

XML attribute identifiers used alongside TagID elements.

Enumerator
ENABLED 

Boolean enabled flag.

POST 

Post-matrix plugin insertion flag.

PALETTESTYLE 

Look-and-feel palette style index.

METERINGCOLOR 

Metering bar colour.

IDX 

Channel or parameter index.

CONTROLLABLE 

Whether a plugin parameter is remotely controllable.

Definition at line 75 of file MemaAppConfiguration.h.

◆ TagID

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

Enumerator
PROCESSORCONFIG 

Audio processor settings.

DEVCONFIG 

Audio device configuration.

UICONFIG 

UI layout and appearance.

PLUGINCONFIG 

Plugin host settings.

INPUTMUTES 

Per-channel input mute states.

OUTPUTMUTES 

Per-channel output mute states.

CROSSPOINTGAINS 

Crosspoint matrix gain values.

PLUGINPARAM 

Individual plugin parameter entry.

Definition at line 38 of file MemaAppConfiguration.h.

Constructor & Destructor Documentation

◆ MemaAppConfiguration()

Mema::MemaAppConfiguration::MemaAppConfiguration ( const File &  file)
explicit

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

Definition at line 24 of file MemaAppConfiguration.cpp.

References Mema_CONFIG_VERSION.

◆ ~MemaAppConfiguration()

Mema::MemaAppConfiguration::~MemaAppConfiguration ( )
override

Definition at line 30 of file MemaAppConfiguration.cpp.

Member Function Documentation

◆ getAttributeName()

static juce::String Mema::MemaAppConfiguration::getAttributeName ( AttributeID  ID)
inlinestatic

◆ getTagName()

◆ HandleConfigVersionConflict()

bool Mema::MemaAppConfiguration::HandleConfigVersionConflict ( const Version &  configVersionFound)
overrideprotected

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

Definition at line 149 of file MemaAppConfiguration.cpp.

References Mema_CONFIG_VERSION, and ResetToDefault().

◆ isValid() [1/2]

bool Mema::MemaAppConfiguration::isValid ( )
override

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

Definition at line 34 of file MemaAppConfiguration.cpp.

References isValid().

Referenced by isValid(), ResetToDefault(), and Mema::Mema::triggerPromptLoadConfig().

◆ isValid() [2/2]

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

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

Definition at line 39 of file MemaAppConfiguration.cpp.

References CROSSPOINTGAINS, DEVCONFIG, ENABLED, getAttributeName(), getTagName(), INPUTMUTES, OUTPUTMUTES, PLUGINCONFIG, POST, PROCESSORCONFIG, and UICONFIG.

◆ ResetToDefault()

bool Mema::MemaAppConfiguration::ResetToDefault ( )

Resets every value to factory defaults and triggers a dump.

Definition at line 106 of file MemaAppConfiguration.cpp.

References isValid().

Referenced by HandleConfigVersionConflict().


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