| 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_WIN_WAVEOUT_OUTPUT_WIN_H_ | 5 #ifndef MEDIA_AUDIO_WIN_WAVEOUT_OUTPUT_WIN_H_ |
| 6 #define MEDIA_AUDIO_WIN_WAVEOUT_OUTPUT_WIN_H_ | 6 #define MEDIA_AUDIO_WIN_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 20 matching lines...) Expand all Loading... |
| 31 PCMWaveOutAudioOutputStream(AudioManagerWin* manager, | 31 PCMWaveOutAudioOutputStream(AudioManagerWin* manager, |
| 32 int channels, int sampling_rate, | 32 int channels, int sampling_rate, |
| 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 volume); |
| 42 virtual void GetVolume(double* left_level, double* right_level); | 42 virtual void GetVolume(double* volume); |
| 43 | 43 |
| 44 // Sends a buffer to the audio driver for playback. | 44 // Sends a buffer to the audio driver for playback. |
| 45 void QueueNextPacket(WAVEHDR* buffer); | 45 void QueueNextPacket(WAVEHDR* buffer); |
| 46 | 46 |
| 47 private: | 47 private: |
| 48 enum State { | 48 enum State { |
| 49 PCMA_BRAND_NEW, // Initial state. | 49 PCMA_BRAND_NEW, // Initial state. |
| 50 PCMA_READY, // Device obtained and ready to play. | 50 PCMA_READY, // Device obtained and ready to play. |
| 51 PCMA_PLAYING, // Playing audio. | 51 PCMA_PLAYING, // Playing audio. |
| 52 PCMA_STOPPING, // Trying to stop, waiting for callback to finish. | 52 PCMA_STOPPING, // Trying to stop, waiting for callback to finish. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 WAVEHDR* buffer_; | 106 WAVEHDR* buffer_; |
| 107 | 107 |
| 108 // An event that is signaled when the callback thread is ready to stop. | 108 // An event that is signaled when the callback thread is ready to stop. |
| 109 ScopedHandle stopped_event_; | 109 ScopedHandle stopped_event_; |
| 110 | 110 |
| 111 DISALLOW_COPY_AND_ASSIGN(PCMWaveOutAudioOutputStream); | 111 DISALLOW_COPY_AND_ASSIGN(PCMWaveOutAudioOutputStream); |
| 112 }; | 112 }; |
| 113 | 113 |
| 114 #endif // MEDIA_AUDIO_WIN_WAVEOUT_OUTPUT_WIN_H_ | 114 #endif // MEDIA_AUDIO_WIN_WAVEOUT_OUTPUT_WIN_H_ |
| 115 | 115 |
| OLD | NEW |