File: ParamView.schelp

package info (click to toggle)
supercollider 1%3A3.13.0%2Brepack-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 80,292 kB
  • sloc: cpp: 476,363; lisp: 84,680; ansic: 77,685; sh: 25,509; python: 7,909; makefile: 3,440; perl: 1,964; javascript: 974; xml: 826; java: 677; yacc: 314; lex: 175; objc: 152; ruby: 136
file content (102 lines) | stat: -rw-r--r-- 2,108 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
TITLE:: ParamView
summary:: show a parameter of a JITLib process
categories:: JITLib
related:: Classes/JITGui, Overviews/JITLib

DESCRIPTION::
ParamView displays a parameter value, and switches representation as appropriate for value: A single number is shown by an EZSlider, a pair of numbers by an EZRanger, and anything else as code on an EZText.

First examples:
code::

w = Window("test", Rect(20, 820, 400, 100)).front;
w.addFlowLayout;
~pv = ParamView(w, Rect(20, 20, 360, 20));
~pv2 = ParamView(w, Rect(20, 20, 360, 40));

// not working properly yet
~pv.bounds_(Rect(4, 4, 300, 40));

~pv.dump
~pv.viewType_(0); // EZNumber
~pv.viewType_(1); // EZRanger
~pv.viewType_(2); // EZText

~pv.label_(\freq);
~pv.spec_(\freq);  // needs spec for EZSlider


~pv.value_(200);
~pv.value_(2000);
// switches to EZRanger
~pv.value_([200, 2000]);
// 3 numbers -> switches to EZText
~pv.value_([20, 200, 2000]);
// anything else -> EZText
~pv.value_(\blonk);
~pv.action = { |pv| pv.value.postcs };

::

CLASSMETHODS::

METHOD:: new
create a new ParamView with
ARGUMENT:: parent
the parent window or view
ARGUMENT:: bounds
the bounds of the view
ARGUMENT:: label
a label to display
ARGUMENT:: spec
a controlspec for the value
ARGUMENT:: action
an action to do when the value changes
ARGUMENT:: initVal
an initial value
ARGUMENT:: initAction
a boolean whether to perform the action on init.


INSTANCEMETHODS::

METHOD:: label
get and set the view's label

METHOD:: spec
get and set the view's control spec

METHOD:: action
get and set the paramview's action

private:: zone, zones

METHOD:: ezviews, slider, ranger, textview
the 3 ezviews between which the ParamView switches

METHOD:: currview
the currently shown view of these

METHOD:: value
get and set value

METHOD:: valueAction
get and set value and do action

METHOD:: doAction
do the view's action

METHOD:: viewType
get and set the view's type:
0 is single number -> EZSlider,
1 is pair of numbers -> EZRanger,
2 is anything else

METHOD:: valueType
determine viewType for a given value


METHOD:: background
get and set background color

private:: init