*/
const char *PaMacCore_GetChannelName( int device, int channelIndex, bool input );
+
+/** Retrieve the range of legal native buffer sizes for the specificed device, in sample frames.
+
+ @param device The global index of the PortAudio device about which the query is being made.
+ @param minBufferSizeFrames A pointer to the location which will receive the minimum buffer size value.
+ @param maxBufferSizeFrames A pointer to the location which will receive the maximum buffer size value.
+
+ @see kAudioDevicePropertyBufferFrameSizeRange in the CoreAudio SDK.
+ */
+PaError PaMacCore_GetBufferSizeRange( PaDeviceIndex device,
+ long *minBufferSizeFrames, long *maxBufferSizeFrames );
+
+
/**
* Flags
*/
return channelName;
}
+
+PaError PaMacCore_GetBufferSizeRange( PaDeviceIndex device,
+ long *minBufferSizeFrames, long *maxBufferSizeFrames )
+{
+ PaError result;
+ PaUtilHostApiRepresentation *hostApi;
+
+ result = PaUtil_GetHostApiRepresentation( &hostApi, paCoreAudio );
+
+ if( result == paNoError )
+ {
+ PaDeviceIndex hostApiDeviceIndex;
+ result = PaUtil_DeviceIndexToHostApiDeviceIndex( &hostApiDeviceIndex, device, hostApi );
+ if( result == paNoError )
+ {
+ PaMacAUHAL *macCoreHostApi = (PaMacAUHAL*)hostApi;
+ AudioDeviceID macCoreDeviceId = macCoreHostApi->devIds[hostApiDeviceIndex];
+ AudioValueRange audioRange;
+ UInt32 propSize = sizeof( audioRange );
+
+ // return the size range for the output scope unless we only have inputs
+ Boolean isInput = 0;
+ if( macCoreHostApi->inheritedHostApiRep.deviceInfos[hostApiDeviceIndex]->maxOutputChannels == 0 )
+ isInput = 1;
+
+ result = WARNING(AudioDeviceGetProperty( macCoreDeviceId, 0, isInput, kAudioDevicePropertyBufferFrameSizeRange, &propSize, &audioRange ) );
-
+ *minBufferSizeFrames = audioRange.mMinimum;
+ *maxBufferSizeFrames = audioRange.mMaximum;
+ }
+ }
+
+ return result;
+}
AudioDeviceID PaMacCore_GetStreamInputDevice( PaStream* s )