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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 { | 68 { |
69 ScriptWrappable::init(this); | 69 ScriptWrappable::init(this); |
70 setNodeType(NodeTypeAudioBufferSource); | 70 setNodeType(NodeTypeAudioBufferSource); |
71 | 71 |
72 m_gain = AudioParam::create(context, "gain", 1.0, 0.0, 1.0); | 72 m_gain = AudioParam::create(context, "gain", 1.0, 0.0, 1.0); |
73 m_playbackRate = AudioParam::create(context, "playbackRate", 1.0, 0.0, MaxRa
te); | 73 m_playbackRate = AudioParam::create(context, "playbackRate", 1.0, 0.0, MaxRa
te); |
74 | 74 |
75 // Default to mono. A call to setBuffer() will set the number of output cha
nnels to that of the buffer. | 75 // Default to mono. A call to setBuffer() will set the number of output cha
nnels to that of the buffer. |
76 addOutput(adoptPtr(new AudioNodeOutput(this, 1))); | 76 addOutput(adoptPtr(new AudioNodeOutput(this, 1))); |
77 | 77 |
| 78 suspendIfNeeded(); |
78 initialize(); | 79 initialize(); |
79 } | 80 } |
80 | 81 |
81 AudioBufferSourceNode::~AudioBufferSourceNode() | 82 AudioBufferSourceNode::~AudioBufferSourceNode() |
82 { | 83 { |
83 clearPannerNode(); | 84 clearPannerNode(); |
84 uninitialize(); | 85 uninitialize(); |
85 } | 86 } |
86 | 87 |
87 void AudioBufferSourceNode::process(size_t framesToProcess) | 88 void AudioBufferSourceNode::process(size_t framesToProcess) |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 void AudioBufferSourceNode::finish() | 480 void AudioBufferSourceNode::finish() |
480 { | 481 { |
481 clearPannerNode(); | 482 clearPannerNode(); |
482 ASSERT(!m_pannerNode); | 483 ASSERT(!m_pannerNode); |
483 AudioScheduledSourceNode::finish(); | 484 AudioScheduledSourceNode::finish(); |
484 } | 485 } |
485 | 486 |
486 } // namespace WebCore | 487 } // namespace WebCore |
487 | 488 |
488 #endif // ENABLE(WEB_AUDIO) | 489 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |