[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sc-dev] Re: calling the stream upon EventStreamPlayer-stop

On 12/27/05, James Harkins <jamshark70@xxxxxxxxx> wrote:
>         stop { stream.next(nil); stream = nextBeat = nil;  }
> Can we provide a way to override the stream.next(nil)? This is causing
> me major trouble in some new stuff I'm developing. If the stream is a
> routine instead of a Pbind, I will have to write a nil check into every
> routine I write. Not fun.

OK, I'm working around this for now by wrapping the routine in a FuncStream:

Prt : Prout {
	asStream {
		var	stream = super.asStream;
		^FuncStream({ |inval|
			inval.notNil.if({ stream.next(inval) });

It would be nice to leverage the cleanliness of embedInStream, though.

Can anyone think of a better solution?

James Harkins /// dewdrop world

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal."  -- Whitman