Index: webrtc/modules/audio_device/win/audio_mixer_manager_win.cc |
diff --git a/webrtc/modules/audio_device/win/audio_mixer_manager_win.cc b/webrtc/modules/audio_device/win/audio_mixer_manager_win.cc |
index ae2d00faeb89ecb899e8dddd7dd63e5fbb5bde53..e60f9ebf57e6ee921cfa76d7b700f3409be46eba 100644 |
--- a/webrtc/modules/audio_device/win/audio_mixer_manager_win.cc |
+++ b/webrtc/modules/audio_device/win/audio_mixer_manager_win.cc |
@@ -31,15 +31,15 @@ namespace webrtc { |
// CONSTRUCTION/DESTRUCTION |
// ============================================================================ |
-AudioMixerManager::AudioMixerManager(const int32_t id) : |
- _critSect(*CriticalSectionWrapper::CreateCriticalSection()), |
- _id(id), |
- _inputMixerHandle(NULL), |
- _outputMixerHandle(NULL) |
-{ |
- WEBRTC_TRACE(kTraceMemory, kTraceAudioDevice, _id, "%s constructed", __FUNCTION__); |
- ClearSpeakerState(); |
- ClearMicrophoneState(); |
+AudioMixerManager::AudioMixerManager(const int32_t id) |
+ : _critSect(*CriticalSectionWrapper::CreateCriticalSection()), |
+ _id(id), |
+ _inputMixerHandle(nullptr), |
+ _outputMixerHandle(nullptr) { |
+ WEBRTC_TRACE(kTraceMemory, kTraceAudioDevice, _id, "%s constructed", |
+ __FUNCTION__); |
+ ClearSpeakerState(); |
+ ClearMicrophoneState(); |
} |
AudioMixerManager::~AudioMixerManager() |
@@ -65,15 +65,13 @@ int32_t AudioMixerManager::Close() |
CriticalSectionScoped lock(&_critSect); |
- if (_outputMixerHandle != NULL) |
- { |
- mixerClose(_outputMixerHandle); |
- _outputMixerHandle = NULL; |
+ if (_outputMixerHandle != nullptr) { |
+ mixerClose(_outputMixerHandle); |
+ _outputMixerHandle = nullptr; |
} |
- if (_inputMixerHandle != NULL) |
- { |
- mixerClose(_inputMixerHandle); |
- _inputMixerHandle = NULL; |
+ if (_inputMixerHandle != nullptr) { |
+ mixerClose(_inputMixerHandle); |
+ _inputMixerHandle = nullptr; |
} |
return 0; |
@@ -89,15 +87,14 @@ int32_t AudioMixerManager::CloseSpeaker() |
CriticalSectionScoped lock(&_critSect); |
- if (_outputMixerHandle == NULL) |
- { |
- return -1; |
+ if (_outputMixerHandle == nullptr) { |
+ return -1; |
} |
ClearSpeakerState(_outputMixerID); |
mixerClose(_outputMixerHandle); |
- _outputMixerHandle = NULL; |
+ _outputMixerHandle = nullptr; |
return 0; |
} |
@@ -112,15 +109,14 @@ int32_t AudioMixerManager::CloseMicrophone() |
CriticalSectionScoped lock(&_critSect); |
- if (_inputMixerHandle == NULL) |
- { |
- return -1; |
+ if (_inputMixerHandle == nullptr) { |
+ return -1; |
} |
ClearMicrophoneState(_inputMixerID); |
mixerClose(_inputMixerHandle); |
- _inputMixerHandle = NULL; |
+ _inputMixerHandle = nullptr; |
return 0; |
} |
@@ -584,15 +580,14 @@ int32_t AudioMixerManager::OpenSpeaker(AudioDeviceModule::WindowsDeviceType devi |
// Close any existing output mixer handle |
// |
- if (_outputMixerHandle != NULL) |
- { |
- mixerClose(_outputMixerHandle); |
- _outputMixerHandle = NULL; |
+ if (_outputMixerHandle != nullptr) { |
+ mixerClose(_outputMixerHandle); |
+ _outputMixerHandle = nullptr; |
} |
MMRESULT res = MMSYSERR_NOERROR; |
WAVEFORMATEX waveFormat; |
- HWAVEOUT hWaveOut(NULL); |
+ HWAVEOUT hWaveOut(nullptr); |
waveFormat.wFormatTag = WAVE_FORMAT_PCM ; |
waveFormat.nChannels = 2; |
@@ -609,18 +604,23 @@ int32_t AudioMixerManager::OpenSpeaker(AudioDeviceModule::WindowsDeviceType devi |
if (device == AudioDeviceModule::kDefaultCommunicationDevice) |
{ |
// check if it is possible to open the default communication device (supported on Windows 7) |
- res = waveOutOpen(NULL, WAVE_MAPPER, &waveFormat, 0, 0, CALLBACK_NULL | |
- WAVE_MAPPED_kDefaultCommunicationDevice | WAVE_FORMAT_QUERY); |
+ res = waveOutOpen(nullptr, WAVE_MAPPER, &waveFormat, 0, 0, |
+ CALLBACK_NULL | |
+ WAVE_MAPPED_kDefaultCommunicationDevice | |
+ WAVE_FORMAT_QUERY); |
if (MMSYSERR_NOERROR == res) |
{ |
// if so, open the default communication device for real |
- res = waveOutOpen(&hWaveOut, WAVE_MAPPER, &waveFormat, 0, 0, CALLBACK_NULL | WAVE_MAPPED_kDefaultCommunicationDevice); |
+ res = waveOutOpen( |
+ &hWaveOut, WAVE_MAPPER, &waveFormat, 0, 0, |
+ CALLBACK_NULL | WAVE_MAPPED_kDefaultCommunicationDevice); |
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "opening default communication device"); |
} |
else |
{ |
// use default device since default communication device was not avaliable |
- res = waveOutOpen(&hWaveOut, WAVE_MAPPER, &waveFormat, 0, 0, CALLBACK_NULL); |
+ res = waveOutOpen(&hWaveOut, WAVE_MAPPER, &waveFormat, 0, 0, |
+ CALLBACK_NULL); |
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, |
"unable to open default communication device => using default instead"); |
} |
@@ -628,7 +628,8 @@ int32_t AudioMixerManager::OpenSpeaker(AudioDeviceModule::WindowsDeviceType devi |
else if (device == AudioDeviceModule::kDefaultDevice) |
{ |
// open default device since it has been requested |
- res = waveOutOpen(&hWaveOut, WAVE_MAPPER, &waveFormat, 0, 0, CALLBACK_NULL); |
+ res = waveOutOpen(&hWaveOut, WAVE_MAPPER, &waveFormat, 0, 0, |
+ CALLBACK_NULL); |
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "opening default output device"); |
} |
@@ -639,7 +640,7 @@ int32_t AudioMixerManager::OpenSpeaker(AudioDeviceModule::WindowsDeviceType devi |
} |
UINT mixerId(0); |
- HMIXER hMixer(NULL); |
+ HMIXER hMixer(nullptr); |
// Retrieve the device identifier for a mixer device associated with the |
// aquired waveform-audio output handle. |
@@ -680,9 +681,10 @@ int32_t AudioMixerManager::OpenSpeaker(AudioDeviceModule::WindowsDeviceType devi |
_outputMixerHandle = hMixer; |
_outputMixerID = mixerId; |
- if (_outputMixerHandle != NULL) |
- { |
- WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "the output mixer device is now open (0x%x)", _outputMixerHandle); |
+ if (_outputMixerHandle != nullptr) { |
+ WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, |
+ "the output mixer device is now open (0x%x)", |
+ _outputMixerHandle); |
} |
return 0; |
@@ -703,15 +705,14 @@ int32_t AudioMixerManager::OpenSpeaker(uint16_t index) |
// Close any existing output mixer handle |
// |
- if (_outputMixerHandle != NULL) |
- { |
- mixerClose(_outputMixerHandle); |
- _outputMixerHandle = NULL; |
+ if (_outputMixerHandle != nullptr) { |
+ mixerClose(_outputMixerHandle); |
+ _outputMixerHandle = nullptr; |
} |
MMRESULT res; |
WAVEFORMATEX waveFormat; |
- HWAVEOUT hWaveOut(NULL); |
+ HWAVEOUT hWaveOut(nullptr); |
const UINT deviceID(index); // use index parameter as device identifier |
@@ -735,7 +736,7 @@ int32_t AudioMixerManager::OpenSpeaker(uint16_t index) |
} |
UINT mixerId(0); |
- HMIXER hMixer(NULL); |
+ HMIXER hMixer(nullptr); |
// Retrieve the device identifier for a mixer device associated with the |
// aquired waveform-audio output handle. |
@@ -776,9 +777,10 @@ int32_t AudioMixerManager::OpenSpeaker(uint16_t index) |
_outputMixerHandle = hMixer; |
_outputMixerID = mixerId; |
- if (_outputMixerHandle != NULL) |
- { |
- WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "the output mixer device is now open (0x%x)", _outputMixerHandle); |
+ if (_outputMixerHandle != nullptr) { |
+ WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, |
+ "the output mixer device is now open (0x%x)", |
+ _outputMixerHandle); |
} |
return 0; |
@@ -806,15 +808,14 @@ int32_t AudioMixerManager::OpenMicrophone(AudioDeviceModule::WindowsDeviceType d |
// Close any existing output mixer handle |
// |
- if (_inputMixerHandle != NULL) |
- { |
- mixerClose(_inputMixerHandle); |
- _inputMixerHandle = NULL; |
+ if (_inputMixerHandle != nullptr) { |
+ mixerClose(_inputMixerHandle); |
+ _inputMixerHandle = nullptr; |
} |
MMRESULT res = MMSYSERR_NOERROR; |
WAVEFORMATEX waveFormat; |
- HWAVEIN hWaveIn(NULL); |
+ HWAVEIN hWaveIn(nullptr); |
waveFormat.wFormatTag = WAVE_FORMAT_PCM ; |
waveFormat.nChannels = 1; |
@@ -831,18 +832,23 @@ int32_t AudioMixerManager::OpenMicrophone(AudioDeviceModule::WindowsDeviceType d |
if (device == AudioDeviceModule::kDefaultCommunicationDevice) |
{ |
// check if it is possible to open the default communication device (supported on Windows 7) |
- res = waveInOpen(NULL, WAVE_MAPPER, &waveFormat, 0, 0, CALLBACK_NULL | |
- WAVE_MAPPED_kDefaultCommunicationDevice | WAVE_FORMAT_QUERY); |
+ res = |
+ waveInOpen(nullptr, WAVE_MAPPER, &waveFormat, 0, 0, |
+ CALLBACK_NULL | WAVE_MAPPED_kDefaultCommunicationDevice | |
+ WAVE_FORMAT_QUERY); |
if (MMSYSERR_NOERROR == res) |
{ |
// if so, open the default communication device for real |
- res = waveInOpen(&hWaveIn, WAVE_MAPPER, &waveFormat, 0, 0, CALLBACK_NULL | WAVE_MAPPED_kDefaultCommunicationDevice); |
+ res = waveInOpen( |
+ &hWaveIn, WAVE_MAPPER, &waveFormat, 0, 0, |
+ CALLBACK_NULL | WAVE_MAPPED_kDefaultCommunicationDevice); |
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "opening default communication device"); |
} |
else |
{ |
// use default device since default communication device was not avaliable |
- res = waveInOpen(&hWaveIn, WAVE_MAPPER, &waveFormat, 0, 0, CALLBACK_NULL); |
+ res = waveInOpen(&hWaveIn, WAVE_MAPPER, &waveFormat, 0, 0, |
+ CALLBACK_NULL); |
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, |
"unable to open default communication device => using default instead"); |
} |
@@ -850,7 +856,8 @@ int32_t AudioMixerManager::OpenMicrophone(AudioDeviceModule::WindowsDeviceType d |
else if (device == AudioDeviceModule::kDefaultDevice) |
{ |
// open default device since it has been requested |
- res = waveInOpen(&hWaveIn, WAVE_MAPPER, &waveFormat, 0, 0, CALLBACK_NULL); |
+ res = |
+ waveInOpen(&hWaveIn, WAVE_MAPPER, &waveFormat, 0, 0, CALLBACK_NULL); |
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "opening default input device"); |
} |
@@ -861,7 +868,7 @@ int32_t AudioMixerManager::OpenMicrophone(AudioDeviceModule::WindowsDeviceType d |
} |
UINT mixerId(0); |
- HMIXER hMixer(NULL); |
+ HMIXER hMixer(nullptr); |
// Retrieve the device identifier for a mixer device associated with the |
// aquired waveform-audio input handle. |
@@ -902,9 +909,10 @@ int32_t AudioMixerManager::OpenMicrophone(AudioDeviceModule::WindowsDeviceType d |
_inputMixerHandle = hMixer; |
_inputMixerID = mixerId; |
- if (_inputMixerHandle != NULL) |
- { |
- WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "the input mixer device is now open (0x%x)", _inputMixerHandle); |
+ if (_inputMixerHandle != nullptr) { |
+ WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, |
+ "the input mixer device is now open (0x%x)", |
+ _inputMixerHandle); |
} |
return 0; |
@@ -925,15 +933,14 @@ int32_t AudioMixerManager::OpenMicrophone(uint16_t index) |
// Close any existing input mixer handle |
// |
- if (_inputMixerHandle != NULL) |
- { |
- mixerClose(_inputMixerHandle); |
- _inputMixerHandle = NULL; |
+ if (_inputMixerHandle != nullptr) { |
+ mixerClose(_inputMixerHandle); |
+ _inputMixerHandle = nullptr; |
} |
MMRESULT res; |
WAVEFORMATEX waveFormat; |
- HWAVEIN hWaveIn(NULL); |
+ HWAVEIN hWaveIn(nullptr); |
const UINT deviceID(index); // use index parameter as device identifier |
@@ -957,7 +964,7 @@ int32_t AudioMixerManager::OpenMicrophone(uint16_t index) |
} |
UINT mixerId(0); |
- HMIXER hMixer(NULL); |
+ HMIXER hMixer(nullptr); |
// Retrieve the device identifier for a mixer device associated with the |
// aquired waveform-audio input handle. |
@@ -998,9 +1005,10 @@ int32_t AudioMixerManager::OpenMicrophone(uint16_t index) |
_inputMixerHandle = hMixer; |
_inputMixerID = mixerId; |
- if (_inputMixerHandle != NULL) |
- { |
- WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "the input mixer device is now open (0x%x)", _inputMixerHandle); |
+ if (_inputMixerHandle != nullptr) { |
+ WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, |
+ "the input mixer device is now open (0x%x)", |
+ _inputMixerHandle); |
} |
return 0; |
@@ -1014,7 +1022,7 @@ bool AudioMixerManager::SpeakerIsInitialized() const |
{ |
WEBRTC_TRACE(kTraceMemory, kTraceAudioDevice, _id, "%s", __FUNCTION__); |
- return (_outputMixerHandle != NULL); |
+ return (_outputMixerHandle != nullptr); |
} |
// ---------------------------------------------------------------------------- |
@@ -1025,7 +1033,7 @@ bool AudioMixerManager::MicrophoneIsInitialized() const |
{ |
WEBRTC_TRACE(kTraceMemory, kTraceAudioDevice, _id, "%s", __FUNCTION__); |
- return (_inputMixerHandle != NULL); |
+ return (_inputMixerHandle != nullptr); |
} |
// ---------------------------------------------------------------------------- |
@@ -1038,10 +1046,10 @@ int32_t AudioMixerManager::SetSpeakerVolume(uint32_t volume) |
CriticalSectionScoped lock(&_critSect); |
- if (_outputMixerHandle == NULL) |
- { |
- WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, "no avaliable output mixer exists"); |
- return -1; |
+ if (_outputMixerHandle == nullptr) { |
+ WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, |
+ "no avaliable output mixer exists"); |
+ return -1; |
} |
const UINT mixerID(_outputMixerID); |
@@ -1067,11 +1075,10 @@ int32_t AudioMixerManager::SetSpeakerVolume(uint32_t volume) |
int32_t AudioMixerManager::SpeakerVolume(uint32_t& volume) const |
{ |
- |
- if (_outputMixerHandle == NULL) |
- { |
- WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, "no avaliable output mixer exists"); |
- return -1; |
+ if (_outputMixerHandle == nullptr) { |
+ WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, |
+ "no avaliable output mixer exists"); |
+ return -1; |
} |
const UINT mixerID(_outputMixerID); |
@@ -1099,11 +1106,10 @@ int32_t AudioMixerManager::SpeakerVolume(uint32_t& volume) const |
int32_t AudioMixerManager::MaxSpeakerVolume(uint32_t& maxVolume) const |
{ |
- |
- if (_outputMixerHandle == NULL) |
- { |
- WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, "no avaliable output mixer exists"); |
- return -1; |
+ if (_outputMixerHandle == nullptr) { |
+ WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, |
+ "no avaliable output mixer exists"); |
+ return -1; |
} |
const UINT mixerID(_outputMixerID); |
@@ -1128,11 +1134,10 @@ int32_t AudioMixerManager::MaxSpeakerVolume(uint32_t& maxVolume) const |
int32_t AudioMixerManager::MinSpeakerVolume(uint32_t& minVolume) const |
{ |
- |
- if (_outputMixerHandle == NULL) |
- { |
- WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, "no avaliable output mixer exists"); |
- return -1; |
+ if (_outputMixerHandle == nullptr) { |
+ WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, |
+ "no avaliable output mixer exists"); |
+ return -1; |
} |
const UINT mixerID(_outputMixerID); |
@@ -1157,11 +1162,10 @@ int32_t AudioMixerManager::MinSpeakerVolume(uint32_t& minVolume) const |
int32_t AudioMixerManager::SpeakerVolumeStepSize(uint16_t& stepSize) const |
{ |
- |
- if (_outputMixerHandle == NULL) |
- { |
- WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, "no avaliable output mixer exists"); |
- return -1; |
+ if (_outputMixerHandle == nullptr) { |
+ WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, |
+ "no avaliable output mixer exists"); |
+ return -1; |
} |
const UINT mixerID(_outputMixerID); |
@@ -1185,10 +1189,10 @@ int32_t AudioMixerManager::SpeakerVolumeStepSize(uint16_t& stepSize) const |
int32_t AudioMixerManager::SpeakerVolumeIsAvailable(bool& available) |
{ |
- if (_outputMixerHandle == NULL) |
- { |
- WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, "no avaliable output mixer exists"); |
- return -1; |
+ if (_outputMixerHandle == nullptr) { |
+ WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, |
+ "no avaliable output mixer exists"); |
+ return -1; |
} |
available = _speakerState[_outputMixerID].volumeControlIsValid; |
@@ -1202,10 +1206,10 @@ int32_t AudioMixerManager::SpeakerVolumeIsAvailable(bool& available) |
int32_t AudioMixerManager::SpeakerMuteIsAvailable(bool& available) |
{ |
- if (_outputMixerHandle == NULL) |
- { |
- WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, "no avaliable output mixer exists"); |
- return -1; |
+ if (_outputMixerHandle == nullptr) { |
+ WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, |
+ "no avaliable output mixer exists"); |
+ return -1; |
} |
available = _speakerState[_outputMixerID].muteControlIsValid; |
@@ -1225,10 +1229,10 @@ int32_t AudioMixerManager::SetSpeakerMute(bool enable) |
CriticalSectionScoped lock(&_critSect); |
- if (_outputMixerHandle == NULL) |
- { |
- WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, "no avaliable output mixer exists"); |
- return -1; |
+ if (_outputMixerHandle == nullptr) { |
+ WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, |
+ "no avaliable output mixer exists"); |
+ return -1; |
} |
// Ensure that the selected speaker destination has a valid mute control. |
@@ -1259,11 +1263,10 @@ int32_t AudioMixerManager::SetSpeakerMute(bool enable) |
int32_t AudioMixerManager::SpeakerMute(bool& enabled) const |
{ |
- |
- if (_outputMixerHandle == NULL) |
- { |
- WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, "no avaliable output mixer exists"); |
- return -1; |
+ if (_outputMixerHandle == nullptr) { |
+ WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, |
+ "no avaliable output mixer exists"); |
+ return -1; |
} |
// Ensure that the selected speaker destination has a valid mute control. |
@@ -1297,10 +1300,10 @@ int32_t AudioMixerManager::SpeakerMute(bool& enabled) const |
int32_t AudioMixerManager::MicrophoneMuteIsAvailable(bool& available) |
{ |
- if (_inputMixerHandle == NULL) |
- { |
- WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, "no avaliable input mixer exists"); |
- return -1; |
+ if (_inputMixerHandle == nullptr) { |
+ WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, |
+ "no avaliable input mixer exists"); |
+ return -1; |
} |
available = _microphoneState[_inputMixerID].muteControlIsValid; |
@@ -1320,10 +1323,10 @@ int32_t AudioMixerManager::SetMicrophoneMute(bool enable) |
CriticalSectionScoped lock(&_critSect); |
- if (_inputMixerHandle == NULL) |
- { |
- WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, "no avaliable input mixer exists"); |
- return -1; |
+ if (_inputMixerHandle == nullptr) { |
+ WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, |
+ "no avaliable input mixer exists"); |
+ return -1; |
} |
// Ensure that the selected wave-in destinationhas a valid mute control. |
@@ -1354,11 +1357,10 @@ int32_t AudioMixerManager::SetMicrophoneMute(bool enable) |
int32_t AudioMixerManager::MicrophoneMute(bool& enabled) const |
{ |
- |
- if (_inputMixerHandle == NULL) |
- { |
- WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, "no avaliable input mixer exists"); |
- return -1; |
+ if (_inputMixerHandle == nullptr) { |
+ WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, |
+ "no avaliable input mixer exists"); |
+ return -1; |
} |
// Ensure that the selected wave-in destinationhas a valid mute control. |
@@ -1392,10 +1394,10 @@ int32_t AudioMixerManager::MicrophoneMute(bool& enabled) const |
int32_t AudioMixerManager::MicrophoneBoostIsAvailable(bool& available) |
{ |
- if (_inputMixerHandle == NULL) |
- { |
- WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, "no avaliable input mixer exists"); |
- return -1; |
+ if (_inputMixerHandle == nullptr) { |
+ WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, |
+ "no avaliable input mixer exists"); |
+ return -1; |
} |
available = _microphoneState[_inputMixerID].onOffControlIsValid; |
@@ -1413,10 +1415,10 @@ int32_t AudioMixerManager::SetMicrophoneBoost(bool enable) |
CriticalSectionScoped lock(&_critSect); |
- if (_inputMixerHandle == NULL) |
- { |
- WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, "no avaliable input mixer exists"); |
- return -1; |
+ if (_inputMixerHandle == nullptr) { |
+ WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, |
+ "no avaliable input mixer exists"); |
+ return -1; |
} |
// Ensure that the selected wave-in destination has a valid boost (on/off) control. |
@@ -1447,11 +1449,10 @@ int32_t AudioMixerManager::SetMicrophoneBoost(bool enable) |
int32_t AudioMixerManager::MicrophoneBoost(bool& enabled) const |
{ |
- |
- if (_inputMixerHandle == NULL) |
- { |
- WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, "no avaliable input mixer exists"); |
- return -1; |
+ if (_inputMixerHandle == nullptr) { |
+ WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, |
+ "no avaliable input mixer exists"); |
+ return -1; |
} |
// Ensure that the selected wave-in destination has a valid boost (on/off) control. |
@@ -1485,10 +1486,10 @@ int32_t AudioMixerManager::MicrophoneBoost(bool& enabled) const |
int32_t AudioMixerManager::MicrophoneVolumeIsAvailable(bool& available) |
{ |
- if (_inputMixerHandle == NULL) |
- { |
- WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, "no avaliable input mixer exists"); |
- return -1; |
+ if (_inputMixerHandle == nullptr) { |
+ WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, |
+ "no avaliable input mixer exists"); |
+ return -1; |
} |
available = _microphoneState[_inputMixerID].volumeControlIsValid; |
@@ -1504,10 +1505,10 @@ int32_t AudioMixerManager::SetMicrophoneVolume(uint32_t volume) |
{ |
CriticalSectionScoped lock(&_critSect); |
- if (_inputMixerHandle == NULL) |
- { |
- WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, "no avaliable input mixer exists"); |
- return -1; |
+ if (_inputMixerHandle == nullptr) { |
+ WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, |
+ "no avaliable input mixer exists"); |
+ return -1; |
} |
const UINT mixerID(_inputMixerID); |
@@ -1532,10 +1533,10 @@ int32_t AudioMixerManager::MicrophoneVolume(uint32_t& volume) const |
{ |
CriticalSectionScoped lock(&_critSect); |
- if (_inputMixerHandle == NULL) |
- { |
- WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, "no avaliable input mixer exists"); |
- return -1; |
+ if (_inputMixerHandle == nullptr) { |
+ WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, |
+ "no avaliable input mixer exists"); |
+ return -1; |
} |
const UINT mixerID(_inputMixerID); |
@@ -1562,10 +1563,10 @@ int32_t AudioMixerManager::MaxMicrophoneVolume(uint32_t& maxVolume) const |
{ |
WEBRTC_TRACE(kTraceStream, kTraceAudioDevice, _id, "%s", __FUNCTION__); |
- if (_inputMixerHandle == NULL) |
- { |
- WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, "no avaliable input mixer exists"); |
- return -1; |
+ if (_inputMixerHandle == nullptr) { |
+ WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, |
+ "no avaliable input mixer exists"); |
+ return -1; |
} |
const UINT mixerID(_inputMixerID); |
@@ -1590,11 +1591,10 @@ int32_t AudioMixerManager::MaxMicrophoneVolume(uint32_t& maxVolume) const |
int32_t AudioMixerManager::MinMicrophoneVolume(uint32_t& minVolume) const |
{ |
- |
- if (_inputMixerHandle == NULL) |
- { |
- WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, "no avaliable input mixer exists"); |
- return -1; |
+ if (_inputMixerHandle == nullptr) { |
+ WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, |
+ "no avaliable input mixer exists"); |
+ return -1; |
} |
const UINT mixerID(_inputMixerID); |
@@ -1619,11 +1619,10 @@ int32_t AudioMixerManager::MinMicrophoneVolume(uint32_t& minVolume) const |
int32_t AudioMixerManager::MicrophoneVolumeStepSize(uint16_t& stepSize) const |
{ |
- |
- if (_inputMixerHandle == NULL) |
- { |
- WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, "no avaliable input mixer exists"); |
- return -1; |
+ if (_inputMixerHandle == nullptr) { |
+ WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, |
+ "no avaliable input mixer exists"); |
+ return -1; |
} |
const UINT mixerID(_inputMixerID); |