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/. */
10 #include "AudioNode.h"
11 #include "AudioParam.h"
13 namespace mozilla::dom
{
18 class GainNode final
: public AudioNode
{
20 static already_AddRefed
<GainNode
> Create(AudioContext
& aAudioContext
,
21 const GainOptions
& aOptions
,
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
,
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
;
45 explicit GainNode(AudioContext
* aContext
);
46 ~GainNode() = default;
48 RefPtr
<AudioParam
> mGain
;
51 } // namespace mozilla::dom