Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(915)

Side by Side Diff: remoting/host/win/audio_volume_applier_win.h

Issue 2840773004: [Chromoting] Add AudioVolumeApplier to reduce the complexity and the dependency of kChannels (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698