aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Runge <dave@sleepmap.de>2016-08-06 16:37:35 +0200
committerDavid Runge <dave@sleepmap.de>2016-08-06 16:37:35 +0200
commit3f7188b61fff41ba67ef264b33825dffd3cf5e57 (patch)
tree2a6da252a95952ba8cdc8cea24cba93ba431c640
parent89ae79e509ab153baa63e6c42f931121f6319f1c (diff)
downloadbowelyzer-3f7188b61fff41ba67ef264b33825dffd3cf5e57.tar.gz
bowelyzer-3f7188b61fff41ba67ef264b33825dffd3cf5e57.tar.bz2
bowelyzer-3f7188b61fff41ba67ef264b33825dffd3cf5e57.tar.xz
bowelyzer-3f7188b61fff41ba67ef264b33825dffd3cf5e57.zip
classes/Bowelyzer.sc: Moving the adding of the Server instance into a separate function. Adding the initialization with options, providing the Server.default options, so that startup.scd is actually honored.
-rw-r--r--classes/Bowelyzer.sc26
1 files changed, 21 insertions, 5 deletions
diff --git a/classes/Bowelyzer.sc b/classes/Bowelyzer.sc
index 7f75720..28166ca 100644
--- a/classes/Bowelyzer.sc
+++ b/classes/Bowelyzer.sc
@@ -11,11 +11,7 @@ Bowelyzer{
//initialize with configuration, if available (else use default)
arg configFile;
config = BowelyzerConfig.new(configFile);
- server = Server.new(
- \bowelyzer,
- NetAddr.new(config.config.at(\synthServerAddress), config.config.at(\synthServerPort))
- );
- Server.default = server;
+ this.addServer;
server.waitForBoot({
this.setupNetAddressesFromConfig(config.config);
this.setupSynthListenersFromConfig(config.config);
@@ -28,6 +24,26 @@ Bowelyzer{
{"scsynth failed to start!".postln});
}
+ // add a scsynth server and make it the default
+ addServer{
+ var addr = NetAddr.new(config.config.at(\synthServerAddress), config.config.at(\synthServerPort));
+ // if the NetAddr is local, boot locally, otherwise remote
+ if(addr.isLocal,{
+ server = Server.new(
+ name: \bowelyzer,
+ addr: addr,
+ options: Server.default.options
+ );
+ },{
+ server = Server.remote(
+ name: \bowelyzer,
+ addr: addr,
+ options: Server.default.options
+ );
+ });
+ Server.default = server;
+ }
+
// add OSCdefs listening for GUI events
addGUIListeners{
// listen for control changes