PdefEditor a line of editing controls for a Pdef.
PdefEditor uses the GUI class to be platform independent;
it also uses the Document class which is not cross-platform yet.
name button:
when selected, typing the delete key will delete its Pdef.
play/stop button :
indicates whether the Pdef is playing:
" >" if it is stopped,
" _" if it is playing and active,
" |" if it is playing, but the stream has ended.
pause/resume button:
only visible if one can pause or resume the Pdef.
"paus" when you can pause it,
"rsum" when you can resume it.
src button:
opens a document to edit the source (function) of the Pdef.
green if a source exists, white if not.
env button:
opens a document to edit the environment of the Pdef,
which is where one can keep all variables the Pdef uses
for easy access.
green if the Pdef has an envir, white if not.
(
Pdef(\a, Pbind(\freq, 200));
t = PdefEditor(Pdef(\a), 4);
Pdef(\a).set(\otto, 12, \ann, 1234);
)
Pdef(\a).stop;
Pdef(\a).play;
Pdef(\a).pause;
Pdef(\a).resume;
t.proxy_(nil);
t.proxy_(Pdef(\a));
Pdef(\b, Pbind(\freq, 300, \dur, 2/3));
Pdef(\b).play;
PdefEditor(Pdef(\b));
// see all Pdefs:
PdefAllGui(8);
See also PdefAllGui, TdefAllGui, TdefEditor.
// full test suite for PdefEditor:
t = PdefEditor();
t.proxy_(Pdef(\a));
t.proxy_(Pdef(\b));
t.proxy_(nil);
t.proxy_(Pdef(\a));
Pdef(\a, Pbind(\freq, 150));
Pdef(\a).source_(nil);
Pdef(\a).set(\otto, 2);
Pdef(\a).envir_(nil);
Pdef(\a, Pbind(\freq, 150));
Pdef(\a).play;
Pdef(\a).pause;
Pdef(\a).resume;