OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 14 matching lines...) Expand all Loading... |
25 const AudioParameters& params, | 25 const AudioParameters& params, |
26 int num_buffers, | 26 int num_buffers, |
27 const std::string& device_id); | 27 const std::string& device_id); |
28 virtual ~PCMWaveInAudioInputStream(); | 28 virtual ~PCMWaveInAudioInputStream(); |
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 virtual double GetMaxVolume() OVERRIDE; |
| 36 virtual void SetVolume(double volume) OVERRIDE; |
| 37 virtual double GetVolume() OVERRIDE; |
35 | 38 |
36 private: | 39 private: |
37 enum State { | 40 enum State { |
38 kStateEmpty, // Initial state. | 41 kStateEmpty, // Initial state. |
39 kStateReady, // Device obtained and ready to record. | 42 kStateReady, // Device obtained and ready to record. |
40 kStateRecording, // Recording audio. | 43 kStateRecording, // Recording audio. |
41 kStateStopping, // Trying to stop, waiting for callback to finish. | 44 kStateStopping, // Trying to stop, waiting for callback to finish. |
42 kStateStopped, // Stopped. Device was reset. | 45 kStateStopped, // Stopped. Device was reset. |
43 kStateClosed // Device has been released. | 46 kStateClosed // Device has been released. |
44 }; | 47 }; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // Pointer to the first allocated audio buffer. This object owns it. | 103 // Pointer to the first allocated audio buffer. This object owns it. |
101 WAVEHDR* buffer_; | 104 WAVEHDR* buffer_; |
102 | 105 |
103 // An event that is signaled when the callback thread is ready to stop. | 106 // An event that is signaled when the callback thread is ready to stop. |
104 base::win::ScopedHandle stopped_event_; | 107 base::win::ScopedHandle stopped_event_; |
105 | 108 |
106 DISALLOW_COPY_AND_ASSIGN(PCMWaveInAudioInputStream); | 109 DISALLOW_COPY_AND_ASSIGN(PCMWaveInAudioInputStream); |
107 }; | 110 }; |
108 | 111 |
109 #endif // MEDIA_AUDIO_WIN_WAVEIN_INPUT_WIN_H_ | 112 #endif // MEDIA_AUDIO_WIN_WAVEIN_INPUT_WIN_H_ |
OLD | NEW |