OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef REMOTING_HOST_WIN_AUDIO_VOLUME_APPLIER_WIN_H_ |
| 6 #define REMOTING_HOST_WIN_AUDIO_VOLUME_APPLIER_WIN_H_ |
| 7 |
| 8 #include <endpointvolume.h> |
| 9 #include <mmdeviceapi.h> |
| 10 |
| 11 #include "base/win/scoped_comptr.h" |
| 12 #include "remoting/host/audio_volume_applier.h" |
| 13 |
| 14 namespace remoting { |
| 15 |
| 16 // An implementation of AudioVolumeApplier for Windows only. |
| 17 class AudioVolumeApplierWin : public AudioVolumeApplier { |
| 18 public: |
| 19 explicit AudioVolumeApplierWin(int silence_threshold); |
| 20 ~AudioVolumeApplierWin() override; |
| 21 |
| 22 // Initializes |audio_volume_|. Returns false if Windows APIs fail. |
| 23 bool ActivateBy(IMMDevice* mm_device); |
| 24 |
| 25 protected: |
| 26 // Returns current audio level from |audio_volume_|. If the initialization |
| 27 // failed, this function returns 1. |
| 28 float GetAudioLevel() override; |
| 29 |
| 30 private: |
| 31 base::win::ScopedComPtr<IAudioEndpointVolume> audio_volume_; |
| 32 }; |
| 33 |
| 34 } // namespace remoting |
| 35 |
| 36 #endif // REMOTING_HOST_WIN_AUDIO_VOLUME_APPLIER_WIN_H_ |
OLD | NEW |