Umsci
Upmix Spatial Control Interface — OCA/OCP.1 spatial audio utility
Loading...
Searching...
No Matches
UmsciAppConfiguration Class Reference

Persists all Umsci user settings to an XML file via the JUCEAppBasics::AppConfigurationBase framework. More...

#include <UmsciAppConfiguration.h>

+ Inheritance diagram for UmsciAppConfiguration:
+ Collaboration diagram for UmsciAppConfiguration:

Public Types

enum  TagID {
  CONNECTIONCONFIG ,
  VISUCONFIG ,
  CONTROLCOLOUR ,
  LOOKANDFEEL ,
  CONTROLCONFIG ,
  CONTROLFORMAT ,
  UPMIXCONFIG ,
  CONTROLSIZE ,
  EXTERNALCONTROLCONFIG ,
  MIDIINPUTDEVICE ,
  MIDI_UPMIXROT ,
  MIDI_UPMIXSCALE ,
  MIDI_UPMIXHEIGHTSCALE ,
  MIDI_UPMIXANGLESTRETCH ,
  MIDI_UPMIXOFFSETX ,
  MIDI_UPMIXOFFSETY ,
  UPMIXSNAPSHOTCONFIG ,
  OSCINPUTPORT ,
  OSC_UPMIXROT ,
  OSC_UPMIXSCALE ,
  OSC_UPMIXHEIGHTSCALE ,
  OSC_UPMIXANGLESTRETCH ,
  OSC_UPMIXOFFSETX ,
  OSC_UPMIXOFFSETY
}
 Enumerates every XML element tag used in the config file. More...
 
enum  AttributeID {
  ENABLED ,
  IP ,
  PORT ,
  IOSIZE ,
  UPMIXSOURCESTARTID ,
  UPMIXLIVEMODE ,
  UPMIXSHAPE ,
  UPMIXSHOWALLSOURCES
}
 Enumerates every XML attribute name used within config elements. More...
 

Public Member Functions

 UmsciAppConfiguration (const File &file)
 
 ~UmsciAppConfiguration () override
 
bool isValid () override
 Returns true if the XML file exists and contains the expected root tags.
 
bool ResetToDefault ()
 Overwrites all settings with built-in 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 overload for validating a pre-loaded XmlElement without an instance.
 

Protected Member Functions

bool HandleConfigVersionConflict (const Version &configVersionFound) override
 Called by the base class when the config file's version string does not match Umsci_CONFIG_VERSION. Currently discards the old file and resets to defaults rather than attempting migration.
 

Detailed Description

Persists all Umsci user settings to an XML file via the JUCEAppBasics::AppConfigurationBase framework.

XML structure (top-level tags)

Tag (TagID) Contents
CONNECTIONCONFIG IP, port, I/O size (enabled flag, target address).
VISUCONFIG Look-and-feel style, control colour.
CONTROLCOLOUR Packed colour value for source/speaker icons.
LOOKANDFEEL LookAndFeel variant index.
CONTROLCONFIG Control size (S/M/L).
CONTROLFORMAT Upmix channel format (e.g. 5.1, 7.1.4).
UPMIXCONFIG Start source ID, live mode, shape, show-all-sources flag.
CONTROLSIZE Icon size override.
UPMIXROT Upmix ring rotation (float).
UPMIXSCALE Upmix ring radial scale (float).
UPMIXHEIGHTSCALE Upmix height ring scale relative to floor ring (float).
UPMIXANGLESTRETCH Upmix angular stretch factor (float).
UPMIXOFFSETX/Y Upmix ring X/Y centre offset (float each).

MainComponent owns the single instance, registered as both Dumper and Watcher so that settings are written on change and re-applied on external file updates.

Definition at line 54 of file UmsciAppConfiguration.h.

Member Enumeration Documentation

◆ AttributeID

Enumerates every XML attribute name used within config elements.

Enumerator
ENABLED 

Boolean: whether the connection is active.

IP 

String: target device IP address.

PORT 

Integer: target OCP.1 port (default 50014).

IOSIZE 

String: "inputs,outputs" channel count pair.

UPMIXSOURCESTARTID 

Integer: 1-based first DS100 channel for upmix inputs.

