diff options
Diffstat (limited to 'classes/Bowelyzer.sc')
-rw-r--r-- | classes/Bowelyzer.sc | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/classes/Bowelyzer.sc b/classes/Bowelyzer.sc index cafaf00..4c4f079 100644 --- a/classes/Bowelyzer.sc +++ b/classes/Bowelyzer.sc @@ -170,25 +170,39 @@ Bowelyzer{ srcID: hub.local ); - // listen for port messages to change OSC ports + // listen for message to save configuration to current file OSCdef.newMatching( key: \save, func: {|msg, time, addr, recvPort| var path = msg[1]; postln("Received: "++msg); - //TODO: implement save (write to file) in BowelyzerConfig + config.writeConfigurationFile; }, path: "/save", srcID: hub.local ); - // listen for port messages to change OSC ports + // listen for message to save configuration to current file + OSCdef.newMatching( + key: \saveas, + func: {|msg, time, addr, recvPort| + var name = msg[0], + fileName = msg[1]; + postln("Received: "++msg); + config.writeConfigurationFile(fileName); + }, + path: "/saveas", + srcID: hub.local + ); + + // listen for messages to load configuration from file OSCdef.newMatching( key: \load, func: {|msg, time, addr, recvPort| - var path = msg[1]; + var name = msg[0], + fileName = msg[1]; postln("Received: "++msg); - //TODO: use BowelyzerConfig readFromConfigurationFile + config.writeConfigurationFile(fileName); //TODO: destroy current GUI elements //TODO: load channels, etc. }, |