void CAHALAudioDevice::GetAvailableDataDestinations(AudioObjectPropertyScope inScope, UInt32 inChannel, UInt32& ioNumberDestinations, UInt32* outDestinations) const { CAPropertyAddress theAddress(kAudioDevicePropertyPlayThruDestinations, inScope, inChannel); UInt32 theNumberDestinations = std::min(GetNumberAvailableDataDestinations(inScope, inChannel), ioNumberDestinations); UInt32 theSize = theNumberDestinations * SizeOf32(UInt32); GetPropertyData(theAddress, 0, NULL, theSize, outDestinations); ioNumberDestinations = theSize / SizeOf32(UInt32); }
UInt32 CAHALAudioDevice::GetAvailableDataDestinationByIndex(AudioObjectPropertyScope inScope, UInt32 inChannel, UInt32 inIndex) const { AudioStreamID theAnswer = 0; UInt32 theNumberDestinations = GetNumberAvailableDataDestinations(inScope, inChannel); if((theNumberDestinations > 0) && (inIndex < theNumberDestinations)) { CAAutoArrayDelete<UInt32> theDestinationList(theNumberDestinations); GetAvailableDataDestinations(inScope, inChannel, theNumberDestinations, theDestinationList); theAnswer = theDestinationList[inIndex]; } return theAnswer; }