Mema
Memory Matrix — multi-channel audio matrix monitor and router
Loading...
Searching...
No Matches
MemaAppConfiguration.h
Go to the documentation of this file.
1/* Copyright (c) 2024, Christian Ahrens
2 *
3 * This file is part of Mema <https://github.com/ChristianAhrens/Mema>
4 *
5 * This tool is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU Lesser General Public License version 3.0 as published
7 * by the Free Software Foundation.
8 *
9 * This tool is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12 * details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this tool; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18
19#pragma once
20
21#include <JuceHeader.h>
22
23#include <AppConfigurationBase.h>
24
25#define Mema_CONFIG_VERSION "1.0.0"
26
27namespace Mema
28{
29
33class MemaAppConfiguration : public JUCEAppBasics::AppConfigurationBase
34{
35
36public:
49 static juce::String getTagName(TagID ID)
50 {
51 switch(ID)
52 {
53 case PROCESSORCONFIG:
54 return "PROCESSORCONFIG";
55 case DEVCONFIG:
56 return "DEVICECONFIG";
57 case UICONFIG:
58 return "UICONFIG";
59 case PLUGINCONFIG:
60 return "PLUGINCONFIG";
61 case INPUTMUTES:
62 return "INPUTMUTES";
63 case OUTPUTMUTES:
64 return "OUTPUTMUTES";
65 case CROSSPOINTGAINS:
66 return "CROSSPOINTGAINS";
67 case PLUGINPARAM:
68 return "PLUGINPARAM";
69 default:
70 return "INVALID";
71 }
72 };
73
84 static juce::String getAttributeName(AttributeID ID)
85 {
86 switch (ID)
87 {
88 case ENABLED:
89 return "ENABLED";
90 case POST:
91 return "POST";
92 case PALETTESTYLE:
93 return "PALETTESTYLE";
94 case METERINGCOLOR:
95 return "METERINGCOLOR";
96 case IDX:
97 return "IDX";
98 case CONTROLLABLE:
99 return "CONTROLLABLE";
100 default:
101 return "-";
102 }
103 };
104
105public:
107 explicit MemaAppConfiguration(const File &file);
108 ~MemaAppConfiguration() override;
109
111 bool isValid() override;
113 static bool isValid(const std::unique_ptr<juce::XmlElement>& xmlConfig);
114
116 bool ResetToDefault();
117
118protected:
120 bool HandleConfigVersionConflict(const Version& configVersionFound) override;
121
122private:
123
124 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(MemaAppConfiguration)
125};
126
127} // namespace Mema
XML-backed application configuration manager for the Mema audio matrix tool.
static juce::String getTagName(TagID ID)
TagID
XML element tag identifiers used when serialising/deserialising the configuration.
@ PLUGINCONFIG
Plugin host settings.
@ PROCESSORCONFIG
Audio processor settings.
@ CROSSPOINTGAINS
Crosspoint matrix gain values.
@ DEVCONFIG
Audio device configuration.
@ OUTPUTMUTES
Per-channel output mute states.
@ PLUGINPARAM
Individual plugin parameter entry.
@ 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)
AttributeID
XML attribute identifiers used alongside TagID elements.
@ ENABLED
Boolean enabled flag.
@ METERINGCOLOR
Metering bar colour.
@ POST
Post-matrix plugin insertion flag.
@ CONTROLLABLE
Whether a plugin parameter is remotely controllable.
@ IDX
Channel or parameter index.
@ PALETTESTYLE
Look-and-feel palette style index.
bool isValid() override
Returns true when the loaded XML contains all required configuration nodes.
bool HandleConfigVersionConflict(const Version &configVersionFound) override
Called when the persisted config version differs from the current app version.
Definition Mema.cpp:27