• 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
my CoreAudio Clock won't stop!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

my CoreAudio Clock won't stop!


  • Subject: my CoreAudio Clock won't stop!
  • From: Chandrasekhar Ramakrishnan <email@hidden>
  • Date: Thu, 18 Jan 2007 15:32:14 +0100

I've noticed that the CAClock behaves that way as well. It seems that CAClockGetCurrentTime doesn't return useful information when the clock is not running. This is my code for dealing with it:

- (Float64)currentTimeSeconds
{
CAClockTime now;
OSStatus err;
if ([self isRunning])
err = CAClockGetCurrentTime(_clockRef, kCAClockTimeFormat_Seconds, &now);
else
err = CAClockGetStartTime(_clockRef, kCAClockTimeFormat_Seconds, &now);

if (err) {
ZKMORLogError(kZKMORLogSource_Clock, CFSTR("CAClockGetStartTime failed %u"), err);
return 0.f;
}
return now.time.seconds;
}


On Jan 17, 2007, at 9:28 AM, Ferguson, Paul wrote:

Can anyone shed some light on the following problem ?

A simple coreaudio Clock experiment in cocoa - interface code removed but minimal anyway..
.
.
CAClockRef pfClockRef;
CAClockTime pfTimestamp;
OSStatus osErr;
osErr = CAClockNew(0, &pfClockRef);     // sucessfully creates a new clock - appears to default to internal timebase = host
.
.
osErr = CAClockStart(pfClockRef);  //sucessfully starts the clock
.
.
osErr =  CAClockGetCurrentTime(pfClockRef, kCAClockTimeFormat_Seconds, &pfTimestamp);   //sucessfully prints running clock
printf("currentTime... returned error code %d, current time is%f\n", osErr, pfTimestamp.time.seconds);
.
.
osErr = CAClockStop(pfClockRef);    //not what I expected !! - instead of stopping the clock, the current time is stored as the new clockStartTime and the clock continues to run....
.
.

Many thanks in anticipation

Paul Fergy



--
C. Ramakrishnan
Illposed Software http://www.illposed.com



--
C. Ramakrishnan
Illposed Software http://www.illposed.com


 _______________________________________________
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

  • Prev by Date: Re: ioNumberPackets == 0 in ProduceOutputPackets()
  • Next by Date: Re: AudioDeviceGetCurrentTime after headphone plug/unplug
  • Previous by thread: Re: my CoreAudio Clock won't stop!
  • Next by thread: ioNumberPackets == 0 in ProduceOutputPackets()
  • Index(es):
    • Date
    • Thread