summaryrefslogtreecommitdiff
path: root/Source/WebCore/Modules/webaudio/ScriptProcessorNode.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/Modules/webaudio/ScriptProcessorNode.h
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/WebCore/Modules/webaudio/ScriptProcessorNode.h')
-rw-r--r--Source/WebCore/Modules/webaudio/ScriptProcessorNode.h30
1 files changed, 13 insertions, 17 deletions
diff --git a/Source/WebCore/Modules/webaudio/ScriptProcessorNode.h b/Source/WebCore/Modules/webaudio/ScriptProcessorNode.h
index 15bb27b29..4c6bafe94 100644
--- a/Source/WebCore/Modules/webaudio/ScriptProcessorNode.h
+++ b/Source/WebCore/Modules/webaudio/ScriptProcessorNode.h
@@ -22,8 +22,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef ScriptProcessorNode_h
-#define ScriptProcessorNode_h
+#pragma once
#include "ActiveDOMObject.h"
#include "AudioBus.h"
@@ -31,7 +30,6 @@
#include "EventListener.h"
#include "EventTarget.h"
#include <wtf/Forward.h>
-#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
#include <wtf/Vector.h>
@@ -53,30 +51,30 @@ public:
// This value controls how frequently the onaudioprocess event handler is called and how many sample-frames need to be processed each call.
// Lower numbers for bufferSize will result in a lower (better) latency. Higher numbers will be necessary to avoid audio breakup and glitches.
// The value chosen must carefully balance between latency and audio quality.
- static PassRefPtr<ScriptProcessorNode> create(AudioContext*, float sampleRate, size_t bufferSize, unsigned numberOfInputChannels, unsigned numberOfOutputChannels);
+ static RefPtr<ScriptProcessorNode> create(AudioContext&, float sampleRate, size_t bufferSize, unsigned numberOfInputChannels, unsigned numberOfOutputChannels);
virtual ~ScriptProcessorNode();
// AudioNode
- virtual void process(size_t framesToProcess) override;
- virtual void reset() override;
- virtual void initialize() override;
- virtual void uninitialize() override;
+ void process(size_t framesToProcess) override;
+ void reset() override;
+ void initialize() override;
+ void uninitialize() override;
size_t bufferSize() const { return m_bufferSize; }
- EventListener* onaudioprocess() { return getAttributeEventListener(eventNames().audioprocessEvent); }
- void setOnaudioprocess(PassRefPtr<EventListener>);
-
private:
- virtual double tailTime() const override;
- virtual double latencyTime() const override;
+ double tailTime() const override;
+ double latencyTime() const override;
- ScriptProcessorNode(AudioContext*, float sampleRate, size_t bufferSize, unsigned numberOfInputChannels, unsigned numberOfOutputChannels);
+ ScriptProcessorNode(AudioContext&, float sampleRate, size_t bufferSize, unsigned numberOfInputChannels, unsigned numberOfOutputChannels);
- static void fireProcessEventDispatch(void* userData);
void fireProcessEvent();
+ bool addEventListener(const AtomicString& eventType, Ref<EventListener>&&, const AddEventListenerOptions&) override;
+ bool removeEventListener(const AtomicString& eventType, EventListener&, const ListenerOptions&) override;
+ void removeAllEventListeners() override;
+
// Double buffering
unsigned doubleBufferIndex() const { return m_doubleBufferIndex; }
void swapBuffers() { m_doubleBufferIndex = 1 - m_doubleBufferIndex; }
@@ -97,5 +95,3 @@ private:
};
} // namespace WebCore
-
-#endif // ScriptProcessorNode_h