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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 : AudioScheduledSourceNode(context, sampleRate) | 56 : AudioScheduledSourceNode(context, sampleRate) |
57 , m_buffer(nullptr) | 57 , m_buffer(nullptr) |
58 , m_isLooping(false) | 58 , m_isLooping(false) |
59 , m_loopStart(0) | 59 , m_loopStart(0) |
60 , m_loopEnd(0) | 60 , m_loopEnd(0) |
61 , m_virtualReadIndex(0) | 61 , m_virtualReadIndex(0) |
62 , m_isGrain(false) | 62 , m_isGrain(false) |
63 , m_grainOffset(0.0) | 63 , m_grainOffset(0.0) |
64 , m_grainDuration(DefaultGrainDuration) | 64 , m_grainDuration(DefaultGrainDuration) |
65 { | 65 { |
66 ScriptWrappable::init(this); | |
67 setNodeType(NodeTypeAudioBufferSource); | 66 setNodeType(NodeTypeAudioBufferSource); |
68 | 67 |
69 m_playbackRate = AudioParam::create(context, 1.0); | 68 m_playbackRate = AudioParam::create(context, 1.0); |
70 | 69 |
71 // Default to mono. A call to setBuffer() will set the number of output | 70 // Default to mono. A call to setBuffer() will set the number of output |
72 // channels to that of the buffer. | 71 // channels to that of the buffer. |
73 addOutput(AudioNodeOutput::create(this, 1)); | 72 addOutput(AudioNodeOutput::create(this, 1)); |
74 | 73 |
75 initialize(); | 74 initialize(); |
76 } | 75 } |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 { | 482 { |
484 visitor->trace(m_buffer); | 483 visitor->trace(m_buffer); |
485 visitor->trace(m_playbackRate); | 484 visitor->trace(m_playbackRate); |
486 visitor->trace(m_pannerNode); | 485 visitor->trace(m_pannerNode); |
487 AudioScheduledSourceNode::trace(visitor); | 486 AudioScheduledSourceNode::trace(visitor); |
488 } | 487 } |
489 | 488 |
490 } // namespace blink | 489 } // namespace blink |
491 | 490 |
492 #endif // ENABLE(WEB_AUDIO) | 491 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |