class:: NdefParamGui
summary:: display the settings of a nodeproxy
categories:: Libraries>JITLib>GUI, Live Coding
related:: Classes/EZText, Classes/NdefGui, Classes/EnvirGui

description::

NdefParamGui displays all settings and mappings of a nodeproxy, so one can change them flexibly. Single number get displayed with an link::Classes/EZSlider::, and anything else is shown as an link::Classes/EZText:: (a text field). Its main use is within link::Classes/NdefGui::.

It inherits some useful methods from link::Classes/EnvirGui::.

ClassMethods::

subsection::Creation

method::new
create a new NdefParamGui

code::
// simple example - see also NdefGui!

g = NdefParamGui.new(nil, 5);	// empty with 5 slots
g.parent.alwaysOnTop_(true);
g.object_(Ndef(\a));		// put in a nodeproxy
Ndef(\a, { |freq = 300, amp = 0.2| SinOsc.ar(freq) * amp ! 2 }).play;
Ndef(\a).set(\freq, 200);	// add a setting
Ndef(\a);
g.object_(nil);			// put in nothing

g.object_(Ndef(\a)); 		// put in a nodeproxy
Ndef(\a).set(\amp, 0.125);	// add a setting
Ndef(\a, { |freq = 300, amp = 0.2| SinOsc.ar(freq) * amp });
Ndef(\a).set(\freq, 234);	// add a setting

Ndef(\a).play
Ndef(\lfo, { LFNoise0.kr([12, 8], 200).sum + 500 });
Ndef(\a).map(\freq, Ndef(\lfo));// mapped proxies are shown

g.useRanger = false;

//Multichannel controls are shown in EZText
g.putSpec(\freqs, \freq);
Ndef(\a, { |freqs = #[300, 303], pan, amp = 0.2| SinOsc.ar(freqs).sum * amp });
Ndef(\a).play
Ndef(\a).setn(\freqs, [300, 350])
Ndef(\a).setn(\freqs, [330, 350])
Ndef(\a).set(\harm, 123)

Ndef(\a).nodeMap.clear

Ndef(\lfos, { LFNoise0.kr([12, 8], 200) + 500 });
Ndef(\a).map(\freqs, Ndef(\lfos))

g.parent.close
::

argument::object
the nodeproxy whose settings are to be displayed.

argument::numItems
the number of items to display. If an envir is given, and no num, num is envir.size.

argument::parent
the parent view to display in; if none is given, a new window is created.

argument::bounds
the bounds within which to display; if none is given, bounds are calculated.

argument::makeSkip
flag whether to make a skipjack to manage updates of the envirgui. default is true.

argument::options
a list of additional information, e.g. flags about optional buttons.

InstanceMethods::

method::name
if in its own window, set the window's name

code::
g.name = "Yoohoo";
::

Examples::

code::
	// put an NdefParamGui in an existing window - margin becomes 0@0
(
w = Window().front;
w.addFlowLayout;
g = NdefParamGui(Ndef(\a), 3, w);
NdefParamGui(Ndef(\c), 15, w);
)
	// even
Ndef(\c).set(\otto, 123, \mops, [1,2,3], \kotzt, [0, 6, 0, 6]);
Ndef(\c).nodeMap.clear;
::
