PlayStopped message

miscdas at boxfrog.com miscdas at boxfrog.com
Sat Jan 18 07:48:00 EST 2003


[snip]Howard Bornstein writes: 

>>How can I safely capture the end of a song being played ?
>  
> 
> I handled it this way within the Playstopped handler: 
> 
>   if the currenttime of player "thePlayer" = 0 then
>     exit playstopped
>   end if
> Unfortunately, this doesn't explain WHY playStopped is called when the  player is set to a new file name. Does anyone understand this? Is this a  bug in Rev? 
> 
> Regards, 
> 
> Howard Bornstein

Assuming audio and video behave the same in this instance, then an active 
player must be stopped before the next clip begins, because no mixing is 
supported. 

MetaCard provides an explanation of calling playStopped when a new file name 
is set . MetaTalk Reference (197) play:
"If a play command for an audio clip is executed before a previous play has 
completed, the current sound will stop before the new one is started (no 
mixing is supported). The message playStopped is sent to the current card of 
the stack that was the defaultStack when the clip finishes playing." 

I didn't check this, but let's assume that for "the current sound will 
stop..." requires that a playStopped to be received. Further, let's assume 
any time a clip is started (via a play command or a file name change, or 
whatever) the message playStopped is first sent to ensure the player is 
stopped (even if it is already stopped), then the clip starts. 

What would happen if a clip is playing and a play command is executed 
without the clip being stopped first? An application crash? An OS crash? The 
player plays the clip as expected? The new clip begins playing at the time 
that was on the previous clip when it was cut off? Nothing at all (the 
system appears to hang)? 

miscdas 



More information about the use-livecode mailing list