deprecate SCViewHolder-layRight
[supercollider.git] / SCClassLibrary / Common / Streams / Rest.sc
blob3285eb371d8e09cf43e7d37fdd4d13f28fb8c5e1
1 Rest {
2         var <>dur = 1;
3         *new { |dur(1)|
4                 ^super.newCopyArgs(dur)
5         }
6         // for use by Pfunc and Pfuncn
7         *processRest { |inval|
8                 inval.put(\isRest, true);
9                 ^1
10         }
11         processRest { |inval|
12                 inval.put(\isRest, true);
13                 ^dur
14         }
15         // for use e.g. in ListPatterns
16         *embedInStream { |inval|
17                 ^this.processRest(inval).yield;  // the actual return value is the next inval
18         }
19         embedInStream { |inval|
20                 ^this.processRest(inval).yield;
21         }
22         *asStream {
23                 ^Routine({ |inval|
24                         loop {
25                                 inval = this.embedInStream(inval);
26                         }
27                 })
28         }
29         asStream {
30                 ^Routine({ |inval|
31                         loop {
32                                 inval = this.embedInStream(inval);
33                         }
34                 })
35         }
38 + Object {
39         processRest { ^this }
42 + Collection {
43         processRest { |inval|
44                 this.do(_.processRest(inval))
45         }
49 + SimpleNumber {
50         // Some patterns call .delta on the eventstream's yield value
51         // since a SimpleNumber is a valid rest, it must answer 'delta' with itself
52         delta {}