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

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

Issue 2420983002: AudioParams with automations must process timelines (Closed)
Patch Set: Fix paths. Created 3 years, 11 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 m_detune(AudioParam::create(context, ParamTypeBiquadFilterDetune, 0.0)) { 44 m_detune(AudioParam::create(context, ParamTypeBiquadFilterDetune, 0.0)) {
45 setHandler(AudioBasicProcessorHandler::create( 45 setHandler(AudioBasicProcessorHandler::create(
46 AudioHandler::NodeTypeBiquadFilter, *this, context.sampleRate(), 46 AudioHandler::NodeTypeBiquadFilter, *this, context.sampleRate(),
47 WTF::wrapUnique(new BiquadProcessor( 47 WTF::wrapUnique(new BiquadProcessor(
48 context.sampleRate(), 1, m_frequency->handler(), m_q->handler(), 48 context.sampleRate(), 1, m_frequency->handler(), m_q->handler(),
49 m_gain->handler(), m_detune->handler())))); 49 m_gain->handler(), m_detune->handler()))));
50 50
51 // Explicitly set the filter type so that any histograms get updated with the 51 // Explicitly set the filter type so that any histograms get updated with the
52 // default value. Otherwise, the histogram won't ever show it. 52 // default value. Otherwise, the histogram won't ever show it.
53 setType("lowpass"); 53 setType("lowpass");
54
55 // Initialize the handler so that AudioParams can be processed.
56 handler().initialize();
54 } 57 }
55 58
56 BiquadFilterNode* BiquadFilterNode::create(BaseAudioContext& context, 59 BiquadFilterNode* BiquadFilterNode::create(BaseAudioContext& context,
57 ExceptionState& exceptionState) { 60 ExceptionState& exceptionState) {
58 DCHECK(isMainThread()); 61 DCHECK(isMainThread());
59 62
60 if (context.isContextClosed()) { 63 if (context.isContextClosed()) {
61 context.throwExceptionForClosedState(exceptionState); 64 context.throwExceptionForClosedState(exceptionState);
62 return nullptr; 65 return nullptr;
63 } 66 }
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 DCHECK(phaseResponse); 179 DCHECK(phaseResponse);
177 180
178 int n = std::min(frequencyHz->length(), 181 int n = std::min(frequencyHz->length(),
179 std::min(magResponse->length(), phaseResponse->length())); 182 std::min(magResponse->length(), phaseResponse->length()));
180 if (n) 183 if (n)
181 getBiquadProcessor()->getFrequencyResponse( 184 getBiquadProcessor()->getFrequencyResponse(
182 n, frequencyHz->data(), magResponse->data(), phaseResponse->data()); 185 n, frequencyHz->data(), magResponse->data(), phaseResponse->data());
183 } 186 }
184 187
185 } // namespace blink 188 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/webaudio/AudioNode.cpp ('k') | third_party/WebKit/Source/modules/webaudio/BiquadProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698