supernova: fixes for boost-1.49 and gcc-4.7
[supercollider.git] / Help / Streams-Patterns-Events / EventStream.html
blob7e70f2887104cae732ec2f8f7af764f88e7e515f
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <meta http-equiv="Content-Style-Type" content="text/css">
6 <title></title>
7 <meta name="Generator" content="Cocoa HTML Writer">
8 <meta name="CocoaVersion" content="949.43">
9 <style type="text/css">
10 p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Helvetica}
11 p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
12 p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
13 p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #ad140d}
14 p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco}
15 p.p6 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; min-height: 12.0px}
16 span.s1 {color: #0033f1}
17 span.s2 {color: #000000}
18 span.s3 {color: #001bb9}
19 span.s4 {color: #2c7014}
20 </style>
21 </head>
22 <body>
23 <p class="p1"><b>event stream</b></p>
24 <p class="p2"><br></p>
25 <p class="p3"><b>superclass: Object</b></p>
26 <p class="p2"><br></p>
27 <p class="p2"><br></p>
28 <p class="p3">An event stream is a normal <a href="Stream.html"><span class="s1">Stream</span></a> that returns events when called. (see class <a href="../Collections/Event.html"><span class="s1">Event</span></a>)</p>
29 <p class="p3">Usually, an event stream requires an event to be passed in, often the default event is used:</p>
30 <p class="p2"><br></p>
31 <p class="p4"><span class="s2">t = </span><span class="s3">Pbind</span><span class="s2">(</span><span class="s4">\x</span><span class="s2">, </span><span class="s3">Pseq</span><span class="s2">([1,2,3])).asStream; </span>// pbind, e.g. creates a stream</p>
32 <p class="p5">t.next(<span class="s3">Event</span>.default);</p>
33 <p class="p5">t.next(<span class="s3">Event</span>.default);</p>
34 <p class="p2"><br></p>
35 <p class="p3">An event stream cannot be played directly with a clock, as it returns events and not time values.</p>
36 <p class="p3">Therefore, an <a href="EventStreamPlayer.html"><span class="s1">EventStreamPlayer</span></a> is used, which replaces the event by according time value.</p>
37 <p class="p2"><br></p>
38 <p class="p3">a <b>Pevent</b> can be used to wrap a stream in an event:</p>
39 <p class="p2"><br></p>
40 <p class="p5">t = <span class="s3">Pevent</span>(<span class="s3">Pbind</span>(<span class="s4">\x</span>, <span class="s3">Pseq</span>([1,2,3])), <span class="s3">Event</span>.default).asStream;</p>
41 <p class="p5">t.next;</p>
42 <p class="p5">t.next;</p>
43 <p class="p6"><br></p>
44 </body>
45 </html>