| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_AUDIO_OUTPUT_PROXY_H_ | 5 #ifndef MEDIA_AUDIO_AUDIO_OUTPUT_PROXY_H_ |
| 6 #define MEDIA_AUDIO_AUDIO_OUTPUT_PROXY_H_ | 6 #define MEDIA_AUDIO_AUDIO_OUTPUT_PROXY_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 explicit AudioOutputProxy(AudioOutputDispatcher* dispatcher); | 32 explicit AudioOutputProxy(AudioOutputDispatcher* dispatcher); |
| 33 | 33 |
| 34 // AudioOutputStream interface. | 34 // AudioOutputStream interface. |
| 35 bool Open() override; | 35 bool Open() override; |
| 36 void Start(AudioSourceCallback* callback) override; | 36 void Start(AudioSourceCallback* callback) override; |
| 37 void Stop() override; | 37 void Stop() override; |
| 38 void SetVolume(double volume) override; | 38 void SetVolume(double volume) override; |
| 39 void GetVolume(double* volume) override; | 39 void GetVolume(double* volume) override; |
| 40 void Close() override; | 40 void Close() override; |
| 41 | 41 |
| 42 AudioOutputDispatcher* get_dispatcher_for_testing() const { |
| 43 return dispatcher_.get(); |
| 44 } |
| 45 |
| 42 private: | 46 private: |
| 43 enum State { | 47 enum State { |
| 44 kCreated, | 48 kCreated, |
| 45 kOpened, | 49 kOpened, |
| 46 kPlaying, | 50 kPlaying, |
| 47 kClosed, | 51 kClosed, |
| 48 kOpenError, | 52 kOpenError, |
| 49 kStartError, | 53 kStartError, |
| 50 }; | 54 }; |
| 51 | 55 |
| 52 ~AudioOutputProxy() override; | 56 ~AudioOutputProxy() override; |
| 53 | 57 |
| 54 scoped_refptr<AudioOutputDispatcher> dispatcher_; | 58 scoped_refptr<AudioOutputDispatcher> dispatcher_; |
| 55 State state_; | 59 State state_; |
| 56 | 60 |
| 57 // Need to save volume here, so that we can restore it in case the stream | 61 // Need to save volume here, so that we can restore it in case the stream |
| 58 // is stopped, and then started again. | 62 // is stopped, and then started again. |
| 59 double volume_; | 63 double volume_; |
| 60 | 64 |
| 61 DISALLOW_COPY_AND_ASSIGN(AudioOutputProxy); | 65 DISALLOW_COPY_AND_ASSIGN(AudioOutputProxy); |
| 62 }; | 66 }; |
| 63 | 67 |
| 64 } // namespace media | 68 } // namespace media |
| 65 | 69 |
| 66 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_PROXY_H_ | 70 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_PROXY_H_ |
| OLD | NEW |