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

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

Issue 9570014: Move some generic functions to AudioManagerBase to be inherited by platform-specific AudioManager*** (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: changed the GetMaxOutputStreamsAllowed Created 8 years, 9 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 | Annotate | Revision Log
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 <windows.h> 8 #include <windows.h>
9 #include <string> 9 #include <string>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/gtest_prod_util.h" 13 #include "base/gtest_prod_util.h"
14 #include "media/audio/audio_manager_base.h" 14 #include "media/audio/audio_manager_base.h"
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 // Implementation of AudioManager. 22 // Implementation of AudioManager.
23 virtual bool HasAudioOutputDevices() OVERRIDE; 23 virtual bool HasAudioOutputDevices() OVERRIDE;
24 virtual bool HasAudioInputDevices() OVERRIDE; 24 virtual bool HasAudioInputDevices() OVERRIDE;
25 virtual AudioOutputStream* MakeAudioOutputStream(
26 const AudioParameters& params) OVERRIDE;
27 virtual AudioInputStream* MakeAudioInputStream(
28 const AudioParameters& params, const std::string& device_id) OVERRIDE;
29 virtual void MuteAll() OVERRIDE; 25 virtual void MuteAll() OVERRIDE;
30 virtual void UnMuteAll() OVERRIDE; 26 virtual void UnMuteAll() OVERRIDE;
31 virtual string16 GetAudioInputDeviceModel() OVERRIDE; 27 virtual string16 GetAudioInputDeviceModel() OVERRIDE;
32 virtual bool CanShowAudioInputSettings() OVERRIDE; 28 virtual bool CanShowAudioInputSettings() OVERRIDE;
33 virtual void ShowAudioInputSettings() OVERRIDE; 29 virtual void ShowAudioInputSettings() OVERRIDE;
34 virtual void GetAudioInputDeviceNames(media::AudioDeviceNames* device_names) 30 virtual void GetAudioInputDeviceNames(media::AudioDeviceNames* device_names)
35 OVERRIDE; 31 OVERRIDE;
36 32
37 // Windows-only methods to free a stream created in MakeAudioStream. These 33 // Implementation of AudioManagerBase.
38 // are called internally by the audio stream when it has been closed. 34 virtual AudioOutputStream* MakeLinearOutputStream(
39 void ReleaseOutputStream(AudioOutputStream* stream); 35 const AudioParameters& params) OVERRIDE;
40 36 virtual AudioOutputStream* MakeLowLatencyOutputStream(
41 // Called internally by the audio stream when it has been closed. 37 const AudioParameters& params) OVERRIDE;
42 void ReleaseInputStream(AudioInputStream* stream); 38 virtual AudioInputStream* MakeLinearInputStream(
39 const AudioParameters& params, const std::string& device_id) OVERRIDE;
40 virtual AudioInputStream* MakeLowLatencyInputStream(
41 const AudioParameters& params, const std::string& device_id) OVERRIDE;
scherkus (not reviewing) 2012/03/06 22:31:51 nit: indent
no longer working on chromium 2012/03/07 09:57:08 Done.
43 42
44 protected: 43 protected:
45 virtual ~AudioManagerWin(); 44 virtual ~AudioManagerWin();
46 45
47 private: 46 private:
48 enum EnumerationType { 47 enum EnumerationType {
49 kUninitializedEnumeration = 0, 48 kUninitializedEnumeration = 0,
50 kMMDeviceEnumeration, 49 kMMDeviceEnumeration,
51 kWaveEnumeration, 50 kWaveEnumeration,
52 }; 51 };
53 52
54 // Allow unit test to modify the utilized enumeration API. 53 // Allow unit test to modify the utilized enumeration API.
55 friend class AudioInputDeviceTest; 54 friend class AudioInputDeviceTest;
56 55
57 EnumerationType enumeration_type_; 56 EnumerationType enumeration_type_;
58 EnumerationType enumeration_type() { return enumeration_type_; } 57 EnumerationType enumeration_type() { return enumeration_type_; }
59 void SetEnumerationType(EnumerationType type) { 58 void SetEnumerationType(EnumerationType type) {
60 enumeration_type_ = type; 59 enumeration_type_ = type;
61 } 60 }
62 61
63 // Number of currently open output streams.
64 int num_output_streams_;
65
66 DISALLOW_COPY_AND_ASSIGN(AudioManagerWin); 62 DISALLOW_COPY_AND_ASSIGN(AudioManagerWin);
67 }; 63 };
68 64
69 #endif // MEDIA_AUDIO_WIN_AUDIO_MANAGER_WIN_H_ 65 #endif // MEDIA_AUDIO_WIN_AUDIO_MANAGER_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698