summaryrefslogtreecommitdiff
path: root/Source/WebCore/Modules/webaudio/AudioParam.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/Modules/webaudio/AudioParam.h')
-rw-r--r--Source/WebCore/Modules/webaudio/AudioParam.h20
1 files changed, 8 insertions, 12 deletions
diff --git a/Source/WebCore/Modules/webaudio/AudioParam.h b/Source/WebCore/Modules/webaudio/AudioParam.h
index f8c79340d..b9ee132d4 100644
--- a/Source/WebCore/Modules/webaudio/AudioParam.h
+++ b/Source/WebCore/Modules/webaudio/AudioParam.h
@@ -10,7 +10,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * 3. Neither the name of Apple Inc. ("Apple") nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
@@ -26,15 +26,13 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef AudioParam_h
-#define AudioParam_h
+#pragma once
#include "AudioContext.h"
#include "AudioParamTimeline.h"
#include "AudioSummingJunction.h"
#include <runtime/Float32Array.h>
#include <sys/types.h>
-#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/text/WTFString.h>
@@ -47,14 +45,14 @@ public:
static const double DefaultSmoothingConstant;
static const double SnapThreshold;
- static PassRefPtr<AudioParam> create(AudioContext* context, const String& name, double defaultValue, double minValue, double maxValue, unsigned units = 0)
+ static Ref<AudioParam> create(AudioContext& context, const String& name, double defaultValue, double minValue, double maxValue, unsigned units = 0)
{
- return adoptRef(new AudioParam(context, name, defaultValue, minValue, maxValue, units));
+ return adoptRef(*new AudioParam(context, name, defaultValue, minValue, maxValue, units));
}
// AudioSummingJunction
- virtual bool canUpdateState() override { return true; }
- virtual void didUpdate() override { }
+ bool canUpdateState() override { return true; }
+ void didUpdate() override { }
// Intrinsic value.
float value();
@@ -89,7 +87,7 @@ public:
void linearRampToValueAtTime(float value, float time) { m_timeline.linearRampToValueAtTime(value, time); }
void exponentialRampToValueAtTime(float value, float time) { m_timeline.exponentialRampToValueAtTime(value, time); }
void setTargetAtTime(float target, float time, float timeConstant) { m_timeline.setTargetAtTime(target, time, timeConstant); }
- void setValueCurveAtTime(Float32Array* curve, float time, float duration) { m_timeline.setValueCurveAtTime(curve, time, duration); }
+ void setValueCurveAtTime(const RefPtr<Float32Array>& curve, float time, float duration) { m_timeline.setValueCurveAtTime(curve.get(), time, duration); }
void cancelScheduledValues(float startTime) { m_timeline.cancelScheduledValues(startTime); }
bool hasSampleAccurateValues() { return m_timeline.hasValues() || numberOfRenderingConnections(); }
@@ -103,7 +101,7 @@ public:
void disconnect(AudioNodeOutput*);
protected:
- AudioParam(AudioContext* context, const String& name, double defaultValue, double minValue, double maxValue, unsigned units = 0)
+ AudioParam(AudioContext& context, const String& name, double defaultValue, double minValue, double maxValue, unsigned units = 0)
: AudioSummingJunction(context)
, m_name(name)
, m_value(defaultValue)
@@ -136,5 +134,3 @@ private:
};
} // namespace WebCore
-
-#endif // AudioParam_h