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

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

Issue 159167: Refactoring to share MockAudioOutputStream implementations across 3 platforms (Closed)
Patch Set: the same as before Created 11 years, 5 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
« no previous file with comments | « media/audio/win/audio_output_win_unittest.cc ('k') | media/audio/win/waveout_output_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 22 matching lines...) Expand all
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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 WAVEHDR* buffer_; 100 WAVEHDR* buffer_;
102 101
103 // An event that is signaled when the callback thread is ready to stop. 102 // An event that is signaled when the callback thread is ready to stop.
104 ScopedHandle stopped_event_; 103 ScopedHandle stopped_event_;
105 104
106 DISALLOW_COPY_AND_ASSIGN(PCMWaveOutAudioOutputStream); 105 DISALLOW_COPY_AND_ASSIGN(PCMWaveOutAudioOutputStream);
107 }; 106 };
108 107
109 #endif // MEDIA_AUDIO_WIN_WAVEOUT_OUTPUT_WIN_H_ 108 #endif // MEDIA_AUDIO_WIN_WAVEOUT_OUTPUT_WIN_H_
110 109
OLDNEW
« no previous file with comments | « media/audio/win/audio_output_win_unittest.cc ('k') | media/audio/win/waveout_output_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698