forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathaudio_devices_pref_handler_stub.h
46 lines (34 loc) · 1.53 KB
/
audio_devices_pref_handler_stub.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright (c) 2013 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 CHROMEOS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_STUB_H_
#define CHROMEOS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_STUB_H_
#include <map>
#include "base/macros.h"
#include "chromeos/audio/audio_devices_pref_handler.h"
namespace chromeos {
// Stub class for AudioDevicesPrefHandler, used for testing.
class CHROMEOS_EXPORT AudioDevicesPrefHandlerStub
: public AudioDevicesPrefHandler {
public:
using AudioDeviceMute = std::map<uint64_t, bool>;
using AudioDeviceVolumeGain = std::map<uint64_t, int>;
AudioDevicesPrefHandlerStub();
// AudioDevicesPrefHandler:
double GetOutputVolumeValue(const AudioDevice* device) override;
double GetInputGainValue(const AudioDevice* device) override;
void SetVolumeGainValue(const AudioDevice& device, double value) override;
bool GetMuteValue(const AudioDevice& device) override;
void SetMuteValue(const AudioDevice& device, bool mute_on) override;
bool GetAudioOutputAllowedValue() override;
void AddAudioPrefObserver(AudioPrefObserver* observer) override;
void RemoveAudioPrefObserver(AudioPrefObserver* observer) override;
protected:
~AudioDevicesPrefHandlerStub() override;
private:
AudioDeviceMute audio_device_mute_map_;
AudioDeviceVolumeGain audio_device_volume_gain_map_;
DISALLOW_COPY_AND_ASSIGN(AudioDevicesPrefHandlerStub);
};
} // namespace chromeos
#endif // CHROMEOS_AUDIO_AUDIO_DEVICES_PREF_HANDLER_STUB_H_