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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 namespace WebCore { | 44 namespace WebCore { |
45 | 45 |
46 const double DefaultGrainDuration = 0.020; // 20ms | 46 const double DefaultGrainDuration = 0.020; // 20ms |
47 | 47 |
48 // Arbitrary upper limit on playback rate. | 48 // Arbitrary upper limit on playback rate. |
49 // Higher than expected rates can be useful when playing back oversampled buffer
s | 49 // Higher than expected rates can be useful when playing back oversampled buffer
s |
50 // to minimize linear interpolation aliasing. | 50 // to minimize linear interpolation aliasing. |
51 const double MaxRate = 1024; | 51 const double MaxRate = 1024; |
52 | 52 |
53 PassRefPtr<AudioBufferSourceNode> AudioBufferSourceNode::create(AudioContext* co
ntext, float sampleRate) | 53 PassRefPtrWillBeRawPtr<AudioBufferSourceNode> AudioBufferSourceNode::create(Audi
oContext* context, float sampleRate) |
54 { | 54 { |
55 return adoptRef(new AudioBufferSourceNode(context, sampleRate)); | 55 return adoptRefWillBeNoop(new AudioBufferSourceNode(context, sampleRate)); |
56 } | 56 } |
57 | 57 |
58 AudioBufferSourceNode::AudioBufferSourceNode(AudioContext* context, float sample
Rate) | 58 AudioBufferSourceNode::AudioBufferSourceNode(AudioContext* context, float sample
Rate) |
59 : AudioScheduledSourceNode(context, sampleRate) | 59 : AudioScheduledSourceNode(context, sampleRate) |
60 , m_buffer(nullptr) | 60 , m_buffer(nullptr) |
61 , m_isLooping(false) | 61 , m_isLooping(false) |
62 , m_loopStart(0) | 62 , m_loopStart(0) |
63 , m_loopEnd(0) | 63 , m_loopEnd(0) |
64 , m_virtualReadIndex(0) | 64 , m_virtualReadIndex(0) |
65 , m_isGrain(false) | 65 , m_isGrain(false) |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 } | 488 } |
489 } | 489 } |
490 | 490 |
491 void AudioBufferSourceNode::finish() | 491 void AudioBufferSourceNode::finish() |
492 { | 492 { |
493 clearPannerNode(); | 493 clearPannerNode(); |
494 ASSERT(!m_pannerNode); | 494 ASSERT(!m_pannerNode); |
495 AudioScheduledSourceNode::finish(); | 495 AudioScheduledSourceNode::finish(); |
496 } | 496 } |
497 | 497 |
| 498 void AudioBufferSourceNode::trace(Visitor* visitor) |
| 499 { |
| 500 visitor->trace(m_buffer); |
| 501 visitor->trace(m_gain); |
| 502 visitor->trace(m_playbackRate); |
| 503 AudioScheduledSourceNode::trace(visitor); |
| 504 } |
| 505 |
498 } // namespace WebCore | 506 } // namespace WebCore |
499 | 507 |
500 #endif // ENABLE(WEB_AUDIO) | 508 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |