Chromium Code Reviews| Index: media/audio/win/audio_low_latency_input_win.cc |
| diff --git a/media/audio/win/audio_low_latency_input_win.cc b/media/audio/win/audio_low_latency_input_win.cc |
| index 9fe061b7682b6e7ceeb3f256307a8c34293d8b2d..2a6f4a6c31a869f02e5fbed7d8f0d996bb3ff0d3 100644 |
| --- a/media/audio/win/audio_low_latency_input_win.cc |
| +++ b/media/audio/win/audio_low_latency_input_win.cc |
| @@ -253,7 +253,7 @@ void WASAPIAudioInputStream::SetVolume(double volume) { |
| } |
| double WASAPIAudioInputStream::GetVolume() { |
| - DLOG_IF(ERROR, !opened_) << "Open() has not been called successfully"; |
| + DCHECK(opened_) << "Open() has not been called successfully"; |
| if (!opened_) |
| return 0.0; |
| @@ -265,6 +265,20 @@ double WASAPIAudioInputStream::GetVolume() { |
| return static_cast<double>(level); |
| } |
| +bool WASAPIAudioInputStream::IsMuted() { |
| + DCHECK(opened_) << "Open() has not been called successfully"; |
| + DCHECK(CalledOnValidThread()); |
| + if (!opened_) |
| + return false; |
| + |
| + // Retrieves the current muting state for the audio session. |
| + BOOL is_muted = FALSE; |
| + HRESULT hr = simple_audio_volume_->GetMute(&is_muted); |
| + DLOG_IF(WARNING, FAILED(hr)) << "Failed to get input master volume."; |
| + |
| + return (is_muted == TRUE) ? true : false; |
|
tommi (sloooow) - chröme
2014/10/10 15:54:36
checking for TRUE always makes me nervous on windo
henrika (OOO until Aug 14)
2014/10/13 12:27:17
Thx. Actually checked the exact same link before m
|
| +} |
| + |
| // static |
| AudioParameters WASAPIAudioInputStream::GetInputStreamParameters( |
| const std::string& device_id) { |