| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 return m_dynamicsCompressor->tailTime(); | 119 return m_dynamicsCompressor->tailTime(); |
| 120 } | 120 } |
| 121 | 121 |
| 122 double DynamicsCompressorHandler::latencyTime() const | 122 double DynamicsCompressorHandler::latencyTime() const |
| 123 { | 123 { |
| 124 return m_dynamicsCompressor->latencyTime(); | 124 return m_dynamicsCompressor->latencyTime(); |
| 125 } | 125 } |
| 126 | 126 |
| 127 // ---------------------------------------------------------------- | 127 // ---------------------------------------------------------------- |
| 128 | 128 |
| 129 DynamicsCompressorNode::DynamicsCompressorNode(AbstractAudioContext& context) | 129 DynamicsCompressorNode::DynamicsCompressorNode(BaseAudioContext& context) |
| 130 : AudioNode(context) | 130 : AudioNode(context) |
| 131 , m_threshold(AudioParam::create(context, ParamTypeDynamicsCompressorThresho
ld, -24, -100, 0)) | 131 , m_threshold(AudioParam::create(context, ParamTypeDynamicsCompressorThresho
ld, -24, -100, 0)) |
| 132 , m_knee(AudioParam::create(context, ParamTypeDynamicsCompressorKnee, 30, 0,
40)) | 132 , m_knee(AudioParam::create(context, ParamTypeDynamicsCompressorKnee, 30, 0,
40)) |
| 133 , m_ratio(AudioParam::create(context, ParamTypeDynamicsCompressorRatio, 12,
1, 20)) | 133 , m_ratio(AudioParam::create(context, ParamTypeDynamicsCompressorRatio, 12,
1, 20)) |
| 134 , m_attack(AudioParam::create(context, ParamTypeDynamicsCompressorAttack, 0.
003, 0, 1)) | 134 , m_attack(AudioParam::create(context, ParamTypeDynamicsCompressorAttack, 0.
003, 0, 1)) |
| 135 , m_release(AudioParam::create(context, ParamTypeDynamicsCompressorRelease,
0.250, 0, 1)) | 135 , m_release(AudioParam::create(context, ParamTypeDynamicsCompressorRelease,
0.250, 0, 1)) |
| 136 { | 136 { |
| 137 setHandler(DynamicsCompressorHandler::create( | 137 setHandler(DynamicsCompressorHandler::create( |
| 138 *this, | 138 *this, |
| 139 context.sampleRate(), | 139 context.sampleRate(), |
| 140 m_threshold->handler(), | 140 m_threshold->handler(), |
| 141 m_knee->handler(), | 141 m_knee->handler(), |
| 142 m_ratio->handler(), | 142 m_ratio->handler(), |
| 143 m_attack->handler(), | 143 m_attack->handler(), |
| 144 m_release->handler())); | 144 m_release->handler())); |
| 145 } | 145 } |
| 146 | 146 |
| 147 DynamicsCompressorNode* DynamicsCompressorNode::create(AbstractAudioContext& con
text, ExceptionState& exceptionState) | 147 DynamicsCompressorNode* DynamicsCompressorNode::create(BaseAudioContext& context
, ExceptionState& exceptionState) |
| 148 { | 148 { |
| 149 DCHECK(isMainThread()); | 149 DCHECK(isMainThread()); |
| 150 | 150 |
| 151 if (context.isContextClosed()) { | 151 if (context.isContextClosed()) { |
| 152 context.throwExceptionForClosedState(exceptionState); | 152 context.throwExceptionForClosedState(exceptionState); |
| 153 return nullptr; | 153 return nullptr; |
| 154 } | 154 } |
| 155 | 155 |
| 156 return new DynamicsCompressorNode(context); | 156 return new DynamicsCompressorNode(context); |
| 157 } | 157 } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 return m_attack; | 196 return m_attack; |
| 197 } | 197 } |
| 198 | 198 |
| 199 AudioParam* DynamicsCompressorNode::release() const | 199 AudioParam* DynamicsCompressorNode::release() const |
| 200 { | 200 { |
| 201 return m_release; | 201 return m_release; |
| 202 } | 202 } |
| 203 | 203 |
| 204 } // namespace blink | 204 } // namespace blink |
| 205 | 205 |
| OLD | NEW |