Index: Source/modules/webaudio/AudioNode.h |
diff --git a/Source/modules/webaudio/AudioNode.h b/Source/modules/webaudio/AudioNode.h |
index 8099081df79065a1519bcd8d92b0d7612e1a3528..5a12fdabc19cb13a99bef30013d03bbcfb37580e 100644 |
--- a/Source/modules/webaudio/AudioNode.h |
+++ b/Source/modules/webaudio/AudioNode.h |
@@ -25,7 +25,9 @@ |
#ifndef AudioNode_h |
#define AudioNode_h |
+#include "ActiveDOMObject.h" |
#include "AudioBus.h" |
+#include "EventTarget.h" |
#include <wtf/Forward.h> |
#include <wtf/OwnPtr.h> |
#include <wtf/PassOwnPtr.h> |
@@ -49,7 +51,7 @@ typedef int ExceptionCode; |
// An AudioDestinationNode has one input and no outputs and represents the final destination to the audio hardware. |
// Most processing nodes such as filters will have one input and one output, although multiple inputs and outputs are possible. |
-class AudioNode { |
+class AudioNode : public ActiveDOMObject, public EventTarget { |
public: |
enum { ProcessingSizeInFrames = 128 }; |
@@ -152,7 +154,7 @@ public: |
// tailTime() is the length of time (not counting latency time) where non-zero output may occur after continuous silent input. |
virtual double tailTime() const = 0; |
// latencyTime() is the length of time it takes for non-zero output to appear after non-zero input is provided. This only applies to |
- // processing delay which is an artifact of the processing algorithm chosen and is *not* part of the intrinsic desired effect. For |
+ // processing delay which is an artifact of the processing algorithm chosen and is *not* part of the intrinsic desired effect. For |
// example, a "delay" effect is expected to delay the signal, and thus would not be considered latency. |
virtual double latencyTime() const = 0; |
@@ -180,11 +182,20 @@ public: |
ChannelCountMode internalChannelCountMode() const { return m_channelCountMode; } |
AudioBus::ChannelInterpretation internalChannelInterpretation() const { return m_channelInterpretation; } |
+ // EventTarget |
+ virtual const AtomicString& interfaceName() const; |
+ virtual ScriptExecutionContext* scriptExecutionContext() const; |
+ virtual EventTargetData* eventTargetData() { return &m_eventTargetData; } |
+ virtual EventTargetData* ensureEventTargetData() { return &m_eventTargetData; } |
haraken
2013/04/15 00:01:25
Please add OVERRIDE to these virtual methods.
|
+ |
+ // ActiveDOMObject |
+ virtual bool hasPendingActivity() const OVERRIDE; |
+ |
protected: |
// Inputs and outputs must be created before the AudioNode is initialized. |
void addInput(PassOwnPtr<AudioNodeInput>); |
void addOutput(PassOwnPtr<AudioNodeOutput>); |
- |
+ |
// Called by processIfNecessary() to cause all parts of the rendering graph connected to us to process. |
// Each rendering quantum, the audio data for each of the AudioNode's inputs will be available after this method is called. |
// Called from context's audio thread. |
@@ -201,13 +212,15 @@ private: |
Vector<OwnPtr<AudioNodeInput> > m_inputs; |
Vector<OwnPtr<AudioNodeOutput> > m_outputs; |
+ EventTargetData m_eventTargetData; |
+ |
double m_lastProcessingTime; |
double m_lastNonSilentTime; |
// Ref-counting |
volatile int m_normalRefCount; |
volatile int m_connectionRefCount; |
- |
+ |
bool m_isMarkedForDeletion; |
bool m_isDisabled; |
@@ -216,7 +229,11 @@ private: |
static int s_nodeCount[NodeTypeEnd]; |
#endif |
+ virtual void refEventTarget() { ref(); } |
+ virtual void derefEventTarget() { deref(); } |
haraken
2013/04/15 00:01:25
Ditto. OVERRIDE.
|
+ |
protected: |
+ |
unsigned m_channelCount; |
ChannelCountMode m_channelCountMode; |
AudioBus::ChannelInterpretation m_channelInterpretation; |