| 529 | } |
| 530 | |
| 531 | unsigned int RtApiCore ::getDeviceCount(void) |
| 532 | { |
| 533 | // Find out how many audio devices there are, if any. |
| 534 | UInt32 dataSize; |
| 535 | AudioObjectPropertyAddress propertyAddress = {kAudioHardwarePropertyDevices, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster}; |
| 536 | OSStatus result = AudioObjectGetPropertyDataSize(kAudioObjectSystemObject, &propertyAddress, 0, NULL, &dataSize); |
| 537 | if (result != noErr) |
| 538 | { |
| 539 | errorText_ = "RtApiCore::getDeviceCount: OS-X error getting device info!"; |
| 540 | error(RtAudioError::WARNING); |
| 541 | return 0; |
| 542 | } |
| 543 | |
| 544 | return dataSize / sizeof(AudioDeviceID); |
| 545 | } |
| 546 | |
| 547 | unsigned int RtApiCore ::getDefaultInputDevice(void) |
| 548 | { |