Bug 1839170 - Refactor Snap pulling, Add Firefox Snap Core22 and GNOME 42 SDK symbols...
[gecko.git] / dom / media / webaudio / GainNode.h
blobd2790af7461559e49b1fffaf3a27b54df5cc8b23
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 GainNode_h_
8 #define GainNode_h_
10 #include "AudioNode.h"
11 #include "AudioParam.h"
13 namespace mozilla::dom {
15 class AudioContext;
16 struct GainOptions;
18 class GainNode final : public AudioNode {
19 public:
20 static already_AddRefed<GainNode> Create(AudioContext& aAudioContext,
21 const GainOptions& aOptions,
22 ErrorResult& aRv);
24 NS_DECL_ISUPPORTS_INHERITED
25 NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(GainNode, AudioNode)
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);
34 JSObject* WrapObject(JSContext* aCx,
35 JS::Handle<JSObject*> aGivenProto) override;
37 AudioParam* Gain() const { return mGain; }
39 const char* NodeType() const override { return "GainNode"; }
41 size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override;
42 size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override;
44 private:
45 explicit GainNode(AudioContext* aContext);
46 ~GainNode() = default;
48 RefPtr<AudioParam> mGain;
51 } // namespace mozilla::dom
53 #endif