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

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/ConvolverNode.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) 2010, Google Inc. All rights reserved. 2 * Copyright (C) 2010, 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 MutexTryLocker tryLocker(m_processLock); 158 MutexTryLocker tryLocker(m_processLock);
159 if (tryLocker.locked()) 159 if (tryLocker.locked())
160 return m_reverb ? m_reverb->latencyFrames() / static_cast<double>(sample Rate()) : 0; 160 return m_reverb ? m_reverb->latencyFrames() / static_cast<double>(sample Rate()) : 0;
161 // Since we don't want to block the Audio Device thread, we return a large v alue 161 // Since we don't want to block the Audio Device thread, we return a large v alue
162 // instead of trying to acquire the lock. 162 // instead of trying to acquire the lock.
163 return std::numeric_limits<double>::infinity(); 163 return std::numeric_limits<double>::infinity();
164 } 164 }
165 165
166 // ---------------------------------------------------------------- 166 // ----------------------------------------------------------------
167 167
168 ConvolverNode::ConvolverNode(AbstractAudioContext& context, float sampleRate) 168 ConvolverNode::ConvolverNode(BaseAudioContext& context, float sampleRate)
169 : AudioNode(context) 169 : AudioNode(context)
170 { 170 {
171 setHandler(ConvolverHandler::create(*this, sampleRate)); 171 setHandler(ConvolverHandler::create(*this, sampleRate));
172 } 172 }
173 173
174 ConvolverNode* ConvolverNode::create(AbstractAudioContext& context, float sample Rate) 174 ConvolverNode* ConvolverNode::create(BaseAudioContext& context, float sampleRate )
175 { 175 {
176 return new ConvolverNode(context, sampleRate); 176 return new ConvolverNode(context, sampleRate);
177 } 177 }
178 178
179 ConvolverHandler& ConvolverNode::convolverHandler() const 179 ConvolverHandler& ConvolverNode::convolverHandler() const
180 { 180 {
181 return static_cast<ConvolverHandler&>(handler()); 181 return static_cast<ConvolverHandler&>(handler());
182 } 182 }
183 183
184 AudioBuffer* ConvolverNode::buffer() const 184 AudioBuffer* ConvolverNode::buffer() const
(...skipping 11 matching lines...) Expand all
196 return convolverHandler().normalize(); 196 return convolverHandler().normalize();
197 } 197 }
198 198
199 void ConvolverNode::setNormalize(bool normalize) 199 void ConvolverNode::setNormalize(bool normalize)
200 { 200 {
201 convolverHandler().setNormalize(normalize); 201 convolverHandler().setNormalize(normalize);
202 } 202 }
203 203
204 } // namespace blink 204 } // namespace blink
205 205
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698