1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:set ts=2 sw=2 sts=2 et cindent: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef IIRFilterNode_h_
8 #define IIRFilterNode_h_
10 #include "AudioNode.h"
11 #include "AudioParam.h"
12 #include "mozilla/dom/IIRFilterNodeBinding.h"
14 namespace mozilla::dom
{
17 struct IIRFilterOptions
;
19 class IIRFilterNode final
: public AudioNode
{
21 static already_AddRefed
<IIRFilterNode
> Create(
22 AudioContext
& aAudioContext
, const IIRFilterOptions
& aOptions
,
25 NS_INLINE_DECL_REFCOUNTING_INHERITED(IIRFilterNode
, AudioNode
)
27 static already_AddRefed
<IIRFilterNode
> Constructor(
28 const GlobalObject
& aGlobal
, AudioContext
& aAudioContext
,
29 const IIRFilterOptions
& aOptions
, ErrorResult
& aRv
) {
30 return Create(aAudioContext
, aOptions
, aRv
);
33 JSObject
* WrapObject(JSContext
* aCx
,
34 JS::Handle
<JSObject
*> aGivenProto
) override
;
36 void GetFrequencyResponse(const Float32Array
& aFrequencyHz
,
37 const Float32Array
& aMagResponse
,
38 const Float32Array
& aPhaseResponse
);
40 const char* NodeType() const override
{ return "IIRFilterNode"; }
42 size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf
) const override
;
43 size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf
) const override
;
46 IIRFilterNode(AudioContext
* aContext
, const Sequence
<double>& aFeedforward
,
47 const Sequence
<double>& aFeedback
);
48 ~IIRFilterNode() = default;
50 nsTArray
<double> mFeedback
;
51 nsTArray
<double> mFeedforward
;
54 } // namespace mozilla::dom