OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
scherkus (not reviewing)
2010/11/22 06:43:15
could we get an explanation of this class somewher
Sergey Ulanov
2010/11/23 19:51:46
Done.
| |
5 #ifndef MEDIA_AUDIO_AUDIO_OUTPUT_STREAM_PROXY_H | |
scherkus (not reviewing)
2010/11/22 06:43:15
header guards should end with _
Sergey Ulanov
2010/11/23 19:51:46
Done.
| |
6 #define MEDIA_AUDIO_AUDIO_OUTPUT_STREAM_PROXY_H | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "base/task.h" | |
10 #include "media/audio/audio_io.h" | |
11 #include "media/audio/audio_parameters.h" | |
12 | |
13 class AudioOutputDispatcher; | |
14 | |
15 class AudioOutputProxy : public AudioOutputStream { | |
scherkus (not reviewing)
2010/11/22 06:43:15
hrmm I'm surprised more of the audio code isn't un
Sergey Ulanov
2010/11/23 19:51:46
Yes, There is a lot of stuff that isn't under medi
| |
16 public: | |
17 AudioOutputProxy(AudioOutputDispatcher* dispatcher); | |
18 | |
19 // AudioOutputStream interface. | |
20 virtual bool Open(); | |
21 virtual void Start(AudioSourceCallback* callback); | |
22 virtual void Stop(); | |
23 virtual void SetVolume(double volume); | |
24 virtual void GetVolume(double* volume); | |
25 virtual void Close(); | |
26 | |
27 private: | |
28 // Needs to access destructor. | |
29 friend class DeleteTask<AudioOutputProxy>; | |
30 | |
31 enum State { | |
32 kCreated, | |
33 kOpened, | |
34 kPlaying, | |
35 kClosed, | |
36 kError, | |
37 }; | |
38 | |
39 virtual ~AudioOutputProxy(); | |
40 | |
41 scoped_refptr<AudioOutputDispatcher> dispatcher_; | |
42 State state_; | |
43 | |
44 // The actual audio stream. Must be set to NULL in any state other | |
45 // than kPlaying. | |
46 AudioOutputStream* physical_stream_; | |
47 | |
48 // Need to save volume here, so that we can restore it in case the stream | |
49 // is stopped, and then started again. | |
50 double volume_; | |
51 | |
52 DISALLOW_COPY_AND_ASSIGN(AudioOutputProxy); | |
53 }; | |
54 | |
55 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_STREAM_PROXY_H | |
OLD | NEW |