| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 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 23 matching lines...) Expand all Loading... |
| 34 #include "modules/webaudio/AudioNodeOutput.h" | 34 #include "modules/webaudio/AudioNodeOutput.h" |
| 35 | 35 |
| 36 // Set output to stereo by default. | 36 // Set output to stereo by default. |
| 37 static const unsigned defaultNumberOfOutputChannels = 2; | 37 static const unsigned defaultNumberOfOutputChannels = 2; |
| 38 | 38 |
| 39 namespace blink { | 39 namespace blink { |
| 40 | 40 |
| 41 DynamicsCompressorNode::DynamicsCompressorNode(AudioContext* context, float samp
leRate) | 41 DynamicsCompressorNode::DynamicsCompressorNode(AudioContext* context, float samp
leRate) |
| 42 : AudioNode(context, sampleRate) | 42 : AudioNode(context, sampleRate) |
| 43 { | 43 { |
| 44 ScriptWrappable::init(this); | |
| 45 addInput(); | 44 addInput(); |
| 46 addOutput(AudioNodeOutput::create(this, defaultNumberOfOutputChannels)); | 45 addOutput(AudioNodeOutput::create(this, defaultNumberOfOutputChannels)); |
| 47 | 46 |
| 48 setNodeType(NodeTypeDynamicsCompressor); | 47 setNodeType(NodeTypeDynamicsCompressor); |
| 49 | 48 |
| 50 m_threshold = AudioParam::create(context, -24); | 49 m_threshold = AudioParam::create(context, -24); |
| 51 m_knee = AudioParam::create(context, 30); | 50 m_knee = AudioParam::create(context, 30); |
| 52 m_ratio = AudioParam::create(context, 12); | 51 m_ratio = AudioParam::create(context, 12); |
| 53 m_reduction = AudioParam::create(context, 0); | 52 m_reduction = AudioParam::create(context, 0); |
| 54 m_attack = AudioParam::create(context, 0.003); | 53 m_attack = AudioParam::create(context, 0.003); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 visitor->trace(m_ratio); | 125 visitor->trace(m_ratio); |
| 127 visitor->trace(m_reduction); | 126 visitor->trace(m_reduction); |
| 128 visitor->trace(m_attack); | 127 visitor->trace(m_attack); |
| 129 visitor->trace(m_release); | 128 visitor->trace(m_release); |
| 130 AudioNode::trace(visitor); | 129 AudioNode::trace(visitor); |
| 131 } | 130 } |
| 132 | 131 |
| 133 } // namespace blink | 132 } // namespace blink |
| 134 | 133 |
| 135 #endif // ENABLE(WEB_AUDIO) | 134 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |