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 30 matching lines...) Expand all Loading... |
41 : AudioNode(context), | 41 : AudioNode(context), |
42 m_delayTime(AudioParam::create(context, | 42 m_delayTime(AudioParam::create(context, |
43 ParamTypeDelayDelayTime, | 43 ParamTypeDelayDelayTime, |
44 0.0, | 44 0.0, |
45 0.0, | 45 0.0, |
46 maxDelayTime)) { | 46 maxDelayTime)) { |
47 setHandler(AudioBasicProcessorHandler::create( | 47 setHandler(AudioBasicProcessorHandler::create( |
48 AudioHandler::NodeTypeDelay, *this, context.sampleRate(), | 48 AudioHandler::NodeTypeDelay, *this, context.sampleRate(), |
49 WTF::wrapUnique(new DelayProcessor( | 49 WTF::wrapUnique(new DelayProcessor( |
50 context.sampleRate(), 1, m_delayTime->handler(), maxDelayTime)))); | 50 context.sampleRate(), 1, m_delayTime->handler(), maxDelayTime)))); |
| 51 |
| 52 // Initialize the handler so that AudioParams can be processed. |
| 53 handler().initialize(); |
51 } | 54 } |
52 | 55 |
53 DelayNode* DelayNode::create(BaseAudioContext& context, | 56 DelayNode* DelayNode::create(BaseAudioContext& context, |
54 ExceptionState& exceptionState) { | 57 ExceptionState& exceptionState) { |
55 DCHECK(isMainThread()); | 58 DCHECK(isMainThread()); |
56 | 59 |
57 // The default maximum delay time for the delay node is 1 sec. | 60 // The default maximum delay time for the delay node is 1 sec. |
58 return create(context, 1, exceptionState); | 61 return create(context, 1, exceptionState); |
59 } | 62 } |
60 | 63 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 AudioParam* DelayNode::delayTime() { | 104 AudioParam* DelayNode::delayTime() { |
102 return m_delayTime; | 105 return m_delayTime; |
103 } | 106 } |
104 | 107 |
105 DEFINE_TRACE(DelayNode) { | 108 DEFINE_TRACE(DelayNode) { |
106 visitor->trace(m_delayTime); | 109 visitor->trace(m_delayTime); |
107 AudioNode::trace(visitor); | 110 AudioNode::trace(visitor); |
108 } | 111 } |
109 | 112 |
110 } // namespace blink | 113 } // namespace blink |
OLD | NEW |