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

Side by Side Diff: Source/modules/webaudio/BiquadFilterNode.h

Issue 1214463003: Split "Online" and "Offline" AudioContext processing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Bring to ToT Created 5 years, 5 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 | Annotate | Revision Log
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 13 matching lines...) Expand all
24 24
25 #ifndef BiquadFilterNode_h 25 #ifndef BiquadFilterNode_h
26 #define BiquadFilterNode_h 26 #define BiquadFilterNode_h
27 27
28 #include "core/dom/DOMTypedArray.h" 28 #include "core/dom/DOMTypedArray.h"
29 #include "modules/webaudio/AudioNode.h" 29 #include "modules/webaudio/AudioNode.h"
30 #include "modules/webaudio/BiquadProcessor.h" 30 #include "modules/webaudio/BiquadProcessor.h"
31 31
32 namespace blink { 32 namespace blink {
33 33
34 class AbstractAudioContext;
34 class AudioParam; 35 class AudioParam;
35 36
36 class BiquadFilterNode final : public AudioNode { 37 class BiquadFilterNode final : public AudioNode {
37 DEFINE_WRAPPERTYPEINFO(); 38 DEFINE_WRAPPERTYPEINFO();
38 public: 39 public:
39 // These must be defined as in the .idl file and must match those in the Biq uadProcessor class. 40 // These must be defined as in the .idl file and must match those in the Biq uadProcessor class.
40 enum { 41 enum {
41 LOWPASS = 0, 42 LOWPASS = 0,
42 HIGHPASS = 1, 43 HIGHPASS = 1,
43 BANDPASS = 2, 44 BANDPASS = 2,
44 LOWSHELF = 3, 45 LOWSHELF = 3,
45 HIGHSHELF = 4, 46 HIGHSHELF = 4,
46 PEAKING = 5, 47 PEAKING = 5,
47 NOTCH = 6, 48 NOTCH = 6,
48 ALLPASS = 7 49 ALLPASS = 7
49 }; 50 };
50 51
51 static BiquadFilterNode* create(AudioContext& context, float sampleRate) 52 static BiquadFilterNode* create(AbstractAudioContext& context, float sampleR ate)
52 { 53 {
53 return new BiquadFilterNode(context, sampleRate); 54 return new BiquadFilterNode(context, sampleRate);
54 } 55 }
55 DECLARE_VIRTUAL_TRACE(); 56 DECLARE_VIRTUAL_TRACE();
56 57
57 String type() const; 58 String type() const;
58 void setType(const String&); 59 void setType(const String&);
59 60
60 AudioParam* frequency() { return m_frequency; } 61 AudioParam* frequency() { return m_frequency; }
61 AudioParam* q() { return m_q; } 62 AudioParam* q() { return m_q; }
62 AudioParam* gain() { return m_gain; } 63 AudioParam* gain() { return m_gain; }
63 AudioParam* detune() { return m_detune; } 64 AudioParam* detune() { return m_detune; }
64 65
65 // Get the magnitude and phase response of the filter at the given 66 // Get the magnitude and phase response of the filter at the given
66 // set of frequencies (in Hz). The phase response is in radians. 67 // set of frequencies (in Hz). The phase response is in radians.
67 void getFrequencyResponse(const DOMFloat32Array* frequencyHz, DOMFloat32Arra y* magResponse, DOMFloat32Array* phaseResponse); 68 void getFrequencyResponse(const DOMFloat32Array* frequencyHz, DOMFloat32Arra y* magResponse, DOMFloat32Array* phaseResponse);
68 69
69 private: 70 private:
70 BiquadFilterNode(AudioContext&, float sampleRate); 71 BiquadFilterNode(AbstractAudioContext&, float sampleRate);
71 72
72 BiquadProcessor* biquadProcessor() const; 73 BiquadProcessor* biquadProcessor() const;
73 bool setType(unsigned); // Returns true on success. 74 bool setType(unsigned); // Returns true on success.
74 75
75 Member<AudioParam> m_frequency; 76 Member<AudioParam> m_frequency;
76 Member<AudioParam> m_q; 77 Member<AudioParam> m_q;
77 Member<AudioParam> m_gain; 78 Member<AudioParam> m_gain;
78 Member<AudioParam> m_detune; 79 Member<AudioParam> m_detune;
79 }; 80 };
80 81
81 } // namespace blink 82 } // namespace blink
82 83
83 #endif // BiquadFilterNode_h 84 #endif // BiquadFilterNode_h
OLDNEW
« no previous file with comments | « Source/modules/webaudio/AudioSummingJunction.cpp ('k') | Source/modules/webaudio/BiquadFilterNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698