Line data Source code
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/. */
6 :
7 : #ifndef IIRFilterNode_h_
8 : #define IIRFilterNode_h_
9 :
10 : #include "AudioNode.h"
11 : #include "AudioParam.h"
12 : #include "mozilla/dom/IIRFilterNodeBinding.h"
13 :
14 : namespace mozilla {
15 : namespace dom {
16 :
17 : class AudioContext;
18 : struct IIRFilterOptions;
19 :
20 : class IIRFilterNode final : public AudioNode
21 : {
22 : public:
23 : static already_AddRefed<IIRFilterNode>
24 : Create(AudioContext& aAudioContext, const IIRFilterOptions& aOptions,
25 : ErrorResult& aRv);
26 :
27 : NS_DECL_ISUPPORTS_INHERITED
28 :
29 : static already_AddRefed<IIRFilterNode>
30 0 : Constructor(const GlobalObject& aGlobal, AudioContext& aAudioContext,
31 : const IIRFilterOptions& aOptions, ErrorResult& aRv)
32 : {
33 0 : return Create(aAudioContext, aOptions, aRv);
34 : }
35 :
36 : JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
37 :
38 : void GetFrequencyResponse(const Float32Array& aFrequencyHz,
39 : const Float32Array& aMagResponse,
40 : const Float32Array& aPhaseResponse);
41 :
42 0 : const char* NodeType() const override
43 : {
44 0 : return "IIRFilterNode";
45 : }
46 :
47 : size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override;
48 : size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override;
49 :
50 : private:
51 : IIRFilterNode(AudioContext* aContext,
52 : const Sequence<double>& aFeedforward,
53 : const Sequence<double>& aFeedback);
54 0 : ~IIRFilterNode() = default;
55 :
56 : nsTArray<double> mFeedback;
57 : nsTArray<double> mFeedforward;
58 : };
59 :
60 : } // namespace dom
61 : } // namespace mozilla
62 :
63 : #endif
|