Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
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 ConvolverNode_h_
8 #define ConvolverNode_h_
10 #include "AudioNode.h"
11 #include "AudioBuffer.h"
13 namespace mozilla {
14 namespace dom {
16 class ConvolverNode : public AudioNode
17 {
18 public:
19 explicit ConvolverNode(AudioContext* aContext);
21 NS_DECL_ISUPPORTS_INHERITED
22 NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(ConvolverNode, AudioNode);
24 virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
26 AudioBuffer* GetBuffer(JSContext* aCx) const
27 {
28 return mBuffer;
29 }
31 void SetBuffer(JSContext* aCx, AudioBuffer* aBufferi, ErrorResult& aRv);
33 bool Normalize() const
34 {
35 return mNormalize;
36 }
38 void SetNormalize(bool aNormal);
40 virtual void SetChannelCount(uint32_t aChannelCount, ErrorResult& aRv) MOZ_OVERRIDE
41 {
42 if (aChannelCount > 2) {
43 aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
44 return;
45 }
46 AudioNode::SetChannelCount(aChannelCount, aRv);
47 }
48 virtual void SetChannelCountModeValue(ChannelCountMode aMode, ErrorResult& aRv) MOZ_OVERRIDE
49 {
50 if (aMode == ChannelCountMode::Max) {
51 aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
52 return;
53 }
54 AudioNode::SetChannelCountModeValue(aMode, aRv);
55 }
57 virtual const char* NodeType() const
58 {
59 return "ConvolverNode";
60 }
62 virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE;
63 virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE;
65 private:
66 nsRefPtr<AudioBuffer> mBuffer;
67 bool mNormalize;
68 };
71 } //end namespace dom
72 } //end namespace mozilla
74 #endif