tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

IIRFilterNode.h (1832B)


      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::dom {
     15 
     16 class AudioContext;
     17 struct IIRFilterOptions;
     18 
     19 class IIRFilterNode final : public AudioNode {
     20 public:
     21  static already_AddRefed<IIRFilterNode> Create(
     22      AudioContext& aAudioContext, const IIRFilterOptions& aOptions,
     23      ErrorResult& aRv);
     24 
     25  NS_INLINE_DECL_REFCOUNTING_INHERITED(IIRFilterNode, AudioNode)
     26 
     27  static already_AddRefed<IIRFilterNode> Constructor(
     28      const GlobalObject& aGlobal, AudioContext& aAudioContext,
     29      const IIRFilterOptions& aOptions, ErrorResult& aRv) {
     30    return Create(aAudioContext, aOptions, aRv);
     31  }
     32 
     33  JSObject* WrapObject(JSContext* aCx,
     34                       JS::Handle<JSObject*> aGivenProto) override;
     35 
     36  void GetFrequencyResponse(const Float32Array& aFrequencyHz,
     37                            const Float32Array& aMagResponse,
     38                            const Float32Array& aPhaseResponse);
     39 
     40  const char* NodeType() const override { return "IIRFilterNode"; }
     41 
     42  size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override;
     43  size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override;
     44 
     45 private:
     46  IIRFilterNode(AudioContext* aContext, const Sequence<double>& aFeedforward,
     47                const Sequence<double>& aFeedback);
     48  ~IIRFilterNode() = default;
     49 
     50  nsTArray<double> mFeedback;
     51  nsTArray<double> mFeedforward;
     52 };
     53 
     54 }  // namespace mozilla::dom
     55 
     56 #endif