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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
152 AudioBus* connectionBus = output->pull(0, AudioHandler::ProcessingSizeIn Frames); | 152 AudioBus* connectionBus = output->pull(0, AudioHandler::ProcessingSizeIn Frames); |
153 | 153 |
154 // Sum, with unity-gain. | 154 // Sum, with unity-gain. |
155 summingBus->sumFrom(*connectionBus); | 155 summingBus->sumFrom(*connectionBus); |
156 } | 156 } |
157 } | 157 } |
158 | 158 |
159 void AudioParamHandler::calculateTimelineValues(float* values, unsigned numberOf Values) | 159 void AudioParamHandler::calculateTimelineValues(float* values, unsigned numberOf Values) |
160 { | 160 { |
161 // Calculate values for this render quantum. Normally numberOfValues will | 161 // Calculate values for this render quantum. Normally numberOfValues will |
162 // equal to AudioHandler::ProcessingSizeInFrames (the render quantum size). | 162 // equal to AudioHandler::ProcessingSizeInFrames (the render quantum size). |
hongchan
2015/09/30 22:14:18
Wouldn't it be better to have comments like: Using
Raymond Toy
2015/09/30 22:30:18
You want to add a comment that we're using frames
hongchan
2015/09/30 22:47:59
Yes, it might be confusing inside of some other co
Raymond Toy
2015/10/01 18:05:55
Since we're renaming valuesForTimeRange to valuesF
| |
163 double sampleRate = context()->sampleRate(); | 163 double sampleRate = context()->sampleRate(); |
164 double startTime = context()->currentTime(); | 164 size_t startFrame = context()->currentSampleFrame(); |
165 double endTime = startTime + numberOfValues / sampleRate; | 165 size_t endFrame = startFrame + numberOfValues; |
166 | 166 |
167 // Note we're running control rate at the sample-rate. | 167 // Note we're running control rate at the sample-rate. |
168 // Pass in the current value as default value. | 168 // Pass in the current value as default value. |
169 m_value = m_timeline.valuesForTimeRange(startTime, endTime, narrowPrecisionT oFloat(m_value), values, numberOfValues, sampleRate, sampleRate); | 169 m_value = m_timeline.valuesForTimeRange(startFrame, endFrame, narrowPrecisio nToFloat(m_value), values, numberOfValues, sampleRate, sampleRate); |
hongchan
2015/09/30 22:14:18
In my opinion, the method name with the word 'Time
Raymond Toy
2015/09/30 22:30:18
Renaming to valuesForFrameRange is fine with me.
hongchan
2015/09/30 22:47:59
I think there are few other methods named with "Ti
Raymond Toy
2015/10/01 18:05:55
I've renamed it everywhere, more or less.
| |
170 } | 170 } |
171 | 171 |
172 void AudioParamHandler::connect(AudioNodeOutput& output) | 172 void AudioParamHandler::connect(AudioNodeOutput& output) |
173 { | 173 { |
174 ASSERT(deferredTaskHandler().isGraphOwner()); | 174 ASSERT(deferredTaskHandler().isGraphOwner()); |
175 | 175 |
176 if (m_outputs.contains(&output)) | 176 if (m_outputs.contains(&output)) |
177 return; | 177 return; |
178 | 178 |
179 output.addParam(*this); | 179 output.addParam(*this); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
251 } | 251 } |
252 | 252 |
253 void AudioParam::cancelScheduledValues(double startTime, ExceptionState& excepti onState) | 253 void AudioParam::cancelScheduledValues(double startTime, ExceptionState& excepti onState) |
254 { | 254 { |
255 handler().timeline().cancelScheduledValues(startTime, exceptionState); | 255 handler().timeline().cancelScheduledValues(startTime, exceptionState); |
256 } | 256 } |
257 | 257 |
258 } // namespace blink | 258 } // namespace blink |
259 | 259 |
260 #endif // ENABLE(WEB_AUDIO) | 260 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |