cc: Added inline to Tile::IsReadyToDraw
[chromium-blink-merge.git] / media / audio / win / audio_manager_win.h
blob65cc73bbd6eb0b52b251a4522cbfbc99c2c73360
1 // Copyright (c) 2012 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.
5 #ifndef MEDIA_AUDIO_WIN_AUDIO_MANAGER_WIN_H_
6 #define MEDIA_AUDIO_WIN_AUDIO_MANAGER_WIN_H_
8 #include <string>
10 #include "media/audio/audio_manager_base.h"
12 namespace media {
14 class AudioDeviceListenerWin;
16 // Windows implementation of the AudioManager singleton. This class is internal
17 // to the audio output and only internal users can call methods not exposed by
18 // the AudioManager class.
19 class MEDIA_EXPORT AudioManagerWin : public AudioManagerBase {
20 public:
21 AudioManagerWin();
23 // Implementation of AudioManager.
24 virtual bool HasAudioOutputDevices() OVERRIDE;
25 virtual bool HasAudioInputDevices() OVERRIDE;
26 virtual string16 GetAudioInputDeviceModel() OVERRIDE;
27 virtual void ShowAudioInputSettings() OVERRIDE;
28 virtual void GetAudioInputDeviceNames(media::AudioDeviceNames* device_names)
29 OVERRIDE;
30 virtual AudioParameters GetInputStreamParameters(
31 const std::string& device_id) OVERRIDE;
33 // Implementation of AudioManagerBase.
34 virtual AudioOutputStream* MakeLinearOutputStream(
35 const AudioParameters& params) OVERRIDE;
36 virtual AudioOutputStream* MakeLowLatencyOutputStream(
37 const AudioParameters& params,
38 const std::string& input_device_id) OVERRIDE;
39 virtual AudioInputStream* MakeLinearInputStream(
40 const AudioParameters& params, const std::string& device_id) OVERRIDE;
41 virtual AudioInputStream* MakeLowLatencyInputStream(
42 const AudioParameters& params, const std::string& device_id) OVERRIDE;
44 protected:
45 virtual ~AudioManagerWin();
47 virtual AudioParameters GetPreferredOutputStreamParameters(
48 const AudioParameters& input_params) OVERRIDE;
50 private:
51 enum EnumerationType {
52 kUninitializedEnumeration = 0,
53 kMMDeviceEnumeration,
54 kWaveEnumeration,
57 // Allow unit test to modify the utilized enumeration API.
58 friend class AudioInputDeviceTest;
60 EnumerationType enumeration_type_;
61 EnumerationType enumeration_type() { return enumeration_type_; }
62 void SetEnumerationType(EnumerationType type) {
63 enumeration_type_ = type;
66 // Returns a PCMWaveInAudioInputStream instance or NULL on failure.
67 // This method converts MMDevice-style device ID to WaveIn-style device ID if
68 // necessary.
69 // (Please see device_enumeration_win.h for more info about the two kinds of
70 // device IDs.)
71 AudioInputStream* CreatePCMWaveInAudioInputStream(
72 const AudioParameters& params,
73 const std::string& device_id);
75 // Helper methods for constructing AudioDeviceListenerWin on the audio thread.
76 void CreateDeviceListener();
77 void DestroyDeviceListener();
79 // Listen for output device changes.
80 scoped_ptr<AudioDeviceListenerWin> output_device_listener_;
82 DISALLOW_COPY_AND_ASSIGN(AudioManagerWin);
85 } // namespace media
87 #endif // MEDIA_AUDIO_WIN_AUDIO_MANAGER_WIN_H_