GainNode.h (1705B)
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 GainNode_h_ 8 #define GainNode_h_ 9 10 #include "AudioNode.h" 11 #include "AudioParam.h" 12 13 namespace mozilla::dom { 14 15 class AudioContext; 16 struct GainOptions; 17 18 class GainNode final : public AudioNode { 19 public: 20 static already_AddRefed<GainNode> Create(AudioContext& aAudioContext, 21 const GainOptions& aOptions, 22 ErrorResult& aRv); 23 24 NS_DECL_ISUPPORTS_INHERITED 25 NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(GainNode, AudioNode) 26 27 static already_AddRefed<GainNode> Constructor(const GlobalObject& aGlobal, 28 AudioContext& aAudioContext, 29 const GainOptions& aOptions, 30 ErrorResult& aRv) { 31 return Create(aAudioContext, aOptions, aRv); 32 } 33 34 JSObject* WrapObject(JSContext* aCx, 35 JS::Handle<JSObject*> aGivenProto) override; 36 37 AudioParam* Gain() const { return mGain; } 38 39 const char* NodeType() const override { return "GainNode"; } 40 41 size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override; 42 size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override; 43 44 private: 45 explicit GainNode(AudioContext* aContext); 46 ~GainNode() = default; 47 48 RefPtr<AudioParam> mGain; 49 }; 50 51 } // namespace mozilla::dom 52 53 #endif