aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Runge <dave@sleepmap.de>2016-07-09 18:07:56 +0200
committerDavid Runge <dave@sleepmap.de>2016-07-09 18:07:56 +0200
commit59595414c7cb126f12fcdccb0d99300cfba49b2f (patch)
treed9ddda4e3e79f3880b28538422b9be231989aadd
parent8826d0bf77fe0db4c2dc6553e06cdf7bfc286578 (diff)
downloadbowelyzer-59595414c7cb126f12fcdccb0d99300cfba49b2f.tar.gz
bowelyzer-59595414c7cb126f12fcdccb0d99300cfba49b2f.tar.bz2
bowelyzer-59595414c7cb126f12fcdccb0d99300cfba49b2f.tar.xz
bowelyzer-59595414c7cb126f12fcdccb0d99300cfba49b2f.zip
classes/BowelyzerConfig.sc: Moving the setting of configFilePath into readConfigurationFile (on success of reading and validating), as this makes outside calls less complicated. Adding the possibility of inserting predefined names, that are not nil, not empty and not yet included in the config, using addInput, instead of relying solely on uniqueIdentifiers.
-rw-r--r--classes/BowelyzerConfig.sc13
1 files changed, 8 insertions, 5 deletions
diff --git a/classes/BowelyzerConfig.sc b/classes/BowelyzerConfig.sc
index b521203..3a3ebe6 100644
--- a/classes/BowelyzerConfig.sc
+++ b/classes/BowelyzerConfig.sc
@@ -98,8 +98,6 @@ BowelyzerConfig{
if(this.readConfigurationFile(configFile).not,{
error("Reading of configuration file failed. Using default.");
config = defaultConfig;
- },{
- configFilePath = configFile;
});
},{
("No configuration file provided. Using default.").postln;
@@ -217,6 +215,7 @@ BowelyzerConfig{
postln("Reading of configuration complete. Now validating...");
if(this.validateConfig,{
postln("Validation complete.");
+ configFilePath = configFile;
^true;
},{
postln("Validation failed.");
@@ -414,10 +413,14 @@ BowelyzerConfig{
// add an input with standard controls to the config
addInput{
- var name = this.createUniqueIdentifier;
- config.at(\inputs).put(name, 0);
+ arg name;
+ var id = this.createUniqueIdentifier;
+ if((name.notNil && (name != "") && config.at(\inputs).includesKey(name).not), {
+ id = name;
+ });
+ config.at(\inputs).put(id, 0);
this.validateConfig;
- ^name;
+ ^id;
}
// create a unique identifier of the form msg[number]