OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_WAVEOUT_OUTPUT_WIN_H_ | 5 #ifndef MEDIA_AUDIO_WAVEOUT_OUTPUT_WIN_H_ |
6 #define MEDIA_AUDIO_WAVEOUT_OUTPUT_WIN_H_ | 6 #define MEDIA_AUDIO_WAVEOUT_OUTPUT_WIN_H_ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <mmsystem.h> | 9 #include <mmsystem.h> |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 char bits_per_sample, UINT device_id); | 33 char bits_per_sample, UINT device_id); |
34 virtual ~PCMWaveOutAudioOutputStream(); | 34 virtual ~PCMWaveOutAudioOutputStream(); |
35 | 35 |
36 // Implementation of AudioOutputStream. | 36 // Implementation of AudioOutputStream. |
37 virtual bool Open(size_t packet_size); | 37 virtual bool Open(size_t packet_size); |
38 virtual void Close(); | 38 virtual void Close(); |
39 virtual void Start(AudioSourceCallback* callback); | 39 virtual void Start(AudioSourceCallback* callback); |
40 virtual void Stop(); | 40 virtual void Stop(); |
41 virtual void SetVolume(double left_level, double right_level); | 41 virtual void SetVolume(double left_level, double right_level); |
42 virtual void GetVolume(double* left_level, double* right_level); | 42 virtual void GetVolume(double* left_level, double* right_level); |
43 virtual size_t GetNumBuffers(); | |
44 | 43 |
45 // Sends a buffer to the audio driver for playback. | 44 // Sends a buffer to the audio driver for playback. |
46 void QueueNextPacket(WAVEHDR* buffer); | 45 void QueueNextPacket(WAVEHDR* buffer); |
47 | 46 |
48 private: | 47 private: |
49 enum State { | 48 enum State { |
50 PCMA_BRAND_NEW, // Initial state. | 49 PCMA_BRAND_NEW, // Initial state. |
51 PCMA_READY, // Device obtained and ready to play. | 50 PCMA_READY, // Device obtained and ready to play. |
52 PCMA_PLAYING, // Playing audio. | 51 PCMA_PLAYING, // Playing audio. |
53 PCMA_STOPPING, // Trying to stop, waiting for callback to finish. | 52 PCMA_STOPPING, // Trying to stop, waiting for callback to finish. |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 // Pointer to the first allocated audio buffer. This object owns it. | 96 // Pointer to the first allocated audio buffer. This object owns it. |
98 WAVEHDR* buffer_; | 97 WAVEHDR* buffer_; |
99 | 98 |
100 // An event that is signaled when the callback thread is ready to stop. | 99 // An event that is signaled when the callback thread is ready to stop. |
101 ScopedHandle stopped_event_; | 100 ScopedHandle stopped_event_; |
102 | 101 |
103 DISALLOW_COPY_AND_ASSIGN(PCMWaveOutAudioOutputStream); | 102 DISALLOW_COPY_AND_ASSIGN(PCMWaveOutAudioOutputStream); |
104 }; | 103 }; |
105 | 104 |
106 #endif // MEDIA_AUDIO_WAVEOUT_OUTPUT_WIN_H_ | 105 #endif // MEDIA_AUDIO_WAVEOUT_OUTPUT_WIN_H_ |
OLD | NEW |