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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 else | 275 else |
276 ec = INVALID_STATE_ERR; | 276 ec = INVALID_STATE_ERR; |
277 } | 277 } |
278 | 278 |
279 void AudioNode::updateChannelsForInputs() | 279 void AudioNode::updateChannelsForInputs() |
280 { | 280 { |
281 for (unsigned i = 0; i < m_inputs.size(); ++i) | 281 for (unsigned i = 0; i < m_inputs.size(); ++i) |
282 input(i)->changedOutputs(); | 282 input(i)->changedOutputs(); |
283 } | 283 } |
284 | 284 |
| 285 const AtomicString& AudioNode::interfaceName() const |
| 286 { |
| 287 return eventNames().interfaceForAudioNode; |
| 288 } |
| 289 |
| 290 ScriptExecutionContext* AudioNode::scriptExecutionContext() const |
| 291 { |
| 292 return const_cast<AudioNode*>(this)->context()->scriptExecutionContext(); |
| 293 } |
| 294 |
285 void AudioNode::processIfNecessary(size_t framesToProcess) | 295 void AudioNode::processIfNecessary(size_t framesToProcess) |
286 { | 296 { |
287 ASSERT(context()->isAudioThread()); | 297 ASSERT(context()->isAudioThread()); |
288 | 298 |
289 if (!isInitialized()) | 299 if (!isInitialized()) |
290 return; | 300 return; |
291 | 301 |
292 // Ensure that we only process once per rendering quantum. | 302 // Ensure that we only process once per rendering quantum. |
293 // This handles the "fanout" problem where an output is connected to multipl
e inputs. | 303 // This handles the "fanout" problem where an output is connected to multipl
e inputs. |
294 // The first time we're called during this time slice we process, but after
that we don't want to re-process, | 304 // The first time we're called during this time slice we process, but after
that we don't want to re-process, |
295 // instead our output(s) will already have the results cached in their bus; | 305 // instead our output(s) will already have the results cached in their bus; |
296 double currentTime = context()->currentTime(); | 306 double currentTime = context()->currentTime(); |
297 if (m_lastProcessingTime != currentTime) { | 307 if (m_lastProcessingTime != currentTime) { |
298 m_lastProcessingTime = currentTime; // important to first update this ti
me because of feedback loops in the rendering graph | 308 m_lastProcessingTime = currentTime; // important to first update this ti
me because of feedback loops in the rendering graph |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 fprintf(stderr, "%d: %d\n", i, s_nodeCount[i]); | 526 fprintf(stderr, "%d: %d\n", i, s_nodeCount[i]); |
517 | 527 |
518 fprintf(stderr, "===========================\n\n\n"); | 528 fprintf(stderr, "===========================\n\n\n"); |
519 } | 529 } |
520 | 530 |
521 #endif // DEBUG_AUDIONODE_REFERENCES | 531 #endif // DEBUG_AUDIONODE_REFERENCES |
522 | 532 |
523 } // namespace WebCore | 533 } // namespace WebCore |
524 | 534 |
525 #endif // ENABLE(WEB_AUDIO) | 535 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |