aboutsummaryrefslogtreecommitdiffstats
path: root/classes/Bowelyzer.sc
diff options
context:
space:
mode:
authorDavid Runge <dave@sleepmap.de>2016-07-24 19:08:11 +0200
committerDavid Runge <dave@sleepmap.de>2016-07-24 19:08:11 +0200
commitfeb51029a6e09775bef9a56e6dcc5c0d1c9402c6 (patch)
tree2d5dd7aae5e4064253dd4cde1100430544de5613 /classes/Bowelyzer.sc
parent9e1e9988c22a56526cc8d62305a1413fa53f76e5 (diff)
downloadbowelyzer-feb51029a6e09775bef9a56e6dcc5c0d1c9402c6.tar.gz
bowelyzer-feb51029a6e09775bef9a56e6dcc5c0d1c9402c6.tar.bz2
bowelyzer-feb51029a6e09775bef9a56e6dcc5c0d1c9402c6.tar.xz
bowelyzer-feb51029a6e09775bef9a56e6dcc5c0d1c9402c6.zip
classes/Bowelyzer.sc: Extending the OSCdef for /controls to also handle controlValues with two values (RangeSlider values for example). Properly naming OSC message internals when listening for /controls (for readability).
Diffstat (limited to 'classes/Bowelyzer.sc')
-rw-r--r--classes/Bowelyzer.sc20
1 files changed, 16 insertions, 4 deletions
diff --git a/classes/Bowelyzer.sc b/classes/Bowelyzer.sc
index 1841cb7..f286587 100644
--- a/classes/Bowelyzer.sc
+++ b/classes/Bowelyzer.sc
@@ -36,12 +36,24 @@ Bowelyzer{
OSCdef.newMatching(
key: \controls,
func: {|msg, time, addr, recvPort|
+ var type = msg[0],
+ name = msg[1],
+ control = msg[2],
+ value = msg[3],
+ value2;
postln("Received: "++msg);
// if the control exists, change it
- if(msg[1].notNil && msg[2].notNil && msg[3].notNil,{
- if(config.config.at(\controls).includesKey(msg[1]),{
- if(config.config.at(\controls).at(msg[1]).includesKey(msg[2]),{
- config.config.at(\controls).at(msg[1]).put(msg[2], config.getControlValue(msg[2], msg[3]));
+ if(name.notNil && control.notNil && value.notNil,{
+ if(config.config.at(\controls).includesKey(name),{
+ if(config.config.at(\controls).at(name).includesKey(control),{
+ if(BowelyzerConfig.hasToBeArray.includes(control), {
+ if(msg[4].notNil, {
+ value2 = msg[4];
+ config.config.at(\controls).at(name).put(control, config.getControlValue(control, [value, value2]));
+ });
+ },{
+ config.config.at(\controls).at(name).put(control, config.getControlValue(control, value));
+ });
});
});
});