From 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 27 Jun 2017 06:07:23 +0000 Subject: webkitgtk-2.16.5 --- .../Modules/webaudio/AudioBufferSourceNode.h | 54 +++++++++------------- 1 file changed, 23 insertions(+), 31 deletions(-) (limited to 'Source/WebCore/Modules/webaudio/AudioBufferSourceNode.h') diff --git a/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.h b/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.h index 15fc56a0b..f4e63a859 100644 --- a/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.h +++ b/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.h @@ -22,40 +22,32 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef AudioBufferSourceNode_h -#define AudioBufferSourceNode_h +#pragma once -#include "AudioBuffer.h" -#include "AudioBus.h" -#include "AudioParam.h" #include "AudioScheduledSourceNode.h" -#include "ExceptionCode.h" -#include "PannerNode.h" -#include -#include -#include -#include +#include namespace WebCore { -class AudioContext; +class AudioBuffer; +class PannerNode; // AudioBufferSourceNode is an AudioNode representing an audio source from an in-memory audio asset represented by an AudioBuffer. // It generally will be used for short sounds which require a high degree of scheduling flexibility (can playback in rhythmically perfect ways). -class AudioBufferSourceNode : public AudioScheduledSourceNode { +class AudioBufferSourceNode final : public AudioScheduledSourceNode { public: - static PassRefPtr create(AudioContext*, float sampleRate); + static Ref create(AudioContext&, float sampleRate); virtual ~AudioBufferSourceNode(); // AudioNode - virtual void process(size_t framesToProcess) override; - virtual void reset() override; + void process(size_t framesToProcess) final; + void reset() final; // setBuffer() is called on the main thread. This is the buffer we use for playback. // returns true on success. - bool setBuffer(AudioBuffer*); + void setBuffer(RefPtr&&); AudioBuffer* buffer() { return m_buffer.get(); } // numberOfChannels() returns the number of output channels. This value equals the number of channels from the buffer. @@ -63,12 +55,7 @@ public: unsigned numberOfChannels(); // Play-state - void startGrain(double when, double grainOffset, ExceptionCode&); - void startGrain(double when, double grainOffset, double grainDuration, ExceptionCode&); - -#if ENABLE(LEGACY_WEB_AUDIO) - void noteGrainOn(double when, double grainOffset, double grainDuration, ExceptionCode&); -#endif + ExceptionOr start(double when, double grainOffset, std::optional grainDuration); // Note: the attribute was originally exposed as .looping, but to be more consistent in naming with