QcPenPrinter: no need to allocate QPrintDialog on heap
[supercollider.git] / HelpSource / Classes / Done.schelp
blob3a0a8213ac076596c127c20d104d588bbad72410
1 class:: Done
2 summary:: Monitors another UGen to see when it is finished
3 related:: Classes/FreeSelfWhenDone, Classes/PauseSelfWhenDone, Reference/UGen-doneActions
4 categories::  UGens>Synth control
6 Description::
8 Some UGens set a 'done' flag when they are finished playing. This UGen echoes that flag when it is set to track a particular UGen.
10 The UGens trackable by Done are:
11 list::
12 ## link::Classes/PlayBuf::
13 ## link::Classes/RecordBuf::
14 ## link::Classes/Line::
15 ## link::Classes/XLine::
16 ## link::Classes/EnvGen::
17 ## link::Classes/Linen::
18 ## link::Classes/BufRd::
19 ## link::Classes/BufWr::
20 ## link::Classes/Dbufrd::
21 ## link::Classes/Dbufwr::
22 ## link::Classes/DiskIn::
23 ## link::Classes/VDiskIn::
24 ## link::Classes/Demand::
27 classmethods::
28 private:: categories
30 method::kr
32 argument::src
34 UGen to monitor
36 examples::
37 The 'done' flag can be used to trigger other things in the same synth:
38 code::
40 SynthDef("Done-help", { arg out, t_trig;
41         var line, a, b;
43         line= Line.kr(1,0,1);
45         a= SinOsc.ar(440,0,0.1*line); //sound fading out
46         b= WhiteNoise.ar(Done.kr(line)*0.1); //noise starts at end of line
48         Out.ar(out, Pan2.ar(a+b));
49 }).send(s);
52 Synth("Done-help"); //note that this synth doesn't have it's own doneAction, so you'll need to manually deallocate it
54 The 'done' flag can be used to trigger a delayed freeing of the current synth, which is not possible by using link::Reference/UGen-doneActions:: :
55 code::
56 play {
57     var env = Line.kr(1,0,2);
58     var sig = PinkNoise.ar(env);
59     FreeSelf.kr(TDelay.kr(Done.kr(env),3));
60     GVerb.ar(sig,70,7);