From 301b9b13bf916e20b6a7f60767d741b30a83587e Mon Sep 17 00:00:00 2001 From: Greg Zharun Date: Tue, 24 Jun 2014 16:43:26 +0300 Subject: [PATCH] [Summary] Added PortAudio device channels names retrieving from the driver --- .../WCMRPortAudioDeviceManager.cpp | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRPortAudioDeviceManager.cpp b/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRPortAudioDeviceManager.cpp index 2f6cd710ff..057dc1d0e6 100644 --- a/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRPortAudioDeviceManager.cpp +++ b/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRPortAudioDeviceManager.cpp @@ -409,9 +409,20 @@ void WCMRPortAudioDevice::updateDeviceInfo (bool callerIsWaiting/*=false*/) m_InputChannels.clear(); for (int channel = 0; channel < maxInputChannels; channel++) { + const char* channelName[32]; // 32 is max leth declared by PortAudio for this operation std::stringstream chNameStream; - //A better implementation would be to retrieve the names from ASIO or CoreAudio interfaces - chNameStream << "Input " << (channel+1); + + PaError error = PaAsio_GetInputChannelName(m_DeviceID, channel, channelName); + + if (error == paNoError) + { + chNameStream << *channelName; + } + else + { + chNameStream << "Input " << (channel+1); + } + m_InputChannels.push_back (chNameStream.str()); } @@ -420,9 +431,20 @@ void WCMRPortAudioDevice::updateDeviceInfo (bool callerIsWaiting/*=false*/) m_OutputChannels.clear(); for (int channel = 0; channel < maxOutputChannels; channel++) { + const char* channelName[32]; // 32 is max leth declared by PortAudio for this operation std::stringstream chNameStream; - //A better implementation would be to retrieve the names from ASIO or CoreAudio interfaces - chNameStream << "Output " << (channel+1); + + PaError error = PaAsio_GetOutputChannelName(m_DeviceID, channel, channelName); + + if (error == paNoError) + { + chNameStream << *channelName; + } + else + { + chNameStream << "Output " << (channel+1); + } + m_OutputChannels.push_back (chNameStream.str()); } }