| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 12 matching lines...) Expand all Loading... |
| 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 AudioParam_h | 29 #ifndef AudioParam_h |
| 30 #define AudioParam_h | 30 #define AudioParam_h |
| 31 | 31 |
| 32 #include "bindings/core/v8/ScriptWrappable.h" | 32 #include "bindings/core/v8/ScriptWrappable.h" |
| 33 #include "core/dom/DOMTypedArray.h" |
| 33 #include "modules/webaudio/AudioContext.h" | 34 #include "modules/webaudio/AudioContext.h" |
| 34 #include "modules/webaudio/AudioParamTimeline.h" | 35 #include "modules/webaudio/AudioParamTimeline.h" |
| 35 #include "modules/webaudio/AudioSummingJunction.h" | 36 #include "modules/webaudio/AudioSummingJunction.h" |
| 36 #include <sys/types.h> | |
| 37 #include "wtf/Float32Array.h" | |
| 38 #include "wtf/PassRefPtr.h" | 37 #include "wtf/PassRefPtr.h" |
| 39 #include "wtf/text/WTFString.h" | 38 #include "wtf/text/WTFString.h" |
| 39 #include <sys/types.h> |
| 40 | 40 |
| 41 namespace blink { | 41 namespace blink { |
| 42 | 42 |
| 43 class AudioNodeOutput; | 43 class AudioNodeOutput; |
| 44 | 44 |
| 45 class AudioParam final : public AudioSummingJunction, public ScriptWrappable { | 45 class AudioParam final : public AudioSummingJunction, public ScriptWrappable { |
| 46 DEFINE_WRAPPERTYPEINFO(); | 46 DEFINE_WRAPPERTYPEINFO(); |
| 47 public: | 47 public: |
| 48 static const double DefaultSmoothingConstant; | 48 static const double DefaultSmoothingConstant; |
| 49 static const double SnapThreshold; | 49 static const double SnapThreshold; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 m_timeline.linearRampToValueAtTime(value, time, exceptionState); | 88 m_timeline.linearRampToValueAtTime(value, time, exceptionState); |
| 89 } | 89 } |
| 90 void exponentialRampToValueAtTime(float value, double time, ExceptionState&
es) | 90 void exponentialRampToValueAtTime(float value, double time, ExceptionState&
es) |
| 91 { | 91 { |
| 92 m_timeline.exponentialRampToValueAtTime(value, time, es); | 92 m_timeline.exponentialRampToValueAtTime(value, time, es); |
| 93 } | 93 } |
| 94 void setTargetAtTime(float target, double time, double timeConstant, Excepti
onState& exceptionState) | 94 void setTargetAtTime(float target, double time, double timeConstant, Excepti
onState& exceptionState) |
| 95 { | 95 { |
| 96 m_timeline.setTargetAtTime(target, time, timeConstant, exceptionState); | 96 m_timeline.setTargetAtTime(target, time, timeConstant, exceptionState); |
| 97 } | 97 } |
| 98 void setValueCurveAtTime(Float32Array* curve, double time, double duration,
ExceptionState& exceptionState) | 98 void setValueCurveAtTime(DOMFloat32Array* curve, double time, double duratio
n, ExceptionState& exceptionState) |
| 99 { | 99 { |
| 100 m_timeline.setValueCurveAtTime(curve, time, duration, exceptionState); | 100 m_timeline.setValueCurveAtTime(curve->view(), time, duration, exceptionS
tate); |
| 101 } | 101 } |
| 102 void cancelScheduledValues(double startTime, ExceptionState& exceptionState) | 102 void cancelScheduledValues(double startTime, ExceptionState& exceptionState) |
| 103 { | 103 { |
| 104 m_timeline.cancelScheduledValues(startTime, exceptionState); | 104 m_timeline.cancelScheduledValues(startTime, exceptionState); |
| 105 } | 105 } |
| 106 | 106 |
| 107 bool hasSampleAccurateValues() { return m_timeline.hasValues() || numberOfRe
nderingConnections(); } | 107 bool hasSampleAccurateValues() { return m_timeline.hasValues() || numberOfRe
nderingConnections(); } |
| 108 | 108 |
| 109 // Calculates numberOfValues parameter values starting at the context's curr
ent time. | 109 // Calculates numberOfValues parameter values starting at the context's curr
ent time. |
| 110 // Must be called in the context's render thread. | 110 // Must be called in the context's render thread. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 130 | 130 |
| 131 // Smoothing (de-zippering) | 131 // Smoothing (de-zippering) |
| 132 double m_smoothedValue; | 132 double m_smoothedValue; |
| 133 | 133 |
| 134 AudioParamTimeline m_timeline; | 134 AudioParamTimeline m_timeline; |
| 135 }; | 135 }; |
| 136 | 136 |
| 137 } // namespace blink | 137 } // namespace blink |
| 138 | 138 |
| 139 #endif // AudioParam_h | 139 #endif // AudioParam_h |
| OLD | NEW |