| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 static ParamEvent createSetValueCurveEvent(DOMFloat32Array* curve, doubl
e time, double duration); | 85 static ParamEvent createSetValueCurveEvent(DOMFloat32Array* curve, doubl
e time, double duration); |
| 86 | 86 |
| 87 Type getType() const { return m_type; } | 87 Type getType() const { return m_type; } |
| 88 float value() const { return m_value; } | 88 float value() const { return m_value; } |
| 89 double time() const { return m_time; } | 89 double time() const { return m_time; } |
| 90 double timeConstant() const { return m_timeConstant; } | 90 double timeConstant() const { return m_timeConstant; } |
| 91 double duration() const { return m_duration; } | 91 double duration() const { return m_duration; } |
| 92 DOMFloat32Array* curve() { return m_curve.get(); } | 92 DOMFloat32Array* curve() { return m_curve.get(); } |
| 93 | 93 |
| 94 private: | 94 private: |
| 95 ParamEvent(Type type, float value, double time, double timeConstant, dou
ble duration, PassRefPtr<DOMFloat32Array> curve) | 95 ParamEvent(Type type, float value, double time, double timeConstant, dou
ble duration, DOMFloat32Array* curve) |
| 96 : m_type(type) | 96 : m_type(type) |
| 97 , m_value(value) | 97 , m_value(value) |
| 98 , m_time(time) | 98 , m_time(time) |
| 99 , m_timeConstant(timeConstant) | 99 , m_timeConstant(timeConstant) |
| 100 , m_duration(duration) | 100 , m_duration(duration) |
| 101 , m_curve(curve) | 101 , m_curve(curve) |
| 102 { | 102 { |
| 103 } | 103 } |
| 104 | 104 |
| 105 Type m_type; | 105 Type m_type; |
| 106 float m_value; | 106 float m_value; |
| 107 double m_time; | 107 double m_time; |
| 108 // Only used for SetTarget events | 108 // Only used for SetTarget events |
| 109 double m_timeConstant; | 109 double m_timeConstant; |
| 110 // Only used for SetValueCurve events. | 110 // Only used for SetValueCurve events. |
| 111 double m_duration; | 111 double m_duration; |
| 112 RefPtr<DOMFloat32Array> m_curve; | 112 CrossThreadPersistent<DOMFloat32Array> m_curve; |
| 113 }; | 113 }; |
| 114 | 114 |
| 115 void insertEvent(const ParamEvent&, ExceptionState&); | 115 void insertEvent(const ParamEvent&, ExceptionState&); |
| 116 float valuesForFrameRangeImpl(size_t startFrame, size_t endFrame, float defa
ultValue, float* values, unsigned numberOfValues, double sampleRate, double cont
rolRate); | 116 float valuesForFrameRangeImpl(size_t startFrame, size_t endFrame, float defa
ultValue, float* values, unsigned numberOfValues, double sampleRate, double cont
rolRate); |
| 117 | 117 |
| 118 // Produce a nice string describing the event in human-readable form. | 118 // Produce a nice string describing the event in human-readable form. |
| 119 String eventToString(const ParamEvent&); | 119 String eventToString(const ParamEvent&); |
| 120 Vector<ParamEvent> m_events; | 120 Vector<ParamEvent> m_events; |
| 121 | 121 |
| 122 mutable Mutex m_eventsLock; | 122 mutable Mutex m_eventsLock; |
| 123 }; | 123 }; |
| 124 | 124 |
| 125 } // namespace blink | 125 } // namespace blink |
| 126 | 126 |
| 127 #endif // AudioParamTimeline_h | 127 #endif // AudioParamTimeline_h |
| OLD | NEW |