Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(489)

Unified Diff: third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.h

Issue 1377903002: Use frames instead of time for running AudioParam timelines. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.h
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.h b/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.h
index 42f5bda9d74265de82e627875853d51a307c76db..4acedab11eb76138c6d7ee52b552b4dcc1b60ca1 100644
--- a/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.h
+++ b/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.h
@@ -55,12 +55,13 @@ public:
// otherwise defaultValue is returned.
float valueForContextTime(AbstractAudioContext*, float defaultValue, bool& hasValue);
- // Given the time range, calculates parameter values into the values buffer
- // and returns the last parameter value calculated for "values" or the defaultValue if none were calculated.
- // controlRate is the rate (number per second) at which parameter values will be calculated.
- // It should equal sampleRate for sample-accurate parameter changes, and otherwise will usually match
- // the render quantum size such that the parameter value changes once per render quantum.
- float valuesForTimeRange(double startTime, double endTime, float defaultValue, float* values, unsigned numberOfValues, double sampleRate, double controlRate);
+ // Given the time range in frames, calculates parameter values into the values buffer and
+ // returns the last parameter value calculated for "values" or the defaultValue if none were
+ // calculated. controlRate is the rate (number per second) at which parameter values will be
+ // calculated. It should equal sampleRate for sample-accurate parameter changes, and otherwise
+ // will usually match the render quantum size such that the parameter value changes once per
+ // render quantum.
+ float valuesForFrameRange(size_t startFrame, size_t endFrame, float defaultValue, float* values, unsigned numberOfValues, double sampleRate, double controlRate);
bool hasValues() { return m_events.size(); }
@@ -103,7 +104,7 @@ private:
};
void insertEvent(const ParamEvent&, ExceptionState&);
- float valuesForTimeRangeImpl(double startTime, double endTime, float defaultValue, float* values, unsigned numberOfValues, double sampleRate, double controlRate);
+ float valuesForFrameRangeImpl(size_t startFrame, size_t endFrame, float defaultValue, float* values, unsigned numberOfValues, double sampleRate, double controlRate);
// Produce a nice string describing the event in human-readable form.
String eventToString(const ParamEvent&);

Powered by Google App Engine
This is Rietveld 408576698