Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(497)

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNode.cpp

Issue 1803153002: Add min/max values for AudioParams (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 120
121 double DynamicsCompressorHandler::latencyTime() const 121 double DynamicsCompressorHandler::latencyTime() const
122 { 122 {
123 return m_dynamicsCompressor->latencyTime(); 123 return m_dynamicsCompressor->latencyTime();
124 } 124 }
125 125
126 // ---------------------------------------------------------------- 126 // ----------------------------------------------------------------
127 127
128 DynamicsCompressorNode::DynamicsCompressorNode(AbstractAudioContext& context, fl oat sampleRate) 128 DynamicsCompressorNode::DynamicsCompressorNode(AbstractAudioContext& context, fl oat sampleRate)
129 : AudioNode(context) 129 : AudioNode(context)
130 , m_threshold(AudioParam::create(context, ParamTypeDynamicsCompressorThresho ld, -24)) 130 , m_threshold(AudioParam::create(context, ParamTypeDynamicsCompressorThresho ld, -24, -100, 0))
131 , m_knee(AudioParam::create(context, ParamTypeDynamicsCompressorKnee, 30)) 131 , m_knee(AudioParam::create(context, ParamTypeDynamicsCompressorKnee, 30, 0, 40))
132 , m_ratio(AudioParam::create(context, ParamTypeDynamicsCompressorRatio, 12)) 132 , m_ratio(AudioParam::create(context, ParamTypeDynamicsCompressorRatio, 12, 1, 20))
133 , m_attack(AudioParam::create(context, ParamTypeDynamicsCompressorAttack, 0. 003)) 133 , m_attack(AudioParam::create(context, ParamTypeDynamicsCompressorAttack, 0. 003, 0, 1))
134 , m_release(AudioParam::create(context, ParamTypeDynamicsCompressorRelease, 0.250)) 134 , m_release(AudioParam::create(context, ParamTypeDynamicsCompressorRelease, 0.250, 0, 1))
135 { 135 {
136 setHandler(DynamicsCompressorHandler::create( 136 setHandler(DynamicsCompressorHandler::create(
137 *this, 137 *this,
138 sampleRate, 138 sampleRate,
139 m_threshold->handler(), 139 m_threshold->handler(),
140 m_knee->handler(), 140 m_knee->handler(),
141 m_ratio->handler(), 141 m_ratio->handler(),
142 m_attack->handler(), 142 m_attack->handler(),
143 m_release->handler())); 143 m_release->handler()));
144 } 144 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 return m_attack; 188 return m_attack;
189 } 189 }
190 190
191 AudioParam* DynamicsCompressorNode::release() const 191 AudioParam* DynamicsCompressorNode::release() const
192 { 192 {
193 return m_release; 193 return m_release;
194 } 194 }
195 195
196 } // namespace blink 196 } // namespace blink
197 197
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698