Clock Sources
Clock Sources
- Subject: Clock Sources
- From: Jeremy Sagan <email@hidden>
- Date: Fri, 14 Jul 2006 14:45:18 -0400
I am trying to get Clock Sources to show up in a popup menu.
Everything works until I call AudioDeviceGetproperty with
kAudioDevicePropertyClockSourceNameForIDCFString. At that time the
array of data in clockSources gets trashed and the error returned is
"!siz". The memory trashing makes no sense considering it is the
input for the audiovaluetranslation. Also I cannot figure out what is
wrong with my sizes here.
Any help appreciated!
Here is my code:
audioErr = AudioDeviceGetPropertyInfo(theID , 0 /*MasterChannel */,
true, kAudioDevicePropertyClockSources, &outputSize, &isWriteable);
if (audioErr == noErr)
clockSources = (UInt32 *) NewPtr (outputSize);
if (clockSources)
{
long numOfClockSources, index;
audioErr = AudioDeviceGetProperty(theID, 0,
true, kAudioDevicePropertyClockSources, &outputSize, clockSources);
if (audioErr == noErr)
{
numOfClockSources = outputSize / sizeof(UInt32);
SetControlMaximum(thePopup, numOfClockSources + 1);
for (index = 0; index < numOfClockSources; index++)
{
AudioValueTranslation avt;
CFStringRef outStringRef = NULL;
avt.mInputData = &clockSources[index];
avt.mInputDataSize = sizeof(UInt32);
avt.mOutputData = &outStringRef;
avt.mOutputDataSize = sizeof(outStringRef);
outputSize = sizeof(avt);
audioErr = AudioDeviceGetProperty(theID, 0,
true, kAudioDevicePropertyClockSourceNameForIDCFString,
&outputSize, clockSources); //returns a !siz error and trashes
clocksources
...
}
}
}
Jeremy Sagan
Sagan Technology
www.sagantech.biz
_______________________________________________
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