[Newbies] Wait for an external app
leves at elte.hu
Sun Nov 7 15:58:28 UTC 2010
On Sun, 7 Nov 2010, Sean P. DeNigris wrote:
> While controlling QuickTime Player via Applescript from within the image, I
> want to play a CD track until it reaches a certain point. QTP does not
> expose "playTo: aPosition" functionality, so I'm polling the track position
> until the time is reached. I don't want to lock up Morphic, so I'm doing
> this in another thread.
> The following works, but I've never used threads before and wanted to get
> opinions. What do you think?
> cd play.
> [ [ cd position < endTime ] whileTrue: [ Processor yield ].
> cd pause ] fork.
> * "cd position" gets the track position via Applescript
> * endTime is a variable holding the time to play until
This will starve lower priority processes, because Processor yield only
activates same or higher priority processes. A short delay is better.
> View this message in context: http://forum.world.st/Wait-for-an-external-app-tp3030911p3030911.html
> Sent from the Squeak - Beginners mailing list archive at Nabble.com.
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
More information about the Beginners