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 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 if (grainDuration < 0) { | 475 if (grainDuration < 0) { |
476 exceptionState.throwDOMException( | 476 exceptionState.throwDOMException( |
477 InvalidStateError, | 477 InvalidStateError, |
478 ExceptionMessages::indexExceedsMinimumBound( | 478 ExceptionMessages::indexExceedsMinimumBound( |
479 "duration", | 479 "duration", |
480 grainDuration, | 480 grainDuration, |
481 0.0)); | 481 0.0)); |
482 return; | 482 return; |
483 } | 483 } |
484 | 484 |
| 485 // This synchronizes with process(). updateSchedulingInfo will read some of
the variables being |
| 486 // set here. |
| 487 MutexLocker processLocker(m_processLock); |
| 488 |
485 m_isDurationGiven = isDurationGiven; | 489 m_isDurationGiven = isDurationGiven; |
486 m_isGrain = true; | 490 m_isGrain = true; |
487 m_grainOffset = grainOffset; | 491 m_grainOffset = grainOffset; |
488 m_grainDuration = grainDuration; | 492 m_grainDuration = grainDuration; |
489 | 493 |
490 // The node is started. Add a reference to keep us alive so that audio | 494 // The node is started. Add a reference to keep us alive so that audio |
491 // will eventually get played even if Javascript should drop all references | 495 // will eventually get played even if Javascript should drop all references |
492 // to this node. The reference will get dropped when the source has finished | 496 // to this node. The reference will get dropped when the source has finished |
493 // playing. | 497 // playing. |
494 context()->notifySourceNodeStartedProcessing(node()); | 498 context()->notifySourceNodeStartedProcessing(node()); |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
699 } | 703 } |
700 | 704 |
701 void AudioBufferSourceNode::start(double when, double grainOffset, double grainD
uration, ExceptionState& exceptionState) | 705 void AudioBufferSourceNode::start(double when, double grainOffset, double grainD
uration, ExceptionState& exceptionState) |
702 { | 706 { |
703 audioBufferSourceHandler().start(when, grainOffset, grainDuration, exception
State); | 707 audioBufferSourceHandler().start(when, grainOffset, grainDuration, exception
State); |
704 } | 708 } |
705 | 709 |
706 } // namespace blink | 710 } // namespace blink |
707 | 711 |
708 #endif // ENABLE(WEB_AUDIO) | 712 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |