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

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

On Jan 2, 2006, at 10:07 PM, James Harkins wrote:

On Jan 2, 2006, at 3:56 PM, rkuivila@xxxxxxxxxxxx wrote:

Are you using an old build?

One of the mysteries of cvs I guess... I updated from cvs well after the last update for Stream.sc shown in the cvs log, but I didn't get that change. ???

Yeah, I keep a clean copy without any changes to update.

Must have been due to some changes in my copy that I've yet to commit, specifically the following. I posted this for approval a couple of weeks ago but no one bothered to object--does that mean it's OK? see http://www.create.ucsb.edu/pipermail/sc-users/2005-September/020832.html

Seems like no one objected...
BTW, another way to handle this is to create a new EventStreamPlayer whenever you play.
That way there is no interaction with the previous ESP.

play { arg argClock, doReset = (false), quant=0.0;
if (stream.notNil, { "already playing".postln; ^this });
if (doReset, { this.reset });
clock = argClock ? clock ? TempoClock.default;
streamHasEnded = false;
stream = originalStream; 
isWaiting = true; // make sure that accidental play/stop/play sequences
// don't cause memory leaks
if(isWaiting and: { nextBeat.isNil }) {
clock.sched(0, this);
isWaiting = false;
}, quant);
stop {
stream = nil;
isWaiting = false;
pause {
stream = nil;
isWaiting = false;

Plus removing the separate definition of EventStreamPlayer-play, which is identical to PauseStream-play anyway.


: H. James Harkins

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

sc-dev mailing list