| Index: remoting/host/win/audio_volume_applier_win.h
|
| diff --git a/remoting/host/win/audio_volume_applier_win.h b/remoting/host/win/audio_volume_applier_win.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..b94a5e6d7d7188ab87249f207ecb4f9d63872a3b
|
| --- /dev/null
|
| +++ b/remoting/host/win/audio_volume_applier_win.h
|
| @@ -0,0 +1,36 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef REMOTING_HOST_WIN_AUDIO_VOLUME_APPLIER_WIN_H_
|
| +#define REMOTING_HOST_WIN_AUDIO_VOLUME_APPLIER_WIN_H_
|
| +
|
| +#include <endpointvolume.h>
|
| +#include <mmdeviceapi.h>
|
| +
|
| +#include "base/win/scoped_comptr.h"
|
| +#include "remoting/host/audio_volume_applier.h"
|
| +
|
| +namespace remoting {
|
| +
|
| +// An implementation of AudioVolumeApplier for Windows only.
|
| +class AudioVolumeApplierWin : public AudioVolumeApplier {
|
| + public:
|
| + explicit AudioVolumeApplierWin(int silence_threshold);
|
| + ~AudioVolumeApplierWin() override;
|
| +
|
| + // Initializes |audio_volume_|. Returns false if Windows APIs fail.
|
| + bool ActivateBy(IMMDevice* mm_device);
|
| +
|
| + protected:
|
| + // Returns current audio level from |audio_volume_|. If the initialization
|
| + // failed, this function returns 1.
|
| + float GetAudioLevel() override;
|
| +
|
| + private:
|
| + base::win::ScopedComPtr<IAudioEndpointVolume> audio_volume_;
|
| +};
|
| +
|
| +} // namespace remoting
|
| +
|
| +#endif // REMOTING_HOST_WIN_AUDIO_VOLUME_APPLIER_WIN_H_
|
|
|