OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 11 matching lines...) Expand all Loading... |
22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 */ | 27 */ |
28 | 28 |
29 #ifndef AudioScheduledSourceNode_h | 29 #ifndef AudioScheduledSourceNode_h |
30 #define AudioScheduledSourceNode_h | 30 #define AudioScheduledSourceNode_h |
31 | 31 |
| 32 #include "bindings/core/v8/ActiveScriptWrappable.h" |
32 #include "modules/webaudio/AudioSourceNode.h" | 33 #include "modules/webaudio/AudioSourceNode.h" |
33 | 34 |
34 namespace blink { | 35 namespace blink { |
35 | 36 |
36 class AbstractAudioContext; | 37 class AbstractAudioContext; |
37 class AudioBus; | 38 class AudioBus; |
38 | 39 |
39 class AudioScheduledSourceHandler : public AudioHandler { | 40 class AudioScheduledSourceHandler : public AudioHandler { |
40 public: | 41 public: |
41 // These are the possible states an AudioScheduledSourceNode can be in: | 42 // These are the possible states an AudioScheduledSourceNode can be in: |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 // has been reached. | 114 // has been reached. |
114 double m_endTime; // in seconds | 115 double m_endTime; // in seconds |
115 | 116 |
116 static const double UnknownTime; | 117 static const double UnknownTime; |
117 private: | 118 private: |
118 // This is accessed by both the main thread and audio thread. Use the sette
r and getter to | 119 // This is accessed by both the main thread and audio thread. Use the sette
r and getter to |
119 // protect the access to this! | 120 // protect the access to this! |
120 int m_playbackState; | 121 int m_playbackState; |
121 }; | 122 }; |
122 | 123 |
123 class AudioScheduledSourceNode : public AudioSourceNode { | 124 class AudioScheduledSourceNode : public AudioSourceNode, public ActiveScriptWrap
pable { |
124 public: | 125 public: |
125 void start(ExceptionState&); | 126 void start(ExceptionState&); |
126 void start(double when, ExceptionState&); | 127 void start(double when, ExceptionState&); |
127 void stop(ExceptionState&); | 128 void stop(ExceptionState&); |
128 void stop(double when, ExceptionState&); | 129 void stop(double when, ExceptionState&); |
129 | 130 |
130 EventListener* onended(); | 131 EventListener* onended(); |
131 void setOnended(PassRefPtrWillBeRawPtr<EventListener>); | 132 void setOnended(PassRefPtrWillBeRawPtr<EventListener>); |
132 | 133 |
133 // ScriptWrappable | 134 // ActiveScriptWrappable |
134 bool hasPendingActivity() const final; | 135 bool hasPendingActivity() const final; |
135 | 136 |
136 protected: | 137 protected: |
137 explicit AudioScheduledSourceNode(AbstractAudioContext&); | 138 explicit AudioScheduledSourceNode(AbstractAudioContext&); |
138 AudioScheduledSourceHandler& audioScheduledSourceHandler() const; | 139 AudioScheduledSourceHandler& audioScheduledSourceHandler() const; |
139 }; | 140 }; |
140 | 141 |
141 } // namespace blink | 142 } // namespace blink |
142 | 143 |
143 #endif // AudioScheduledSourceNode_h | 144 #endif // AudioScheduledSourceNode_h |
OLD | NEW |