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

Side by Side Diff: media/audio/win/audio_manager_win.h

Issue 23475037: Implement GetAudioOutputDevices for remaining platforms, consolidate tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Merge LKGR, remove anonymous namespaces. Created 7 years, 3 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
« no previous file with comments | « media/audio/pulse/audio_manager_pulse.h ('k') | media/audio/win/device_enumeration_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_AUDIO_WIN_AUDIO_MANAGER_WIN_H_ 5 #ifndef MEDIA_AUDIO_WIN_AUDIO_MANAGER_WIN_H_
6 #define MEDIA_AUDIO_WIN_AUDIO_MANAGER_WIN_H_ 6 #define MEDIA_AUDIO_WIN_AUDIO_MANAGER_WIN_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "media/audio/audio_manager_base.h" 10 #include "media/audio/audio_manager_base.h"
11 11
12 namespace media { 12 namespace media {
13 13
14 class AudioDeviceListenerWin; 14 class AudioDeviceListenerWin;
15 15
16 // Windows implementation of the AudioManager singleton. This class is internal 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 17 // to the audio output and only internal users can call methods not exposed by
18 // the AudioManager class. 18 // the AudioManager class.
19 class MEDIA_EXPORT AudioManagerWin : public AudioManagerBase { 19 class MEDIA_EXPORT AudioManagerWin : public AudioManagerBase {
20 public: 20 public:
21 AudioManagerWin(); 21 AudioManagerWin();
22 22
23 // Implementation of AudioManager. 23 // Implementation of AudioManager.
24 virtual bool HasAudioOutputDevices() OVERRIDE; 24 virtual bool HasAudioOutputDevices() OVERRIDE;
25 virtual bool HasAudioInputDevices() OVERRIDE; 25 virtual bool HasAudioInputDevices() OVERRIDE;
26 virtual string16 GetAudioInputDeviceModel() OVERRIDE; 26 virtual string16 GetAudioInputDeviceModel() OVERRIDE;
27 virtual void ShowAudioInputSettings() OVERRIDE; 27 virtual void ShowAudioInputSettings() OVERRIDE;
28 virtual void GetAudioInputDeviceNames(AudioDeviceNames* device_names) 28 virtual void GetAudioInputDeviceNames(
29 OVERRIDE; 29 AudioDeviceNames* device_names) OVERRIDE;
30 virtual void GetAudioOutputDeviceNames(AudioDeviceNames* device_names) 30 virtual void GetAudioOutputDeviceNames(
31 OVERRIDE; 31 AudioDeviceNames* device_names) OVERRIDE;
32 virtual AudioParameters GetInputStreamParameters( 32 virtual AudioParameters GetInputStreamParameters(
33 const std::string& device_id) OVERRIDE; 33 const std::string& device_id) OVERRIDE;
34 virtual std::string GetAssociatedOutputDeviceID( 34 virtual std::string GetAssociatedOutputDeviceID(
35 const std::string& input_device_id) OVERRIDE; 35 const std::string& input_device_id) OVERRIDE;
36 36
37 // Implementation of AudioManagerBase. 37 // Implementation of AudioManagerBase.
38 virtual AudioOutputStream* MakeLinearOutputStream( 38 virtual AudioOutputStream* MakeLinearOutputStream(
39 const AudioParameters& params) OVERRIDE; 39 const AudioParameters& params) OVERRIDE;
40 virtual AudioOutputStream* MakeLowLatencyOutputStream( 40 virtual AudioOutputStream* MakeLowLatencyOutputStream(
41 const AudioParameters& params, 41 const AudioParameters& params,
(...skipping 13 matching lines...) Expand all
55 const AudioParameters& input_params) OVERRIDE; 55 const AudioParameters& input_params) OVERRIDE;
56 56
57 private: 57 private:
58 enum EnumerationType { 58 enum EnumerationType {
59 kUninitializedEnumeration = 0, 59 kUninitializedEnumeration = 0,
60 kMMDeviceEnumeration, 60 kMMDeviceEnumeration,
61 kWaveEnumeration, 61 kWaveEnumeration,
62 }; 62 };
63 63
64 // Allow unit test to modify the utilized enumeration API. 64 // Allow unit test to modify the utilized enumeration API.
65 // TODO(joi): Collapse these tests into one.
66 friend class AudioManagerTest;
67 friend class AudioInputDeviceTest; 65 friend class AudioInputDeviceTest;
68 66
69 EnumerationType enumeration_type_; 67 EnumerationType enumeration_type_;
70 EnumerationType enumeration_type() { return enumeration_type_; } 68 EnumerationType enumeration_type() { return enumeration_type_; }
71 void SetEnumerationType(EnumerationType type) { 69 void SetEnumerationType(EnumerationType type) {
72 enumeration_type_ = type; 70 enumeration_type_ = type;
73 } 71 }
74 72
75 // Returns a PCMWaveInAudioInputStream instance or NULL on failure. 73 // Returns a PCMWaveInAudioInputStream instance or NULL on failure.
76 // This method converts MMDevice-style device ID to WaveIn-style device ID if 74 // This method converts MMDevice-style device ID to WaveIn-style device ID if
(...skipping 12 matching lines...) Expand all
89 87
90 // Listen for output device changes. 88 // Listen for output device changes.
91 scoped_ptr<AudioDeviceListenerWin> output_device_listener_; 89 scoped_ptr<AudioDeviceListenerWin> output_device_listener_;
92 90
93 DISALLOW_COPY_AND_ASSIGN(AudioManagerWin); 91 DISALLOW_COPY_AND_ASSIGN(AudioManagerWin);
94 }; 92 };
95 93
96 } // namespace media 94 } // namespace media
97 95
98 #endif // MEDIA_AUDIO_WIN_AUDIO_MANAGER_WIN_H_ 96 #endif // MEDIA_AUDIO_WIN_AUDIO_MANAGER_WIN_H_
OLDNEW
« no previous file with comments | « media/audio/pulse/audio_manager_pulse.h ('k') | media/audio/win/device_enumeration_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698