27 InitializeBase(file, JUCEAppBasics::AppConfigurationBase::Version::FromString(
Mema_CONFIG_VERSION));
41 if (!JUCEAppBasics::AppConfigurationBase::isValid(xmlConfig))
45 if (editorCfgSectionElement)
53 if (processorSectionElement)
56 if (devSectionElement)
64 if (plginSectionElement)
77 if (inputMutesSectionElement)
85 if (crosspointGainsSectionElement)
93 if (outputMutesSectionElement)
108 auto xmlConfig = juce::parseXML(juce::String(BinaryData::MemaDefault_config, BinaryData::MemaDefault_configSize));
115 SetFlushAndUpdateDisabled();
116 if (resetConfigState(std::move(xmlConfig)))
118 ResetFlushAndUpdateDisabled();
124 ResetFlushAndUpdateDisabled();
127 triggerConfigurationDump();
135 triggerConfigurationDump();
143 triggerConfigurationDump();
151 if (configVersionFound != JUCEAppBasics::AppConfigurationBase::Version::FromString(
Mema_CONFIG_VERSION))
153 auto conflictTitle =
"Incompatible configuration version";
154 auto conflictInfo =
"The configuration file version detected\ncannot be handled by this version of " + juce::JUCEApplication::getInstance()->getApplicationName();
156 conflictInfo <<
"\n(Found " + configVersionFound.ToString() +
", expected " +
Mema_CONFIG_VERSION +
")";
158 juce::AlertWindow::showOkCancelBox(juce::MessageBoxIconType::WarningIcon, conflictTitle, conflictInfo,
"Reset to default",
"Quit",
nullptr, juce::ModalCallbackFunction::create([
this](
int result) {
165 juce::JUCEApplication::getInstance()->quit();
#define Mema_CONFIG_VERSION
static juce::String getTagName(TagID ID)
@ PLUGINCONFIG
Plugin host settings.
@ PROCESSORCONFIG
Audio processor settings.
@ CROSSPOINTGAINS
Crosspoint matrix gain values.
@ DEVCONFIG
Audio device configuration.
@ OUTPUTMUTES
Per-channel output mute states.
@ UICONFIG
UI layout and appearance.
@ INPUTMUTES
Per-channel input mute states.
bool ResetToDefault()
Resets every value to factory defaults and triggers a dump.
static juce::String getAttributeName(AttributeID ID)
MemaAppConfiguration(const File &file)
Constructs the configuration, loading from or creating the given XML file.
@ ENABLED
Boolean enabled flag.
@ POST
Post-matrix plugin insertion flag.
bool isValid() override
Returns true when the loaded XML contains all required configuration nodes.
~MemaAppConfiguration() override
bool HandleConfigVersionConflict(const Version &configVersionFound) override
Called when the persisted config version differs from the current app version.