| 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 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 grainDuration, | 478 grainDuration, |
| 479 0.0)); | 479 0.0)); |
| 480 return; | 480 return; |
| 481 } | 481 } |
| 482 | 482 |
| 483 m_isDurationGiven = isDurationGiven; | 483 m_isDurationGiven = isDurationGiven; |
| 484 m_isGrain = true; | 484 m_isGrain = true; |
| 485 m_grainOffset = grainOffset; | 485 m_grainOffset = grainOffset; |
| 486 m_grainDuration = grainDuration; | 486 m_grainDuration = grainDuration; |
| 487 | 487 |
| 488 // The node is started. Add a reference to keep us alive so that audio |
| 489 // will eventually get played even if Javascript should drop all references |
| 490 // to this node. The reference will get dropped when the source has finished |
| 491 // playing. |
| 492 context()->notifySourceNodeStartedProcessing(node()); |
| 493 |
| 488 // If |when| < currentTime, the source must start now according to the spec. | 494 // If |when| < currentTime, the source must start now according to the spec. |
| 489 // So just set startTime to currentTime in this case to start the source now
. | 495 // So just set startTime to currentTime in this case to start the source now
. |
| 490 m_startTime = std::max(when, context()->currentTime()); | 496 m_startTime = std::max(when, context()->currentTime()); |
| 491 | 497 |
| 492 if (buffer()) | 498 if (buffer()) |
| 493 clampGrainParameters(buffer()); | 499 clampGrainParameters(buffer()); |
| 494 | 500 |
| 495 m_playbackState = SCHEDULED_STATE; | 501 m_playbackState = SCHEDULED_STATE; |
| 496 } | 502 } |
| 497 | 503 |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 681 } | 687 } |
| 682 | 688 |
| 683 void AudioBufferSourceNode::start(double when, double grainOffset, double grainD
uration, ExceptionState& exceptionState) | 689 void AudioBufferSourceNode::start(double when, double grainOffset, double grainD
uration, ExceptionState& exceptionState) |
| 684 { | 690 { |
| 685 audioBufferSourceHandler().start(when, grainOffset, grainDuration, exception
State); | 691 audioBufferSourceHandler().start(when, grainOffset, grainDuration, exception
State); |
| 686 } | 692 } |
| 687 | 693 |
| 688 } // namespace blink | 694 } // namespace blink |
| 689 | 695 |
| 690 #endif // ENABLE(WEB_AUDIO) | 696 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |