25 InitializeBase(file, JUCEAppBasics::AppConfigurationBase::Version::FromString(
Mema_CONFIG_VERSION));
39 if (!JUCEAppBasics::AppConfigurationBase::isValid(xmlConfig))
43 if (connectionConfigSectionElement)
46 if (serviceDescriptonXmlElement)
57 if (visuConfigSectionElement)
60 if (outputPanningXmlElement)
68 if (panningColourXmlElement)
76 if (lookAndFeelXmlElement)
91 auto xmlConfig = juce::parseXML(juce::String(BinaryData::MemaReDefault_config, BinaryData::MemaReDefault_configSize));
98 SetFlushAndUpdateDisabled();
99 if (resetConfigState(std::move(xmlConfig)))
101 ResetFlushAndUpdateDisabled();
107 ResetFlushAndUpdateDisabled();
110 triggerConfigurationDump();
118 triggerConfigurationDump();
126 triggerConfigurationDump();
134 if (configVersionFound != JUCEAppBasics::AppConfigurationBase::Version::FromString(
Mema_CONFIG_VERSION))
136 auto conflictTitle =
"Incompatible configuration version";
137 auto conflictInfo =
"The configuration file version detected\ncannot be handled by this version of " + juce::JUCEApplication::getInstance()->getApplicationName();
139 conflictInfo <<
"\n(Found " + configVersionFound.ToString() +
", expected " +
Mema_CONFIG_VERSION +
")";
141 juce::AlertWindow::showOkCancelBox(juce::MessageBoxIconType::WarningIcon, conflictTitle, conflictInfo,
"Reset to default",
"Quit",
nullptr, juce::ModalCallbackFunction::create([
this](
int result) {
148 juce::JUCEApplication::getInstance()->quit();
#define Mema_CONFIG_VERSION
@ CONTROLFORMAT
Active control mode (faderbank, 2-D panning layout, plugin parameters).
@ VISUCONFIG
Root element for visualisation/control settings.
@ LOOKANDFEEL
Active look-and-feel (follow host / dark / light).
@ CONNECTIONCONFIG
Root element for TCP connection settings.
@ SERVICEDESCRIPTION
Stored multicast service descriptor of the last connected Mema instance.
@ CONTROLCOLOUR
User-selected accent colour for control elements.
~MemaReAppConfiguration() override
bool ResetToDefault()
Resets every configuration value to its factory default and triggers a dump.
MemaReAppConfiguration(const File &file)
Constructs the configuration, loading from or creating the given XML file.
static juce::String getTagName(TagID ID)
bool HandleConfigVersionConflict(const Version &configVersionFound) override
Called when the persisted config version differs from the current app version.
bool isValid() override
Returns true when the loaded XML contains all required Mema.Re configuration nodes.