From c4e9b7b33b80b509aca52f9df5d6021038efab77 Mon Sep 17 00:00:00 2001 From: David Runge Date: Mon, 25 Jul 2016 02:45:26 +0200 Subject: 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. --- classes/BowelyzerGUI.sc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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; -- cgit v1.2.3-70-g09d2