Re: NSSound: Why Doesn't This Work?
Re: NSSound: Why Doesn't This Work?
- Subject: Re: NSSound: Why Doesn't This Work?
- From: "Ben Kennedy" <email@hidden>
- Date: Sat, 2 Nov 2002 18:55:41 -0500
- Organization: Zygoat Creative Technical Services
On 02,11,02 at 6:44 pm -0500, Michael Urban wrote:
>
Why does the following program never terminate? I could swear it used
>
to in 10.0 or thereabouts....
From the appkit release notes:
>
NSSound now uses QuickTime to play most sound files/URLs, including
>
streaming non-file URLs from the Internet. Since QuickTime requires the
>
run loop to be run for sound (or movies) to continue playing, NSSound now
>
requires this as well. The delegate -sound:didFinishPlaying: will also
>
not be called unless the run loop is run. By "run loop", what is meant is
>
the run loop on the thread which starts the sound playing. For Cocoa
>
applications, this is not a big deal for sounds played by the main
>
thread, as Cocoa apps normally let the AppKit handle running the run loop
>
on the main thread. But in other situations you will need to be aware of
>
this requirement.
So I gather that NSSound never has the opportunity to update its
'playing' status, since the run loop never goes through an iteration (you
effectively sleep(2) ad infinitum).
-b
--
Ben Kennedy, chief magician
zygoat creative technical services
613-228-3392 | 1-866-466-4628
http://www.zygoat.ca
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.