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