Bug 1062849: Define AudioWorkletNode and AudioWorkletProcessor. WIP
MozReview-Commit-ID: 1b6IXBBL3yX
new file mode 100644
--- /dev/null
+++ b/dom/webidl/AudioParamMap.webidl
@@ -0,0 +1,16 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * The origin of this IDL file is
+ * https://webaudio.github.io/web-audio-api/
+ *
+ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+[Pref="dom.audioworklet.enabled"]
+interface AudioParamMap {
+ readonly maplike<DOMString, AudioParam>;
+};
new file mode 100644
--- /dev/null
+++ b/dom/webidl/AudioWorkletNode.webidl
@@ -0,0 +1,33 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * The origin of this IDL file is
+ * https://webaudio.github.io/web-audio-api/
+ *
+ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+dictionary AudioWorkletNodeOptions : AudioNodeOptions {
+ unsigned long numberOfInputs = 1;
+ unsigned long numberOfOutputs = 1;
+ object parameterData;
+};
+
+enum AudioWorkletProcessorState {
+ "pending",
+ "running",
+ "stopped",
+ "error"
+};
+
+[Pref="dom.audioworklet.enabled",
+ Constructor (BaseAudioContext context, optional AudioWorkletNodeOptions options)]
+interface AudioWorkletNode : AudioNode {
+ readonly attribute AudioParamMap parameters;
+ readonly attribute MessagePort port;
+ readonly attribute AudioWorkletProcessorState processorState;
+ attribute EventHandler onprocessorstatechange;
+};
new file mode 100644
--- /dev/null
+++ b/dom/webidl/AudioWorkletProcessor.webidl
@@ -0,0 +1,22 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * The origin of this IDL file is
+ * https://webaudio.github.io/web-audio-api/
+ *
+ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+dictionary AudioContextInfo {
+ double currentTime;
+ float sampleRate;
+};
+
+[Pref="dom.audioworklet.enabled"]
+interface AudioWorkletProcessor {
+ AudioContextInfo getContextInfo ();
+ readonly attribute MessagePort port;
+};
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -397,22 +397,25 @@ WEBIDL_FILES = [
'Attr.webidl',
'AudioBuffer.webidl',
'AudioBufferSourceNode.webidl',
'AudioContext.webidl',
'AudioDestinationNode.webidl',
'AudioListener.webidl',
'AudioNode.webidl',
'AudioParam.webidl',
+ 'AudioParamMap.webidl',
'AudioProcessingEvent.webidl',
'AudioScheduledSourceNode.webidl',
'AudioStreamTrack.webidl',
'AudioTrack.webidl',
'AudioTrackList.webidl',
'AudioWorkletGlobalScope.webidl',
+ 'AudioWorkletNode.webidl',
+ 'AudioWorkletProcessor.webidl',
'AutocompleteInfo.webidl',
'BarProp.webidl',
'BaseAudioContext.webidl',
'BaseKeyframeTypes.webidl',
'BasicCardPayment.webidl',
'BatteryManager.webidl',
'BeforeUnloadEvent.webidl',
'BiquadFilterNode.webidl',