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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
48 void linearRampToValueAtTime(float value, double time, ExceptionState&); | 48 void linearRampToValueAtTime(float value, double time, ExceptionState&); |
49 void exponentialRampToValueAtTime(float value, double time, ExceptionState&) ; | 49 void exponentialRampToValueAtTime(float value, double time, ExceptionState&) ; |
50 void setTargetAtTime(float target, double time, double timeConstant, Excepti onState&); | 50 void setTargetAtTime(float target, double time, double timeConstant, Excepti onState&); |
51 void setValueCurveAtTime(DOMFloat32Array* curve, double time, double duratio n, ExceptionState&); | 51 void setValueCurveAtTime(DOMFloat32Array* curve, double time, double duratio n, ExceptionState&); |
52 void cancelScheduledValues(double startTime, ExceptionState&); | 52 void cancelScheduledValues(double startTime, ExceptionState&); |
53 | 53 |
54 // hasValue is set to true if a valid timeline value is returned. | 54 // hasValue is set to true if a valid timeline value is returned. |
55 // otherwise defaultValue is returned. | 55 // otherwise defaultValue is returned. |
56 float valueForContextTime(AbstractAudioContext*, float defaultValue, bool& h asValue); | 56 float valueForContextTime(AbstractAudioContext*, float defaultValue, bool& h asValue); |
57 | 57 |
58 // Given the time range, calculates parameter values into the values buffer | 58 // Given the time range, calculates parameter values into the values buffer |
hongchan
2015/09/30 22:14:18
This can be like: "Given the time range in frame v
Raymond Toy
2015/10/01 18:05:55
done
| |
59 // and returns the last parameter value calculated for "values" or the defau ltValue if none were calculated. | 59 // and returns the last parameter value calculated for "values" or the defau ltValue if none were calculated. |
60 // controlRate is the rate (number per second) at which parameter values wil l be calculated. | 60 // controlRate is the rate (number per second) at which parameter values wil l be calculated. |
61 // It should equal sampleRate for sample-accurate parameter changes, and oth erwise will usually match | 61 // It should equal sampleRate for sample-accurate parameter changes, and oth erwise will usually match |
62 // the render quantum size such that the parameter value changes once per re nder quantum. | 62 // the render quantum size such that the parameter value changes once per re nder quantum. |
63 float valuesForTimeRange(double startTime, double endTime, float defaultValu e, float* values, unsigned numberOfValues, double sampleRate, double controlRate ); | 63 float valuesForTimeRange(size_t startTime, size_t endTime, float defaultValu e, float* values, unsigned numberOfValues, double sampleRate, double controlRate ); |
hongchan
2015/09/30 22:14:18
size_t startFrame, size_t endFrame
Raymond Toy
2015/10/01 18:05:55
Done
| |
64 | 64 |
65 bool hasValues() { return m_events.size(); } | 65 bool hasValues() { return m_events.size(); } |
66 | 66 |
67 private: | 67 private: |
68 class ParamEvent { | 68 class ParamEvent { |
69 public: | 69 public: |
70 enum Type { | 70 enum Type { |
71 SetValue, | 71 SetValue, |
72 LinearRampToValue, | 72 LinearRampToValue, |
73 ExponentialRampToValue, | 73 ExponentialRampToValue, |
(...skipping 22 matching lines...) Expand all Loading... | |
96 private: | 96 private: |
97 Type m_type; | 97 Type m_type; |
98 float m_value; | 98 float m_value; |
99 double m_time; | 99 double m_time; |
100 double m_timeConstant; | 100 double m_timeConstant; |
101 double m_duration; | 101 double m_duration; |
102 RefPtr<DOMFloat32Array> m_curve; | 102 RefPtr<DOMFloat32Array> m_curve; |
103 }; | 103 }; |
104 | 104 |
105 void insertEvent(const ParamEvent&, ExceptionState&); | 105 void insertEvent(const ParamEvent&, ExceptionState&); |
106 float valuesForTimeRangeImpl(double startTime, double endTime, float default Value, float* values, unsigned numberOfValues, double sampleRate, double control Rate); | 106 float valuesForTimeRangeImpl(size_t startTime, size_t endTime, float default Value, float* values, unsigned numberOfValues, double sampleRate, double control Rate); |
hongchan
2015/09/30 22:14:18
Same as above.
| |
107 | 107 |
108 // Produce a nice string describing the event in human-readable form. | 108 // Produce a nice string describing the event in human-readable form. |
109 String eventToString(const ParamEvent&); | 109 String eventToString(const ParamEvent&); |
110 Vector<ParamEvent> m_events; | 110 Vector<ParamEvent> m_events; |
111 | 111 |
112 Mutex m_eventsLock; | 112 Mutex m_eventsLock; |
113 }; | 113 }; |
114 | 114 |
115 } // namespace blink | 115 } // namespace blink |
116 | 116 |
117 #endif // AudioParamTimeline_h | 117 #endif // AudioParamTimeline_h |
OLD | NEW |