aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Runge <dave@sleepmap.de>2016-07-25 02:45:26 +0200
committerDavid Runge <dave@sleepmap.de>2016-07-25 02:45:26 +0200
commitc4e9b7b33b80b509aca52f9df5d6021038efab77 (patch)
tree2451da26393f3c636e3677c83b90c1c6de1d4f41
parent7a72cd50582f838fc625ce56fe38c5bf4152a955 (diff)
downloadbowelyzer-c4e9b7b33b80b509aca52f9df5d6021038efab77.tar.gz
bowelyzer-c4e9b7b33b80b509aca52f9df5d6021038efab77.tar.bz2
bowelyzer-c4e9b7b33b80b509aca52f9df5d6021038efab77.tar.xz
bowelyzer-c4e9b7b33b80b509aca52f9df5d6021038efab77.zip
classes/BowelyzerGUI.sc: Adding a CheckBox to the general controls of the channelView for setting the behavior of whether to forward OSC messages for the given channel, only if the pitch detected was new.
-rw-r--r--classes/BowelyzerGUI.sc16
1 files changed, 16 insertions, 0 deletions
diff --git a/classes/BowelyzerGUI.sc b/classes/BowelyzerGUI.sc
index 99f271a..fc5444b 100644
--- a/classes/BowelyzerGUI.sc
+++ b/classes/BowelyzerGUI.sc
@@ -426,6 +426,7 @@ BowelyzerGUI{
});
});
},{
+ this.setupCheckBox(controlsSubView, \onlyForwardOnNewPitch);
config.at(\controls).at(name).order.do({|controlName, i|
var value = config.at(\controls).at(name).at(controlName),
type = BowelyzerConfig.controlContainedIn(controlName);
@@ -438,6 +439,21 @@ BowelyzerGUI{
controlsSubView.minSize_((controlsViewWidth-8)@(controlsSubView.children.size*(sliderHeight+4)));
}
+ // setup a CheckBox on whether to only forward OSC messages, if a new pitch was detected
+ setupCheckBox{
+ arg parent, control;
+ var unit = CheckBox.new(parent: parent, bounds: sliderWidth@buttonHeight);
+ if(control == \onlyForwardOnNewPitch, {
+ unit.string_("Only forward on new pitch");
+ unit.action_({|unit|
+ var address = NetAddr.new("127.0.0.1", NetAddr.langPort),
+ type = "/"++unit.parent.parent.name.asString,
+ name = unit.parent.parent.parent.parent.name.asString;
+ address.sendMsg(type, name, control, unit.value);
+ });
+ });
+ }
+
//setup a control from configuration (adhering to its type)
setupControlFromConfig{
arg parent, type, name, value;