PlayStopped message

Dave Cragg dcragg at lacscentre.co.uk
Sat Jan 18 11:22:01 EST 2003


At 7:40 pm +0000 17/1/03, Jez wrote:
>I want to detect when a song finishes playing in a Quicktime player control
>so that I can queue up another song (picked at random). The PlayStopped
>message seemed to be the obvious way of capturing this event. Trouble is,
>PlayStopped is also fired when you set the filename of the player to a new
>file (resulting in an infinite loop), and when the stack is closed, though
>intruigingly is NOT fired when you invoke a "stop player" command! How can I
>safely capture the end of a song being played ?

Not very elegant, but you can set the lockMessages before and after 
setting the filename. This will stop the playStopped message being 
sent.

lock messages
set the filename of player 1 to <filepath>
unlock messages

Cheers
Dave



More information about the use-livecode mailing list