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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
11 * documentation and/or other materials provided with the distribution. | 11 * documentation and/or other materials provided with the distribution. |
12 * | 12 * |
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND AN
Y | 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND AN
Y |
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
15 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 15 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
16 * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR AN
Y | 16 * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR AN
Y |
17 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 17 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
18 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 18 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
19 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND O
N | 19 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND O
N |
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
23 */ | 23 */ |
24 | 24 |
25 #ifndef OscillatorNode_h | 25 #ifndef OscillatorNode_h |
26 #define OscillatorNode_h | 26 #define OscillatorNode_h |
27 | 27 |
28 #include "modules/webaudio/AudioParam.h" | 28 #include "modules/webaudio/AudioParam.h" |
29 #include "modules/webaudio/AudioScheduledSourceNode.h" | 29 #include "modules/webaudio/AudioScheduledSourceNode.h" |
| 30 #include "modules/webaudio/OscillatorOptions.h" |
30 #include "platform/audio/AudioBus.h" | 31 #include "platform/audio/AudioBus.h" |
31 #include "wtf/PassRefPtr.h" | 32 #include "wtf/PassRefPtr.h" |
32 #include "wtf/RefPtr.h" | 33 #include "wtf/RefPtr.h" |
33 #include "wtf/Threading.h" | 34 #include "wtf/Threading.h" |
34 | 35 |
35 namespace blink { | 36 namespace blink { |
36 | 37 |
37 class BaseAudioContext; | 38 class BaseAudioContext; |
38 class ExceptionState; | 39 class ExceptionState; |
| 40 class OscillatorOptions; |
39 class PeriodicWave; | 41 class PeriodicWave; |
40 | 42 |
41 // OscillatorNode is an audio generator of periodic waveforms. | 43 // OscillatorNode is an audio generator of periodic waveforms. |
42 | 44 |
43 class OscillatorHandler final : public AudioScheduledSourceHandler { | 45 class OscillatorHandler final : public AudioScheduledSourceHandler { |
44 public: | 46 public: |
45 // The waveform type. | 47 // The waveform type. |
46 // These must be defined as in the .idl file. | 48 // These must be defined as in the .idl file. |
47 enum { | 49 enum { |
48 SINE = 0, | 50 SINE = 0, |
(...skipping 44 matching lines...) Loading... |
93 | 95 |
94 // This Persistent doesn't make a reference cycle including the owner | 96 // This Persistent doesn't make a reference cycle including the owner |
95 // OscillatorNode. | 97 // OscillatorNode. |
96 Persistent<PeriodicWave> m_periodicWave; | 98 Persistent<PeriodicWave> m_periodicWave; |
97 }; | 99 }; |
98 | 100 |
99 class OscillatorNode final : public AudioScheduledSourceNode { | 101 class OscillatorNode final : public AudioScheduledSourceNode { |
100 DEFINE_WRAPPERTYPEINFO(); | 102 DEFINE_WRAPPERTYPEINFO(); |
101 public: | 103 public: |
102 static OscillatorNode* create(BaseAudioContext&, ExceptionState&); | 104 static OscillatorNode* create(BaseAudioContext&, ExceptionState&); |
| 105 static OscillatorNode* create(BaseAudioContext*, const OscillatorOptions&, E
xceptionState&); |
103 DECLARE_VIRTUAL_TRACE(); | 106 DECLARE_VIRTUAL_TRACE(); |
104 | 107 |
105 String type() const; | 108 String type() const; |
106 void setType(const String&, ExceptionState&); | 109 void setType(const String&, ExceptionState&); |
107 AudioParam* frequency(); | 110 AudioParam* frequency(); |
108 AudioParam* detune(); | 111 AudioParam* detune(); |
109 void setPeriodicWave(PeriodicWave*); | 112 void setPeriodicWave(PeriodicWave*); |
110 | 113 |
111 private: | 114 private: |
112 OscillatorNode(BaseAudioContext&); | 115 OscillatorNode(BaseAudioContext&); |
113 OscillatorHandler& oscillatorHandler() const; | 116 OscillatorHandler& oscillatorHandler() const; |
114 | 117 |
115 Member<AudioParam> m_frequency; | 118 Member<AudioParam> m_frequency; |
116 Member<AudioParam> m_detune; | 119 Member<AudioParam> m_detune; |
117 }; | 120 }; |
118 | 121 |
119 } // namespace blink | 122 } // namespace blink |
120 | 123 |
121 #endif // OscillatorNode_h | 124 #endif // OscillatorNode_h |
OLD | NEW |