| 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 24 matching lines...) Expand all Loading... |
| 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 WebCore { | 39 namespace WebCore { |
| 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); | 44 ScriptWrappable::init(this); |
| 45 addInput(adoptPtr(new AudioNodeInput(this))); | 45 addInput(adoptPtrWillBeNoop(new AudioNodeInput(this))); |
| 46 addOutput(adoptPtr(new AudioNodeOutput(this, defaultNumberOfOutputChannels))
); | 46 addOutput(adoptPtr(new AudioNodeOutput(this, defaultNumberOfOutputChannels))
); |
| 47 | 47 |
| 48 setNodeType(NodeTypeDynamicsCompressor); | 48 setNodeType(NodeTypeDynamicsCompressor); |
| 49 | 49 |
| 50 m_threshold = AudioParam::create(context, "threshold", -24, -100, 0); | 50 m_threshold = AudioParam::create(context, "threshold", -24, -100, 0); |
| 51 m_knee = AudioParam::create(context, "knee", 30, 0, 40); | 51 m_knee = AudioParam::create(context, "knee", 30, 0, 40); |
| 52 m_ratio = AudioParam::create(context, "ratio", 12, 1, 20); | 52 m_ratio = AudioParam::create(context, "ratio", 12, 1, 20); |
| 53 m_reduction = AudioParam::create(context, "reduction", 0, -20, 0); | 53 m_reduction = AudioParam::create(context, "reduction", 0, -20, 0); |
| 54 m_attack = AudioParam::create(context, "attack", 0.003, 0, 1); | 54 m_attack = AudioParam::create(context, "attack", 0.003, 0, 1); |
| 55 m_release = AudioParam::create(context, "release", 0.250, 0, 1); | 55 m_release = AudioParam::create(context, "release", 0.250, 0, 1); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 double DynamicsCompressorNode::tailTime() const | 106 double DynamicsCompressorNode::tailTime() const |
| 107 { | 107 { |
| 108 return m_dynamicsCompressor->tailTime(); | 108 return m_dynamicsCompressor->tailTime(); |
| 109 } | 109 } |
| 110 | 110 |
| 111 double DynamicsCompressorNode::latencyTime() const | 111 double DynamicsCompressorNode::latencyTime() const |
| 112 { | 112 { |
| 113 return m_dynamicsCompressor->latencyTime(); | 113 return m_dynamicsCompressor->latencyTime(); |
| 114 } | 114 } |
| 115 | 115 |
| 116 void DynamicsCompressorNode::trace(Visitor* visitor) |
| 117 { |
| 118 visitor->trace(m_threshold); |
| 119 visitor->trace(m_knee); |
| 120 visitor->trace(m_ratio); |
| 121 visitor->trace(m_reduction); |
| 122 visitor->trace(m_attack); |
| 123 visitor->trace(m_release); |
| 124 AudioNode::trace(visitor); |
| 125 } |
| 126 |
| 116 } // namespace WebCore | 127 } // namespace WebCore |
| 117 | 128 |
| 118 #endif // ENABLE(WEB_AUDIO) | 129 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |