| 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 18 matching lines...) Expand all Loading... |
| 29 #include "modules/webaudio/AudioBasicProcessorHandler.h" | 29 #include "modules/webaudio/AudioBasicProcessorHandler.h" |
| 30 #include "modules/webaudio/DelayProcessor.h" | 30 #include "modules/webaudio/DelayProcessor.h" |
| 31 #include "wtf/MathExtras.h" | 31 #include "wtf/MathExtras.h" |
| 32 | 32 |
| 33 namespace blink { | 33 namespace blink { |
| 34 | 34 |
| 35 const double maximumAllowedDelayTime = 180; | 35 const double maximumAllowedDelayTime = 180; |
| 36 | 36 |
| 37 DelayNode::DelayNode(AbstractAudioContext& context, float sampleRate, double max
DelayTime) | 37 DelayNode::DelayNode(AbstractAudioContext& context, float sampleRate, double max
DelayTime) |
| 38 : AudioNode(context) | 38 : AudioNode(context) |
| 39 , m_delayTime(AudioParam::create(context, ParamTypeDelayDelayTime, 0.0)) | 39 , m_delayTime(AudioParam::create(context, ParamTypeDelayDelayTime, 0.0, 0.0,
maxDelayTime)) |
| 40 { | 40 { |
| 41 setHandler(AudioBasicProcessorHandler::create(AudioHandler::NodeTypeDelay, *
this, sampleRate, adoptPtr(new DelayProcessor(sampleRate, 1, m_delayTime->handle
r(), maxDelayTime)))); | 41 setHandler(AudioBasicProcessorHandler::create(AudioHandler::NodeTypeDelay, *
this, sampleRate, adoptPtr(new DelayProcessor(sampleRate, 1, m_delayTime->handle
r(), maxDelayTime)))); |
| 42 } | 42 } |
| 43 | 43 |
| 44 DelayNode* DelayNode::create(AbstractAudioContext& context, float sampleRate, do
uble maxDelayTime, ExceptionState& exceptionState) | 44 DelayNode* DelayNode::create(AbstractAudioContext& context, float sampleRate, do
uble maxDelayTime, ExceptionState& exceptionState) |
| 45 { | 45 { |
| 46 if (maxDelayTime <= 0 || maxDelayTime >= maximumAllowedDelayTime) { | 46 if (maxDelayTime <= 0 || maxDelayTime >= maximumAllowedDelayTime) { |
| 47 exceptionState.throwDOMException( | 47 exceptionState.throwDOMException( |
| 48 NotSupportedError, | 48 NotSupportedError, |
| 49 ExceptionMessages::indexOutsideRange( | 49 ExceptionMessages::indexOutsideRange( |
| (...skipping 14 matching lines...) Expand all Loading... |
| 64 } | 64 } |
| 65 | 65 |
| 66 DEFINE_TRACE(DelayNode) | 66 DEFINE_TRACE(DelayNode) |
| 67 { | 67 { |
| 68 visitor->trace(m_delayTime); | 68 visitor->trace(m_delayTime); |
| 69 AudioNode::trace(visitor); | 69 AudioNode::trace(visitor); |
| 70 } | 70 } |
| 71 | 71 |
| 72 } // namespace blink | 72 } // namespace blink |
| 73 | 73 |
| OLD | NEW |