Skip to content

Commit

Permalink
re-enable useRanger on EnvirGui and ParamView. addresses supercollide…
Browse files Browse the repository at this point in the history
  • Loading branch information
adc committed Oct 9, 2016
1 parent 8caa0a0 commit 9e9d78b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion SCClassLibrary/JITLib/GUI/EnvirGui.sc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ EnvirGui : JITGui {

paramViews = {
ParamView(zone, Rect(0, 0, bounds.width - 20, height))
.background_(skin.background);
.background_(skin.background)
.useRanger_({ this.useRanger });
}.dup(numItems);
paramViews.do { |pv| pv.zone.visible_(false); };

Expand Down
3 changes: 2 additions & 1 deletion SCClassLibrary/JITLib/GUI/NdefParamGui.sc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ NdefParamGui : EnvirGui {

var parView = ParamView(zone, Rect(0, 0, bounds.width - sinkWidth - 20, height))
// .resize_(2)
.background_(skin.background);
.background_(skin.background)
.useRanger_({ this.useRanger });

parView.zone.visible_(false);

Expand Down
8 changes: 5 additions & 3 deletions SCClassLibrary/JITLib/GUI/ParamView.sc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ ParamView {
var <value, <label, <>action, <spec;
var <zone, <zones, <slider, <ranger, <textview;
var <ezviews, <currview, <viewType;
var <>useRanger = true;

*new { |parent, bounds, label, spec, action, initVal, initAction = false|
^super.new.init(parent, bounds, label, spec, action, initVal, initAction);
Expand Down Expand Up @@ -53,6 +54,9 @@ ParamView {

// types: 0 = slider, 1 = ranger, 2 = text
viewType_ { |newType = 0, force = false|
if (spec.isNil or: { useRanger.value != true }) {
newType = newType.roundUp(2);
};
if (force or: { newType != viewType }) {
if (newType.inclusivelyBetween(0, 2)) {
zones.do { |z, i| z.visible_(newType == i) };
Expand All @@ -74,9 +78,7 @@ ParamView {
}

value_ { |val|
if (val != value) {
this.viewType_(this.valueType(val));
};
this.viewType_(this.valueType(val));
value = val;
currview.value_(value);
}
Expand Down

0 comments on commit 9e9d78b

Please sign in to comment.