From 3f7188b61fff41ba67ef264b33825dffd3cf5e57 Mon Sep 17 00:00:00 2001 From: David Runge Date: Sat, 6 Aug 2016 16:37:35 +0200 Subject: 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. --- classes/Bowelyzer.sc | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'classes') 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 -- cgit v1.2.3-70-g09d2