diff options
author | David Runge <dave@sleepmap.de> | 2016-07-24 19:10:18 +0200 |
---|---|---|
committer | David Runge <dave@sleepmap.de> | 2016-07-24 19:10:18 +0200 |
commit | 3596bc7746eca614bc315cf41bbffedb02a7a8e8 (patch) | |
tree | b460449f82be27bf1af944a4a3cac888af7ceebf /classes/BowelyzerGUI.sc | |
parent | feb51029a6e09775bef9a56e6dcc5c0d1c9402c6 (diff) | |
download | bowelyzer-3596bc7746eca614bc315cf41bbffedb02a7a8e8.tar.gz bowelyzer-3596bc7746eca614bc315cf41bbffedb02a7a8e8.tar.bz2 bowelyzer-3596bc7746eca614bc315cf41bbffedb02a7a8e8.tar.xz bowelyzer-3596bc7746eca614bc315cf41bbffedb02a7a8e8.zip |
classes/BowelyzerGUI.sc: Updating the setupEZRanger function to draw its children properly and add default lo/hi values, using the same bounds as EZSlider.
Diffstat (limited to 'classes/BowelyzerGUI.sc')
-rw-r--r-- | classes/BowelyzerGUI.sc | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/classes/BowelyzerGUI.sc b/classes/BowelyzerGUI.sc index b769203..99f271a 100644 --- a/classes/BowelyzerGUI.sc +++ b/classes/BowelyzerGUI.sc @@ -443,9 +443,9 @@ BowelyzerGUI{ arg parent, type, name, value; switch( type.asSymbol, - \knob, {this.setupEZKnob(parent, name, value, \controls, name).view.children.do({|item| if(item.isKindOf(NumberBox),{item.align_(\right)})})}, + \knob, {this.setupEZKnob(parent, name, value)}, \slider, {this.setupEZSlider(parent, name, value)}, - \ranger, {this.setupEZRanger(parent, name, value, \controls, name).view.children.do({|item| if(item.isKindOf(NumberBox),{item.align_(\right)})})} + \ranger, {this.setupEZRanger(parent, name, value)} ); } @@ -951,26 +951,37 @@ BowelyzerGUI{ }); } + // setup a ranger setupEZRanger{ arg parent, control, value; - ^EZRanger( + var unit; + unit = EZRanger( parent: parent, - bounds: 300@16, + bounds: sliderWidth@sliderHeight, label: control, - controlSpec: control, + initVal: value, + controlSpec: control.asSymbol, action: { arg controlUnit; var address = NetAddr.new("127.0.0.1", NetAddr.langPort), - type = "/"++controlUnit.view.parent.name.asString, - name = controlUnit.view.parent.parent.parent.name.asSymbol, + type = "/"++controlUnit.view.parent.parent.name.asString, + name = controlUnit.view.parent.parent.parent.parent.name.asSymbol, controlName = controlUnit.labelView.string.asSymbol, controlValue = controlUnit.value; - address.sendMsg(type, name, controlName, controlValue); + address.sendMsg(type, name, controlName, controlValue[0], controlValue[1]); }, - labelWidth: 120, + layout: \line2, + numberWidth: 60, unitWidth:30 - ) - ; + ); + unit.view.children.do({|item| + if(item.isKindOf(NumberBox), { + item.align_(\right); + }); + if(item.isKindOf(RangeSlider), { + item.orientation_(\horizontal); + }); + }); } setupEZKnob{ |