aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2015-11-30 11:15:00 +0100
committerGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2015-11-30 11:15:00 +0100
commitd1697b7f721b6d38fb0fbac2d5a31f1daf0dfcb0 (patch)
tree4cd1ded9997e69723bc4fe019bb8e8f15b6ab900
parent802d5c348466c4da6f3cf593f59ad20be4a66e8d (diff)
downloadchimaera_sc-d1697b7f721b6d38fb0fbac2d5a31f1daf0dfcb0.zip
chimaera_sc-d1697b7f721b6d38fb0fbac2d5a31f1daf0dfcb0.tar.gz
chimaera_sc-d1697b7f721b6d38fb0fbac2d5a31f1daf0dfcb0.tar.bz2
chimaera_sc-d1697b7f721b6d38fb0fbac2d5a31f1daf0dfcb0.tar.xz
update ChimaeraGroup to new attributes API.
-rw-r--r--classes/ChimaeraGroup.sc45
1 files changed, 27 insertions, 18 deletions
diff --git a/classes/ChimaeraGroup.sc b/classes/ChimaeraGroup.sc
index b96baa3..681f975 100644
--- a/classes/ChimaeraGroup.sc
+++ b/classes/ChimaeraGroup.sc
@@ -27,30 +27,39 @@ ChimaeraGroup {
}
get {|gid|
- config.sendMsg("/sensors/group/attributes/"++gid, {|msg|
- var x0 = msg[0];
- var x1 = msg[1];
- var no = msg[2].asBoolean;
- var so = msg[3].asBoolean;
- var s = msg[4].asBoolean;
-
+ config.sendMsg("/sensors/group/attributes/"++gid++"/min", {|msg|
+ Routine.run({
+ range[gid].lo = msg[0];
+ }, clock:AppClock);
+ });
+ config.sendMsg("/sensors/group/attributes/"++gid++"/max", {|msg|
+ Routine.run({
+ range[gid].hi = msg[0];
+ }, clock:AppClock);
+ });
+ config.sendMsg("/sensors/group/attributes/"++gid++"/north", {|msg|
+ Routine.run({
+ north[gid].value = msg[0].asBoolean;
+ }, clock:AppClock);
+ });
+ config.sendMsg("/sensors/group/attributes/"++gid++"/south", {|msg|
+ Routine.run({
+ south[gid].value = msg[0].asBoolean;
+ }, clock:AppClock);
+ });
+ config.sendMsg("/sensors/group/attributes/"++gid++"/scale", {|msg|
Routine.run({
- range[gid].lo = x0;
- range[gid].hi = x1;
- north[gid].value = no;
- south[gid].value = so;
- scale[gid].value = s;
+ scale[gid].value = msg[0].asBoolean;
}, clock:AppClock);
});
}
set {|gid|
- var x0 = range[gid].lo;
- var x1 = range[gid].hi;
- var no = north[gid].value;
- var so = south[gid].value;
- var s = scale[gid].value;
- config.sendMsg("/sensors/group/attributes/"++gid, x0, x1, no, so, s);
+ config.sendMsg("/sensors/group/attributes/"++gid++"/min", range[gid].lo);
+ config.sendMsg("/sensors/group/attributes/"++gid++"/max", range[gid].hi);
+ config.sendMsg("/sensors/group/attributes/"++gid++"/north", north[gid].value);
+ config.sendMsg("/sensors/group/attributes/"++gid++"/south", south[gid].value);
+ config.sendMsg("/sensors/group/attributes/"++gid++"/s", scale[gid].value);
}
init {|s, conf, rx|