Re: Design issue related to my problem with NSSound -isPlaying
Re: Design issue related to my problem with NSSound -isPlaying
- Subject: Re: Design issue related to my problem with NSSound -isPlaying
- From: Graham Cox <email@hidden>
- Date: Mon, 23 Jul 2012 20:26:48 +1000
On 23/07/2012, at 8:10 PM, Jay Reynolds Freeman wrote:
> So: In Cocoa, is there a reasonable approach to getting things to happen quickly, that works when call-back on the main event loop isn't fast enough? It is probably not a matter of great consequence for my situation, but it might matter more to others, and it is an interesting design challenge in any case.
The main event loop is fast enough. The problem you have is that you're scheduling work on it that isn't fast enough. Perhaps you need to move that work to a thread, or break it into chunks that can be done over several runs of the loop.
Synching sound and visual animation usually works by triggering events at the same time and arranging that they take about the same time. Core Animation includes callbacks to trigger the next step in a series of animations, and that can include sound, and sound playback includes events that can be used to trigger animations or sounds.
Used properly, Core Animation is pretty powerful, and it doesn't demand any special techniques to make it "fast enough". Its animations are done using threads anyway.
--Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden