| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 void setValueAtTime(float value, double time, ExceptionState&); | 48 void setValueAtTime(float value, double time, ExceptionState&); |
| 49 void linearRampToValueAtTime(float value, double time, float initialValue, d
ouble callTime, ExceptionState&); | 49 void linearRampToValueAtTime(float value, double time, float initialValue, d
ouble callTime, ExceptionState&); |
| 50 void exponentialRampToValueAtTime(float value, double time, float initialVa
lue, double callTime, ExceptionState&); | 50 void exponentialRampToValueAtTime(float value, double time, float initialVa
lue, double callTime, ExceptionState&); |
| 51 void setTargetAtTime(float target, double time, double timeConstant, Excepti
onState&); | 51 void setTargetAtTime(float target, double time, double timeConstant, Excepti
onState&); |
| 52 void setValueCurveAtTime(DOMFloat32Array* curve, double time, double duratio
n, ExceptionState&); | 52 void setValueCurveAtTime(DOMFloat32Array* curve, double time, double duratio
n, ExceptionState&); |
| 53 void cancelScheduledValues(double startTime, ExceptionState&); | 53 void cancelScheduledValues(double startTime, ExceptionState&); |
| 54 | 54 |
| 55 // hasValue is set to true if a valid timeline value is returned. | 55 // hasValue is set to true if a valid timeline value is returned. |
| 56 // otherwise defaultValue is returned. | 56 // otherwise defaultValue is returned. |
| 57 float valueForContextTime(AudioDestinationHandler&, float defaultValue, bool
& hasValue); | 57 float valueForContextTime(AudioDestinationHandler&, float defaultValue, bool
& hasValue, float minValue, float maxValue); |
| 58 | 58 |
| 59 // Given the time range in frames, calculates parameter values into the valu
es buffer and | 59 // Given the time range in frames, calculates parameter values into the valu
es buffer and |
| 60 // returns the last parameter value calculated for "values" or the defaultVa
lue if none were | 60 // returns the last parameter value calculated for "values" or the defaultVa
lue if none were |
| 61 // calculated. controlRate is the rate (number per second) at which paramet
er values will be | 61 // calculated. controlRate is the rate (number per second) at which paramet
er values will be |
| 62 // calculated. It should equal sampleRate for sample-accurate parameter cha
nges, and otherwise | 62 // calculated. It should equal sampleRate for sample-accurate parameter cha
nges, and otherwise |
| 63 // will usually match the render quantum size such that the parameter value
changes once per | 63 // will usually match the render quantum size such that the parameter value
changes once per |
| 64 // render quantum. | 64 // render quantum. |
| 65 float valuesForFrameRange(size_t startFrame, size_t endFrame, float defaultV
alue, float* values, unsigned numberOfValues, double sampleRate, double controlR
ate); | 65 float valuesForFrameRange(size_t startFrame, size_t endFrame, float defaultV
alue, float* values, unsigned numberOfValues, double sampleRate, double controlR
ate, float minValue, float maxValue); |
| 66 | 66 |
| 67 // Returns true if this AudioParam has any events on it. | 67 // Returns true if this AudioParam has any events on it. |
| 68 bool hasValues() const; | 68 bool hasValues() const; |
| 69 | 69 |
| 70 private: | 70 private: |
| 71 class ParamEvent { | 71 class ParamEvent { |
| 72 public: | 72 public: |
| 73 enum Type { | 73 enum Type { |
| 74 SetValue, | 74 SetValue, |
| 75 LinearRampToValue, | 75 LinearRampToValue, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 // Produce a nice string describing the event in human-readable form. | 119 // Produce a nice string describing the event in human-readable form. |
| 120 String eventToString(const ParamEvent&); | 120 String eventToString(const ParamEvent&); |
| 121 Vector<ParamEvent> m_events; | 121 Vector<ParamEvent> m_events; |
| 122 | 122 |
| 123 mutable Mutex m_eventsLock; | 123 mutable Mutex m_eventsLock; |
| 124 }; | 124 }; |
| 125 | 125 |
| 126 } // namespace blink | 126 } // namespace blink |
| 127 | 127 |
| 128 #endif // AudioParamTimeline_h | 128 #endif // AudioParamTimeline_h |
| OLD | NEW |