| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 namespace WebCore { | 43 namespace WebCore { |
| 44 | 44 |
| 45 const double DefaultGrainDuration = 0.020; // 20ms | 45 const double DefaultGrainDuration = 0.020; // 20ms |
| 46 | 46 |
| 47 // Arbitrary upper limit on playback rate. | 47 // Arbitrary upper limit on playback rate. |
| 48 // Higher than expected rates can be useful when playing back oversampled buffer
s | 48 // Higher than expected rates can be useful when playing back oversampled buffer
s |
| 49 // to minimize linear interpolation aliasing. | 49 // to minimize linear interpolation aliasing. |
| 50 const double MaxRate = 1024; | 50 const double MaxRate = 1024; |
| 51 | 51 |
| 52 PassRefPtr<AudioBufferSourceNode> AudioBufferSourceNode::create(AudioContext* co
ntext, float sampleRate) | 52 PassRefPtrWillBeRawPtr<AudioBufferSourceNode> AudioBufferSourceNode::create(Audi
oContext* context, float sampleRate) |
| 53 { | 53 { |
| 54 return adoptRef(new AudioBufferSourceNode(context, sampleRate)); | 54 return adoptRefWillBeNoop(new AudioBufferSourceNode(context, sampleRate)); |
| 55 } | 55 } |
| 56 | 56 |
| 57 AudioBufferSourceNode::AudioBufferSourceNode(AudioContext* context, float sample
Rate) | 57 AudioBufferSourceNode::AudioBufferSourceNode(AudioContext* context, float sample
Rate) |
| 58 : AudioScheduledSourceNode(context, sampleRate) | 58 : AudioScheduledSourceNode(context, sampleRate) |
| 59 , m_buffer(nullptr) | 59 , m_buffer(nullptr) |
| 60 , m_isLooping(false) | 60 , m_isLooping(false) |
| 61 , m_loopStart(0) | 61 , m_loopStart(0) |
| 62 , m_loopEnd(0) | 62 , m_loopEnd(0) |
| 63 , m_virtualReadIndex(0) | 63 , m_virtualReadIndex(0) |
| 64 , m_isGrain(false) | 64 , m_isGrain(false) |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 } | 468 } |
| 469 } | 469 } |
| 470 | 470 |
| 471 void AudioBufferSourceNode::finish() | 471 void AudioBufferSourceNode::finish() |
| 472 { | 472 { |
| 473 clearPannerNode(); | 473 clearPannerNode(); |
| 474 ASSERT(!m_pannerNode); | 474 ASSERT(!m_pannerNode); |
| 475 AudioScheduledSourceNode::finish(); | 475 AudioScheduledSourceNode::finish(); |
| 476 } | 476 } |
| 477 | 477 |
| 478 void AudioBufferSourceNode::trace(Visitor* visitor) |
| 479 { |
| 480 visitor->trace(m_buffer); |
| 481 visitor->trace(m_playbackRate); |
| 482 AudioScheduledSourceNode::trace(visitor); |
| 483 } |
| 484 |
| 478 } // namespace WebCore | 485 } // namespace WebCore |
| 479 | 486 |
| 480 #endif // ENABLE(WEB_AUDIO) | 487 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |