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

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

Issue 1865583002: Implement BaseAudioContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 return m_dynamicsCompressor->tailTime(); 106 return m_dynamicsCompressor->tailTime();
107 } 107 }
108 108
109 double DynamicsCompressorHandler::latencyTime() const 109 double DynamicsCompressorHandler::latencyTime() const
110 { 110 {
111 return m_dynamicsCompressor->latencyTime(); 111 return m_dynamicsCompressor->latencyTime();
112 } 112 }
113 113
114 // ---------------------------------------------------------------- 114 // ----------------------------------------------------------------
115 115
116 DynamicsCompressorNode::DynamicsCompressorNode(AbstractAudioContext& context, fl oat sampleRate) 116 DynamicsCompressorNode::DynamicsCompressorNode(BaseAudioContext& context, float sampleRate)
117 : AudioNode(context) 117 : AudioNode(context)
118 , m_threshold(AudioParam::create(context, -24)) 118 , m_threshold(AudioParam::create(context, -24))
119 , m_knee(AudioParam::create(context, 30)) 119 , m_knee(AudioParam::create(context, 30))
120 , m_ratio(AudioParam::create(context, 12)) 120 , m_ratio(AudioParam::create(context, 12))
121 , m_reduction(AudioParam::create(context, 0)) 121 , m_reduction(AudioParam::create(context, 0))
122 , m_attack(AudioParam::create(context, 0.003)) 122 , m_attack(AudioParam::create(context, 0.003))
123 , m_release(AudioParam::create(context, 0.250)) 123 , m_release(AudioParam::create(context, 0.250))
124 { 124 {
125 setHandler(DynamicsCompressorHandler::create(*this, sampleRate, m_threshold- >handler(), m_knee->handler(), m_ratio->handler(), m_reduction->handler(), m_att ack->handler(), m_release->handler())); 125 setHandler(DynamicsCompressorHandler::create(*this, sampleRate, m_threshold- >handler(), m_knee->handler(), m_ratio->handler(), m_reduction->handler(), m_att ack->handler(), m_release->handler()));
126 } 126 }
127 127
128 DynamicsCompressorNode* DynamicsCompressorNode::create(AbstractAudioContext& con text, float sampleRate) 128 DynamicsCompressorNode* DynamicsCompressorNode::create(BaseAudioContext& context , float sampleRate)
129 { 129 {
130 return new DynamicsCompressorNode(context, sampleRate); 130 return new DynamicsCompressorNode(context, sampleRate);
131 } 131 }
132 132
133 DEFINE_TRACE(DynamicsCompressorNode) 133 DEFINE_TRACE(DynamicsCompressorNode)
134 { 134 {
135 visitor->trace(m_threshold); 135 visitor->trace(m_threshold);
136 visitor->trace(m_knee); 136 visitor->trace(m_knee);
137 visitor->trace(m_ratio); 137 visitor->trace(m_ratio);
138 visitor->trace(m_reduction); 138 visitor->trace(m_reduction);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 return m_attack; 171 return m_attack;
172 } 172 }
173 173
174 AudioParam* DynamicsCompressorNode::release() const 174 AudioParam* DynamicsCompressorNode::release() const
175 { 175 {
176 return m_release; 176 return m_release;
177 } 177 }
178 178
179 } // namespace blink 179 } // namespace blink
180 180
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698