UPMIXLIVEMODE 

Boolean: follow live DS100 source positions.

UPMIXSHAPE 

String: "Circle" or "Rectangle".

UPMIXSHOWALLSOURCES 

Boolean: render all sources or only upmix group.

Definition at line 144 of file UmsciAppConfiguration.h.

◆ TagID

Enumerates every XML element tag used in the config file.

Enumerator
CONNECTIONCONFIG 

OCP.1 connection parameters.

VISUCONFIG 

Visual appearance settings.

CONTROLCOLOUR 

Source/speaker icon colour.

LOOKANDFEEL 

Look-and-feel variant.

CONTROLCONFIG 

Control-component settings.

CONTROLFORMAT 

Upmix channel format.

UPMIXCONFIG 

Upmix behaviour settings.

CONTROLSIZE 

Icon size (S/M/L).

EXTERNALCONTROLCONFIG 

External (MIDI) control assignments container.

MIDIINPUTDEVICE 

Selected MIDI input device identifier.

MIDI_UPMIXROT 

MIDI assignment for upmix rotation.

MIDI_UPMIXSCALE 

MIDI assignment for upmix translation (radial scale).

MIDI_UPMIXHEIGHTSCALE 

MIDI assignment for upmix height translation.

MIDI_UPMIXANGLESTRETCH 

MIDI assignment for upmix angle stretch.

MIDI_UPMIXOFFSETX 

MIDI assignment for upmix X offset.

MIDI_UPMIXOFFSETY 

MIDI assignment for upmix Y offset.

UPMIXSNAPSHOTCONFIG 

Upmix snapshot container (optional; absent = no snapshot stored).

OSCINPUTPORT 

OSC UDP listen port.

OSC_UPMIXROT 

OSC address for upmix rotation.

OSC_UPMIXSCALE 

OSC address for upmix translation (radial scale).

OSC_UPMIXHEIGHTSCALE 

OSC address for upmix height translation.

OSC_UPMIXANGLESTRETCH 

OSC address for upmix angle stretch.

OSC_UPMIXOFFSETX 

OSC address for upmix X offset.

OSC_UPMIXOFFSETY 

OSC address for upmix Y offset.

Definition at line 59 of file UmsciAppConfiguration.h.

Constructor & Destructor Documentation

◆ UmsciAppConfiguration()

UmsciAppConfiguration::UmsciAppConfiguration ( const File &  file)
explicit

Definition at line 22 of file UmsciAppConfiguration.cpp.

References Umsci_CONFIG_VERSION.

◆ ~UmsciAppConfiguration()

UmsciAppConfiguration::~UmsciAppConfiguration ( )
override

Definition at line 28 of file UmsciAppConfiguration.cpp.

Member Function Documentation

◆ getAttributeName()

◆ getTagName()

◆ HandleConfigVersionConflict()

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

Called by the base class when the config file's version string does not match Umsci_CONFIG_VERSION. Currently discards the old file and resets to defaults rather than attempting migration.

Definition at line 149 of file UmsciAppConfiguration.cpp.

References ResetToDefault(), and Umsci_CONFIG_VERSION.

◆ isValid() [1/2]

bool UmsciAppConfiguration::isValid ( )
override

Returns true if the XML file exists and contains the expected root tags.

Definition at line 32 of file UmsciAppConfiguration.cpp.

References isValid().

Referenced by isValid(), and ResetToDefault().

◆ isValid() [2/2]

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

Static overload for validating a pre-loaded XmlElement without an instance.

Definition at line 37 of file UmsciAppConfiguration.cpp.

References CONNECTIONCONFIG, CONTROLCOLOUR, CONTROLCONFIG, getAttributeName(), getTagName(), IOSIZE, IP, LOOKANDFEEL, PORT, UPMIXCONFIG, UPMIXLIVEMODE, UPMIXSHAPE, UPMIXSOURCESTARTID, and VISUCONFIG.

◆ ResetToDefault()

bool UmsciAppConfiguration::ResetToDefault ( )

Overwrites all settings with built-in defaults and triggers a dump.

Definition at line 106 of file UmsciAppConfiguration.cpp.

References isValid().

Referenced by HandleConfigVersionConflict().


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