From 6009b609f6495917903eec726afc29eb9c47af2e Mon Sep 17 00:00:00 2001 From: GZharun Date: Thu, 28 Aug 2014 10:47:01 +0300 Subject: [PATCH] [Summary] Simplified device information retrieving. Previous complicity was related to previous workflow which has nothing to do with current workflow. --- .../devicemanager/WCMRCoreAudioDeviceManager.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRCoreAudioDeviceManager.cpp b/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRCoreAudioDeviceManager.cpp index b0266d78a2..50e9839e3b 100644 --- a/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRCoreAudioDeviceManager.cpp +++ b/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRCoreAudioDeviceManager.cpp @@ -2562,7 +2562,7 @@ WTErr WCMRCoreAudioDeviceManager::getDeviceMaxInputChannels(DeviceID deviceId, u OSStatus err = kAudioHardwareNoError; UInt32 propSize = 0; inputChannels = 0; - + // 1. Get property cannels input size. err = AudioDeviceGetPropertyInfo (deviceId, 0, 1/* Input */, kAudioDevicePropertyStreamConfiguration, &propSize, NULL); if (err == kAudioHardwareNoError) @@ -2618,7 +2618,7 @@ WTErr WCMRCoreAudioDeviceManager::getDeviceMaxOutputChannels(DeviceID deviceId, OSStatus err = kAudioHardwareNoError; UInt32 propSize = 0; outputChannels = 0; - + //! 1. Get property cannels output size. err = AudioDeviceGetPropertyInfo (deviceId, 0, 0/* Output */, kAudioDevicePropertyStreamConfiguration, &propSize, NULL); if (err == kAudioHardwareNoError) @@ -2900,6 +2900,11 @@ WTErr WCMRCoreAudioDeviceManager::getDeviceSampleRatesImpl(const std::string & d return retVal; } + if (m_CurrentDevice && m_CurrentDevice->DeviceName () == deviceName) { + sampleRates.assign(m_CurrentDevice->SamplingRates().begin(), m_CurrentDevice->SamplingRates().end() ); + return retVal; + } + DeviceInfo devInfo; retVal = GetDeviceInfoByName(deviceName, devInfo); @@ -2973,6 +2978,11 @@ WTErr WCMRCoreAudioDeviceManager::getDeviceBufferSizesImpl(const std::string & d return retVal; } + if (m_CurrentDevice && m_CurrentDevice->DeviceName () == deviceName) { + bufferSizes.assign(m_CurrentDevice->BufferSizes().begin(), m_CurrentDevice->BufferSizes().end() ); + return retVal; + } + DeviceInfo devInfo; retVal = GetDeviceInfoByName(deviceName, devInfo);