OLD | NEW |
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_WAVEIN_INPUT_WIN_H_ | 5 #ifndef MEDIA_AUDIO_WIN_WAVEIN_INPUT_WIN_H_ |
6 #define MEDIA_AUDIO_WIN_WAVEIN_INPUT_WIN_H_ | 6 #define MEDIA_AUDIO_WIN_WAVEIN_INPUT_WIN_H_ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <mmsystem.h> | 9 #include <mmsystem.h> |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 // Implementation of AudioInputStream. | 30 // Implementation of AudioInputStream. |
31 virtual bool Open() OVERRIDE; | 31 virtual bool Open() OVERRIDE; |
32 virtual void Start(AudioInputCallback* callback) OVERRIDE; | 32 virtual void Start(AudioInputCallback* callback) OVERRIDE; |
33 virtual void Stop() OVERRIDE; | 33 virtual void Stop() OVERRIDE; |
34 virtual void Close() OVERRIDE; | 34 virtual void Close() OVERRIDE; |
35 // TODO(henrika): Add volume support using the Audio Mixer API. | 35 // TODO(henrika): Add volume support using the Audio Mixer API. |
36 virtual double GetMaxVolume() OVERRIDE; | 36 virtual double GetMaxVolume() OVERRIDE; |
37 virtual void SetVolume(double volume) OVERRIDE; | 37 virtual void SetVolume(double volume) OVERRIDE; |
38 virtual double GetVolume() OVERRIDE; | 38 virtual double GetVolume() OVERRIDE; |
| 39 virtual void SetAutomaticGainControl(bool enabled) OVERRIDE; |
| 40 virtual bool GetAutomaticGainControl() OVERRIDE; |
39 | 41 |
40 private: | 42 private: |
41 enum State { | 43 enum State { |
42 kStateEmpty, // Initial state. | 44 kStateEmpty, // Initial state. |
43 kStateReady, // Device obtained and ready to record. | 45 kStateReady, // Device obtained and ready to record. |
44 kStateRecording, // Recording audio. | 46 kStateRecording, // Recording audio. |
45 kStateStopping, // Trying to stop, waiting for callback to finish. | 47 kStateStopping, // Trying to stop, waiting for callback to finish. |
46 kStateStopped, // Stopped. Device was reset. | 48 kStateStopped, // Stopped. Device was reset. |
47 kStateClosed // Device has been released. | 49 kStateClosed // Device has been released. |
48 }; | 50 }; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 // Pointer to the first allocated audio buffer. This object owns it. | 109 // Pointer to the first allocated audio buffer. This object owns it. |
108 WAVEHDR* buffer_; | 110 WAVEHDR* buffer_; |
109 | 111 |
110 // An event that is signaled when the callback thread is ready to stop. | 112 // An event that is signaled when the callback thread is ready to stop. |
111 base::win::ScopedHandle stopped_event_; | 113 base::win::ScopedHandle stopped_event_; |
112 | 114 |
113 DISALLOW_COPY_AND_ASSIGN(PCMWaveInAudioInputStream); | 115 DISALLOW_COPY_AND_ASSIGN(PCMWaveInAudioInputStream); |
114 }; | 116 }; |
115 | 117 |
116 #endif // MEDIA_AUDIO_WIN_WAVEIN_INPUT_WIN_H_ | 118 #endif // MEDIA_AUDIO_WIN_WAVEIN_INPUT_WIN_H_ |
OLD | NEW |