| 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 BaseAudioContext* context, | 184 BaseAudioContext* context, |
| 185 const DynamicsCompressorOptions& options, | 185 const DynamicsCompressorOptions& options, |
| 186 ExceptionState& exception_state) { | 186 ExceptionState& exception_state) { |
| 187 DynamicsCompressorNode* node = Create(*context, exception_state); | 187 DynamicsCompressorNode* node = Create(*context, exception_state); |
| 188 | 188 |
| 189 if (!node) | 189 if (!node) |
| 190 return nullptr; | 190 return nullptr; |
| 191 | 191 |
| 192 node->HandleChannelOptions(options, exception_state); | 192 node->HandleChannelOptions(options, exception_state); |
| 193 | 193 |
| 194 if (options.hasAttack()) | 194 node->attack()->setValue(options.attack()); |
| 195 node->attack()->setValue(options.attack()); | 195 node->knee()->setValue(options.knee()); |
| 196 if (options.hasKnee()) | 196 node->ratio()->setValue(options.ratio()); |
| 197 node->knee()->setValue(options.knee()); | 197 node->release()->setValue(options.release()); |
| 198 if (options.hasRatio()) | 198 node->threshold()->setValue(options.threshold()); |
| 199 node->ratio()->setValue(options.ratio()); | |
| 200 if (options.hasRelease()) | |
| 201 node->release()->setValue(options.release()); | |
| 202 if (options.hasThreshold()) | |
| 203 node->threshold()->setValue(options.threshold()); | |
| 204 | 199 |
| 205 return node; | 200 return node; |
| 206 } | 201 } |
| 207 | 202 |
| 208 DEFINE_TRACE(DynamicsCompressorNode) { | 203 DEFINE_TRACE(DynamicsCompressorNode) { |
| 209 visitor->Trace(threshold_); | 204 visitor->Trace(threshold_); |
| 210 visitor->Trace(knee_); | 205 visitor->Trace(knee_); |
| 211 visitor->Trace(ratio_); | 206 visitor->Trace(ratio_); |
| 212 visitor->Trace(attack_); | 207 visitor->Trace(attack_); |
| 213 visitor->Trace(release_); | 208 visitor->Trace(release_); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 237 | 232 |
| 238 AudioParam* DynamicsCompressorNode::attack() const { | 233 AudioParam* DynamicsCompressorNode::attack() const { |
| 239 return attack_; | 234 return attack_; |
| 240 } | 235 } |
| 241 | 236 |
| 242 AudioParam* DynamicsCompressorNode::release() const { | 237 AudioParam* DynamicsCompressorNode::release() const { |
| 243 return release_; | 238 return release_; |
| 244 } | 239 } |
| 245 | 240 |
| 246 } // namespace blink | 241 } // namespace blink |
| OLD | NEW |