• 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
Re: CAClockSetCurrentTime Help
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CAClockSetCurrentTime Help


  • Subject: Re: CAClockSetCurrentTime Help
  • From: Chad Williams <email@hidden>
  • Date: Tue, 03 Mar 2009 10:57:13 -0800
  • Thread-topic: CAClockSetCurrentTime Help

Title: Re: CAClockSetCurrentTime Help
Here are the values that I am assigning to clockTime.time. I am including the console readout and the code that works to convert SMPTE to seconds.

Thanks, Chad

{
    OSStatus err;
    //SMPTETime smpteTime;
    CAClockTime clockTime;
    //CAClockSeconds seconds;
    
    NSLog(@"SMPTE Time - %2.2hi:%2.2hi:%2.2hi:%2.2hi",(SInt16)[hhField intValue], (SInt16)[mmField intValue], (SInt16)[ssField intValue], (SInt16)[ffField intValue]);
    
    clockTime.format = kCAClockTimeFormat_SMPTETime;
    clockTime.time.smpte.mType = kSMPTETimeType30;
    clockTime.time.smpte.mHours = (SInt16)[hhField intValue];
    clockTime.time.smpte.mMinutes = (SInt16)[mmField intValue];
    clockTime.time.smpte.mSeconds = (SInt16)[ssField intValue];
    clockTime.time.smpte.mFrames = (SInt16)[ffField intValue];
    clockTime.time.smpte.mSubframeDivisor = 80;
    clockTime.time.smpte.mSubframes = 0;

    err = CAClockSetCurrentTime(clockRef, &clockTime);
    if (err != noErr) {
        NSLog(@"SMPTETimeToSecond err = %d", err);
        return;
    }
   
    /*
    smpteTime.mType = kSMPTETimeType30;
    smpteTime.mHours = (SInt16)[hhField intValue];
    smpteTime.mMinutes = (SInt16)[mmField intValue];
    smpteTime.mSeconds = (SInt16)[ssField intValue];
    smpteTime.mFrames = (SInt16)[ffField intValue];
    smpteTime.mSubframeDivisor = 80;
    smpteTime.mSubframes = 0;
    CAClockSMPTETimeToSeconds(clockRef, &smpteTime, &seconds);
    
    CAClockTime secondTime;
    secondTime.format = kCAClockTimeFormat_Seconds;
    secondTime.time.seconds = seconds;
    CAClockSetCurrentTime(clockRef, &secondTime);
    */
}

2009-03-03 10:49:21.794 FlexMTC[4038:10b] SMPTE Time - 02:00:01:26
2009-03-03 10:49:21.818 FlexMTC[4038:10b] SMPTETimeToSecond err = -66814
2009-03-03 10:49:24.106 FlexMTC[4038:10b] SMPTE Time - 02:01:01:26
2009-03-03 10:49:24.107 FlexMTC[4038:10b] SMPTETimeToSecond err = -66814
2009-03-03 10:49:24.330 FlexMTC[4038:10b] SMPTE Time - 02:13:01:26
2009-03-03 10:49:24.331 FlexMTC[4038:10b] SMPTETimeToSecond err = -66814
2009-03-03 10:49:35.642 FlexMTC[4038:10b] SMPTE Time - 02:13:01:26
2009-03-03 10:49:35.643 FlexMTC[4038:10b] SMPTETimeToSecond err = -66814
2009-03-03 10:49:36.178 FlexMTC[4038:10b] SMPTE Time - 02:13:16:26
2009-03-03 10:49:36.178 FlexMTC[4038:10b] SMPTETimeToSecond err = -66814


On 3/3/09 8:38 AM, "Doug Wyatt" <email@hidden> wrote:

> What are the values in clockTime.time? What is the error?
>
> On Mar 3, 2009, at 0:20 , Chad Williams wrote:
>
>> Thank you for all of the Core Audio postings. They have been extremely
>> helpful to me. I have a bit of a dilemma. I can't seem to set the
>> CAClockTime from a SMPTETime. Any help would be great. I am trying  
>> to set
>> the value from NSTextFields. The code compiles with no errors...I  
>> just get
>> "err" when CAClockSetCurrentTime() is called. I have no issues  
>> setting the
>> time from seconds.
>>
>> OSStatus err;
>> CAClockTime clockTime;
>>
>> clockTime.format = kCAClockTimeFormat_SMPTETime;
>> clockTime.time.smpte.mType = kSMPTETimeType30;
>> clockTime.time.smpte.mHours = (SInt16)[hhField intValue];
>> clockTime.time.smpte.mMinutes = (SInt16)[mmField intValue];
>> clockTime.time.smpte.mSeconds = (SInt16)[ssField intValue];
>> clockTime.time.smpte.mFrames = (SInt16)[ffField intValue];
>> clockTime.time.smpte.mSubframeDivisor = 80;
>> clockTime.time.smpte.mSubframes = 0;
>>
>> err = CAClockSetCurrentTime(clockRef, &clockTime);
>>    if (err != noErr) {
>>        NSLog(@"setClockToSMPTETime err = %d", err);
>>    }
>>
>> Thanks, Chad
>
>
 _______________________________________________
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

References: 
 >Re: CAClockSetCurrentTime Help (From: Doug Wyatt <email@hidden>)

  • Prev by Date: Re: Recording compressed audio file
  • Next by Date: Re: AURemoteIO returning an error on AudioOutputUnitStart
  • Previous by thread: Re: CAClockSetCurrentTime Help
  • Next by thread: Re: CAClockSetCurrentTime Help
  • Index(es):
    • Date
    • Thread