diff options
author | David Runge <dave@sleepmap.de> | 2016-07-06 19:31:10 +0200 |
---|---|---|
committer | David Runge <dave@sleepmap.de> | 2016-07-06 19:31:10 +0200 |
commit | 3415ffa52d0e3a9f42b9fe7ee807ebd860926b27 (patch) | |
tree | 8ca11ea0b2196b27cf0cba319d3a525eedf911f4 /classes | |
parent | d0a2da650e8551f5e40b7b432738c27b345b33ec (diff) | |
download | bowelyzer-3415ffa52d0e3a9f42b9fe7ee807ebd860926b27.tar.gz bowelyzer-3415ffa52d0e3a9f42b9fe7ee807ebd860926b27.tar.bz2 bowelyzer-3415ffa52d0e3a9f42b9fe7ee807ebd860926b27.tar.xz bowelyzer-3415ffa52d0e3a9f42b9fe7ee807ebd860926b27.zip |
classes/Bowelyzer.sc: Adding OSCdefs for saving and loading of configuration file.
Diffstat (limited to 'classes')
-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. }, |