summaryrefslogtreecommitdiff
path: root/Source/WebCore/Modules/webaudio/OscillatorNode.idl
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/Modules/webaudio/OscillatorNode.idl')
-rw-r--r--Source/WebCore/Modules/webaudio/OscillatorNode.idl31
1 files changed, 14 insertions, 17 deletions
diff --git a/Source/WebCore/Modules/webaudio/OscillatorNode.idl b/Source/WebCore/Modules/webaudio/OscillatorNode.idl
index 8bf310d48..b5edc10a4 100644
--- a/Source/WebCore/Modules/webaudio/OscillatorNode.idl
+++ b/Source/WebCore/Modules/webaudio/OscillatorNode.idl
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2012, Google Inc. All rights reserved.
+ * Copyright (C) 2016, Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -22,20 +23,19 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// OscillatorNode is an audio generator of periodic waveforms.
+enum OscillatorType {
+ "sine",
+ "square",
+ "sawtooth",
+ "triangle",
+ "custom"
+};
+
[
Conditional=WEB_AUDIO,
JSGenerateToJSObject,
] interface OscillatorNode : AudioNode {
-
- // Type constants.
- const unsigned short SINE = 0;
- const unsigned short SQUARE = 1;
- const unsigned short SAWTOOTH = 2;
- const unsigned short TRIANGLE = 3;
- const unsigned short CUSTOM = 4;
-
- [CustomSetter] attribute DOMString type;
+ [SetterMayThrowException] attribute OscillatorType type;
// Playback state constants.
const unsigned short UNSCHEDULED_STATE = 0;
@@ -48,13 +48,10 @@
readonly attribute AudioParam frequency; // in Hertz
readonly attribute AudioParam detune; // in Cents
- [RaisesException] void start(double when);
- [RaisesException] void stop(double when);
-
- [Conditional=LEGACY_WEB_AUDIO, RaisesException] void noteOn(double when);
- [Conditional=LEGACY_WEB_AUDIO, RaisesException] void noteOff(double when);
+ [MayThrowException] void start(optional unrestricted double when = 0);
+ [MayThrowException] void stop(optional unrestricted double when = 0);
- void setPeriodicWave(PeriodicWave wave);
+ void setPeriodicWave(PeriodicWave? wave); // FIXME: The parameter should not be nullable.
- attribute EventListener onended;
+ attribute EventHandler onended;
};