UInt32 CAHALAudioDevice::GetTotalNumberChannels(bool inIsInput) const { UInt32 theAnswer = 0; CAPropertyAddress theAddress(kAudioDevicePropertyStreamConfiguration, inIsInput ? kAudioDevicePropertyScopeInput : kAudioDevicePropertyScopeOutput); UInt32 theSize = GetPropertyDataSize(theAddress, 0, NULL); CAAutoFree<AudioBufferList> theBufferList(theSize); GetPropertyData(theAddress, 0, NULL, theSize, theBufferList); for(UInt32 theIndex = 0; theIndex < theBufferList->mNumberBuffers; ++theIndex) { theAnswer += theBufferList->mBuffers[theIndex].mNumberChannels; } return theAnswer; }
bool Inset::isBufferLoaded() const { return buffer_ && theBufferList().isLoaded(buffer_); }