ModuleConfig

Module and audio routin configurator. Loads an SDL file, then configures the modules and sets up their routing, presets, etc. See modulesetup.md on documentation about how the format works internally.

class ModuleConfig {}

Constructors

this
this(string src, ModuleManager manager)

Loads an audio configuration, and parses it. Does not automatically compile it.

this
this(ModuleManager manager)

Creates an empty audio configuration, e.g. for editors.

Members

Functions

addModule
void addModule(string type, string name)

Adds a new module to the configuration.

addModule
void addModule(Tag backup)

Adds a module from backup.

addPreset
void addPreset(string modID, Tag backup)

Adds a preset to the configuration either from a backup or an import.

addRouting
void addRouting(string from, string to)

Adds a routing to the audio configuration. Automatically creates nodes if names are not recognized either as module ports or audio outputs.

addWaveFile
Tag addWaveFile(string path, string modID, int waveID, string dpkPath, string name)

Adds a wave file to the given module.

addWaveFromBackup
void addWaveFromBackup(string modID, Tag backup)

Adds a waveform data tag from backup to the module described by modID.

addWaveSlice
Tag addWaveSlice(string modID, int waveID, int src, int pos, int len, string name)

Creates a waveform from another by slicing.

compile
void compile(bool isRunning)

Compiles the current configuration, then configures the modules accordingly.

editPresetParameter
void editPresetParameter(string modID, int presetID, Value paramID, Value value, Value backup, string name)

Edits a preset parameter.

getModule
AudioModule getModule(string name)

Returns the module with the given name, or null if not found.

getModuleList
string[2][] getModuleList()

Returns a list of modules.

getModuleNum
sizediff_t getModuleNum(string name)

Returns the number of the module, or -1 if the module name does not exist.

getPresetList
auto getPresetList(string modID)

Returns the list of presets associated with the module identified by modID.

getRoutingTable
string[2][] getRoutingTable()

Returns the routing table of this audio configuration as an array of pairs of strings.

getWaveFileList
WaveFileData[] getWaveFileList(string modID)

Returns the waveform list belonging to the audio module identified by modID.

loadAudioFile
void loadAudioFile(string modID, int waveID, string path, string dataPak)

Loads an audio file into the given audio module. This function is external, with the intent of being able to alter default voicebanks for e.g. mods, localizations, etc.

loadAudioFile
void loadAudioFile(AudioModule mod, int waveID, string path, string dataPak)

Loads an audio file into the given audio module.

loadConfig
void loadConfig(string src)

Loads a configuration file from text.

loadConfigFromFile
void loadConfigFromFile(string path)

Loads a configuration file from file

loadVocFile
void loadVocFile(AudioModule mod, int waveID, string path, string dataPak)

Loads a Dialogic ADPCM (voc/af4) file into a module.

loadWaveFile
void loadWaveFile(AudioModule mod, int waveID, string path, string dataPak)

Loads a Microsoft Wave (wav) file into a module.

removeModule
Tag removeModule(string name)

Removes a module from the configuration.

removePreset
Tag removePreset(string modID, int presetID)

Removes a preset from the configuration.

removeRouting
bool removeRouting(string from, string to)

Removes a routing from the audio configuration.

removeWave
Tag removeWave(string modID, int waveID)

Removes a waveform identified by waveID from the module described by modID, then returns the configuration tag as backup. Returns null if module and/or waveform not found.

renameModule
void renameModule(string oldName, string newName)

Renames a module.

renameWave
string renameWave(string modID, int waveID, string newName)

Renames a wave file definition. Does not affect internal waves if they're overridden.

save
void save(string path)

Saves the configuration into a file.

setMIDIrouting
void setMIDIrouting(uint[] table)

Creates a MIDI routing table from the supplied values.

Static variables

outChannelNames
string[] outChannelNames;

Registered output channel names.

Structs

RoutingNode
struct RoutingNode

Defines a routing node. Can contain multiple inputs and outputs.

Variables

manager
ModuleManager manager;

The target for audio handling.

midiGroups
ubyte[] midiGroups;

Group identifiers for tracks.

midiRouting
uint[] midiRouting;

Track routing for MIDI devices.

modNames
string[] modNames;

The names of the modules.

modules
AudioModule[] modules;

The audio modules stored by this configuration.

rns
RoutingNode[] rns;

Routing nodes that have been parsed so far.

root
Tag root;

Stores most of the document data here when uncompiled.

Meta