• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Polling a Clock
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Polling a Clock


  • Subject: Polling a Clock
  • From: Maximilian Marcoll <email@hidden>
  • Date: Wed, 12 May 2010 13:07:58 +0200

Hello Everybody!

I'm having some difficulties figuring out the best way to poll a CAClock.
To "trigger" objects in an array at specific points in time, I set up a CAClock, and use CAClockGetCurrentTime()
within a loop to determine if there are objects I have to trigger.

My code looks something like this:

	while( [list count] ) {
		CAClockGetCurrentTime(clock, kCAClockTimeFormat_Seconds, &T);
		// display current time
		while( [list count] && T.time.seconds >= [[list objectAtIndex:0] start]){
			[[list objectAtIndex:0] trigger];
			[list removeObjectAtIndex:0];
		}
	}


Polling a clock like this seems to be a bit extreme.
(This code actually activates my MacBook's fan ;o)
I thought maybe I could use a CFRunLoop, but it's use of  NSTimers would be a problem I think.
I would need to poll the clock every millisecond.
What would you do?

Thank you!

Max _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Polling a Clock
      • From: Jeff Moore <email@hidden>
  • Prev by Date: Re: Building the CarbonView as a separate component?
  • Next by Date: CoreAudio Wifi MIDI Server maybe
  • Previous by thread: Re: Building the CarbonView as a separate component?
  • Next by thread: Re: Polling a Clock
  • Index(es):
    • Date
    • Thread