Skip to content

Commit 2d59cac

Browse files
committed
Update with the new ctor syntax
This fixes WebAudio#2051. There are still issues with bikeshed and the webidl parser, but it's largely there. In particular, arguments don't work yet.
1 parent 77eaf0b commit 2d59cac

File tree

1 file changed

+66
-67
lines changed

1 file changed

+66
-67
lines changed

index.bs

Lines changed: 66 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,19 +1314,19 @@ enum AudioContextLatencyCategory {
13141314
</div>
13151315

13161316
<xmp class="idl">
1317-
[Exposed=Window,
1318-
Constructor (optional AudioContextOptions contextOptions)]
1317+
[Exposed=Window]
13191318
interface AudioContext : BaseAudioContext {
1320-
readonly attribute double baseLatency;
1321-
readonly attribute double outputLatency;
1322-
AudioTimestamp getOutputTimestamp ();
1323-
Promise<void> resume ();
1324-
Promise<void> suspend ();
1325-
Promise<void> close ();
1326-
MediaElementAudioSourceNode createMediaElementSource (HTMLMediaElement mediaElement);
1327-
MediaStreamAudioSourceNode createMediaStreamSource (MediaStream mediaStream);
1328-
MediaStreamTrackAudioSourceNode createMediaStreamTrackSource (MediaStreamTrack mediaStreamTrack);
1329-
MediaStreamAudioDestinationNode createMediaStreamDestination ();
1319+
constructor (optional AudioContextOptions contextOptions);
1320+
readonly attribute double baseLatency;
1321+
readonly attribute double outputLatency;
1322+
AudioTimestamp getOutputTimestamp ();
1323+
Promise<void> resume ();
1324+
Promise<void> suspend ();
1325+
Promise<void> close ();
1326+
MediaElementAudioSourceNode createMediaElementSource (HTMLMediaElement mediaElement);
1327+
MediaStreamAudioSourceNode createMediaStreamSource (MediaStream mediaStream);
1328+
MediaStreamTrackAudioSourceNode createMediaStreamTrackSource (MediaStreamTrack mediaStreamTrack);
1329+
MediaStreamAudioDestinationNode createMediaStreamDestination ();
13301330
};
13311331
</xmp>
13321332

@@ -1876,10 +1876,10 @@ returned promise with the rendered result as an
18761876
{{AudioBuffer}}.
18771877

18781878
<xmp class="idl">
1879-
[Exposed=Window,
1880-
Constructor (OfflineAudioContextOptions contextOptions),
1881-
Constructor (unsigned long numberOfChannels, unsigned long length, float sampleRate)]
1879+
[Exposed=Window]
18821880
interface OfflineAudioContext : BaseAudioContext {
1881+
constructor(OfflineAudioContextOptions contextOptions);
1882+
constructor(unsigned long numberOfChannels, unsigned long length, float sampleRate);
18831883
Promise<AudioBuffer> startRendering();
18841884
Promise<void> resume();
18851885
Promise<void> suspend(double suspendTime);
@@ -2173,9 +2173,9 @@ This is an {{Event}} object which is dispatched to
21732173
{{OfflineAudioContext}} for legacy reasons.
21742174

21752175
<pre class="idl">
2176-
[Exposed=Window,
2177-
Constructor (DOMString type, OfflineAudioCompletionEventInit eventInitDict)]
2176+
[Exposed=Window]
21782177
interface OfflineAudioCompletionEvent : Event {
2178+
constructor (DOMString type, OfflineAudioCompletionEventInit eventInitDict);
21792179
readonly attribute AudioBuffer renderedBuffer;
21802180
};
21812181
</pre>
@@ -2255,9 +2255,9 @@ An {{AudioBuffer}} may be used by one or more
22552255
</dl>
22562256

22572257
<pre class="idl">
2258-
[Exposed=Window,
2259-
Constructor (AudioBufferOptions options)]
2258+
[Exposed=Window]
22602259
interface AudioBuffer {
2260+
constructor (AudioBufferOptions options);
22612261
readonly attribute float sampleRate;
22622262
readonly attribute unsigned long length;
22632263
readonly attribute double duration;
@@ -4138,9 +4138,9 @@ macros:
41384138
</pre>
41394139

41404140
<pre class="idl">
4141-
[Exposed=Window,
4142-
Constructor (BaseAudioContext context, optional AnalyserOptions options = {})]
4141+
[Exposed=Window]
41434142
interface AnalyserNode : AudioNode {
4143+
constructor (BaseAudioContext context, optional AnalyserOptions options = {});
41444144
void getFloatFrequencyData (Float32Array array);
41454145
void getByteFrequencyData (Uint8Array array);
41464146
void getFloatTimeDomainData (Float32Array array);
@@ -4594,9 +4594,9 @@ The <a>nominal range</a> for this <a>compound parameter</a> is
45944594
slot <dfn attribute for="AudioBufferSourceNode">[[buffer set]]</dfn>, initially set to false.
45954595

45964596
<pre class="idl">
4597-
[Exposed=Window,
4598-
Constructor (BaseAudioContext context, optional AudioBufferSourceOptions options = {})]
4597+
[Exposed=Window]
45994598
interface AudioBufferSourceNode : AudioScheduledSourceNode {
4599+
constructor (BaseAudioContext context, optional AudioBufferSourceOptions options = {});
46004600
attribute AudioBuffer? buffer;
46014601
readonly attribute AudioParam playbackRate;
46024602
readonly attribute AudioParam detune;
@@ -5563,9 +5563,9 @@ synthesized data if there are no inputs) is then placed into the
55635563
{{AudioProcessingEvent/outputBuffer}}.
55645564

55655565
<pre class="idl">
5566-
[Exposed=Window,
5567-
Constructor (DOMString type, AudioProcessingEventInit eventInitDict)]
5566+
[Exposed=Window]
55685567
interface AudioProcessingEvent : Event {
5568+
constructor (DOMString type, AudioProcessingEventInit eventInitDict);
55695569
readonly attribute double playbackTime;
55705570
readonly attribute AudioBuffer inputBuffer;
55715571
readonly attribute AudioBuffer outputBuffer;
@@ -5832,9 +5832,9 @@ enum BiquadFilterType {
58325832
All attributes of the {{BiquadFilterNode}} are <a>a-rate</a> {{AudioParam}}s.
58335833

58345834
<pre class="idl">
5835-
[Exposed=Window,
5836-
Constructor (BaseAudioContext context, optional BiquadFilterOptions options = {})]
5835+
[Exposed=Window]
58375836
interface BiquadFilterNode : AudioNode {
5837+
constructor (BaseAudioContext context, optional BiquadFilterOptions options = {});
58385838
attribute BiquadFilterType type;
58395839
readonly attribute AudioParam frequency;
58405840
readonly attribute AudioParam detune;
@@ -6271,9 +6271,9 @@ output channels.
62716271
</div>
62726272

62736273
<pre class="idl">
6274-
[Exposed=Window,
6275-
Constructor (BaseAudioContext context, optional ChannelMergerOptions options = {})]
6274+
[Exposed=Window]
62766275
interface ChannelMergerNode : AudioNode {
6276+
constructor (BaseAudioContext context, optional ChannelMergerOptions options = {});
62776277
};
62786278
</pre>
62796279

@@ -6383,9 +6383,9 @@ One application for {{ChannelSplitterNode}} is for doing
63836383
desired.
63846384

63856385
<pre class="idl">
6386-
[Exposed=Window,
6387-
Constructor (BaseAudioContext context, optional ChannelSplitterOptions options = {})]
6386+
[Exposed=Window]
63886387
interface ChannelSplitterNode : AudioNode {
6388+
constructor (BaseAudioContext context, optional ChannelSplitterOptions options = {});
63896389
};
63906390
</pre>
63916391

@@ -6464,9 +6464,9 @@ macros:
64646464
</pre>
64656465

64666466
<pre class="idl">
6467-
[Exposed=Window,
6468-
Constructor (BaseAudioContext context, optional ConstantSourceOptions options = {})]
6467+
[Exposed=Window]
64696468
interface ConstantSourceNode : AudioScheduledSourceNode {
6469+
constructor (BaseAudioContext context, optional ConstantSourceOptions options = {});
64706470
readonly attribute AudioParam offset;
64716471
};
64726472
</pre>
@@ -6569,9 +6569,9 @@ constraints</a> for this node. These constraints ensure that the
65696569
input to the node is either mono or stereo.
65706570

65716571
<pre class="idl">
6572-
[Exposed=Window,
6573-
Constructor (BaseAudioContext context, optional ConvolverOptions options = {})]
6572+
[Exposed=Window]
65746573
interface ConvolverNode : AudioNode {
6574+
constructor (BaseAudioContext context, optional ConvolverOptions options = {});
65756575
attribute AudioBuffer? buffer;
65766576
attribute boolean normalize;
65776577
};
@@ -6834,9 +6834,9 @@ Note: By definition, a {{DelayNode}} introduces an audio processing
68346834
latency equal to the amount of the delay.
68356835

68366836
<pre class="idl">
6837-
[Exposed=Window,
6838-
Constructor (BaseAudioContext context, optional DelayOptions options = {})]
6837+
[Exposed=Window]
68396838
interface DelayNode : AudioNode {
6839+
constructor (BaseAudioContext context, optional DelayOptions options = {});
68406840
readonly attribute AudioParam delayTime;
68416841
};
68426842
</pre>
@@ -6990,9 +6990,9 @@ macros:
69906990
</pre>
69916991

69926992
<pre class="idl">
6993-
[Exposed=Window,
6994-
Constructor (BaseAudioContext context, optional DynamicsCompressorOptions options = {})]
6993+
[Exposed=Window]
69956994
interface DynamicsCompressorNode : AudioNode {
6995+
constructor (BaseAudioContext context, optional DynamicsCompressorOptions options = {});
69966996
readonly attribute AudioParam threshold;
69976997
readonly attribute AudioParam knee;
69986998
readonly attribute AudioParam ratio;
@@ -7440,9 +7440,9 @@ Each sample of each channel of the input data of the
74407440
<a>computedValue</a> of the {{GainNode/gain}} {{AudioParam}}.
74417441

74427442
<pre class="idl">
7443-
[Exposed=Window,
7444-
Constructor (BaseAudioContext context, optional GainOptions options = {})]
7443+
[Exposed=Window]
74457444
interface GainNode : AudioNode {
7445+
constructor (BaseAudioContext context, optional GainOptions options = {});
74467446
readonly attribute AudioParam gain;
74477447
};
74487448
</pre>
@@ -7551,9 +7551,9 @@ The number of channels of the output always equals the number of
75517551
channels of the input.
75527552

75537553
<pre class="idl">
7554-
[Exposed=Window,
7555-
Constructor (BaseAudioContext context, IIRFilterOptions options)]
7554+
[Exposed=Window]
75567555
interface IIRFilterNode : AudioNode {
7556+
constructor (BaseAudioContext context, IIRFilterOptions options);
75577557
void getFrequencyResponse (Float32Array frequencyHz, Float32Array magResponse, Float32Array phaseResponse);
75587558
};
75597559
</pre>
@@ -7718,9 +7718,9 @@ attribute changes, and other aspects of the
77187718
</pre>
77197719

77207720
<pre class="idl">
7721-
[Exposed=Window,
7722-
Constructor (AudioContext context, MediaElementAudioSourceOptions options)]
7721+
[Exposed=Window]
77237722
interface MediaElementAudioSourceNode : AudioNode {
7723+
constructor (AudioContext context, MediaElementAudioSourceOptions options);
77247724
[SameObject] readonly attribute HTMLMediaElement mediaElement;
77257725
};
77267726
</pre>
@@ -7824,9 +7824,9 @@ macros:
78247824
The number of channels of the input is by default 2 (stereo).
78257825

78267826
<pre class="idl">
7827-
[Exposed=Window,
7828-
Constructor (AudioContext context, optional AudioNodeOptions options = {})]
7827+
[Exposed=Window]
78297828
interface MediaStreamAudioDestinationNode : AudioNode {
7829+
constructor (AudioContext context, optional AudioNodeOptions options = {});
78307830
readonly attribute MediaStream stream;
78317831
};
78327832
</pre>
@@ -7883,9 +7883,9 @@ the {{MediaStreamTrack}}. When the
78837883
{{AudioNode}} outputs one channel of silence.
78847884

78857885
<pre class="idl">
7886-
[Exposed=Window,
7887-
Constructor (AudioContext context, MediaStreamAudioSourceOptions options)]
7886+
[Exposed=Window]
78887887
interface MediaStreamAudioSourceNode : AudioNode {
7888+
constructor (AudioContext context, MediaStreamAudioSourceOptions options);
78897889
[SameObject] readonly attribute MediaStream mediaStream;
78907890
};
78917891
</pre>
@@ -7993,9 +7993,9 @@ The number of channels of the output corresponds to the number of
79937993
channels of the {{MediaStreamTrack}}.
79947994

79957995
<pre class="idl">
7996-
[Exposed=Window,
7997-
Constructor (AudioContext context, MediaStreamTrackAudioSourceOptions options)]
7996+
[Exposed=Window]
79987997
interface MediaStreamTrackAudioSourceNode : AudioNode {
7998+
constructor (AudioContext context, MediaStreamTrackAudioSourceOptions options);
79997999
};
80008000
</pre>
80018001

@@ -8133,9 +8133,9 @@ enum OscillatorType {
81338133
</div>
81348134

81358135
<pre class="idl">
8136-
[Exposed=Window,
8137-
Constructor (BaseAudioContext context, optional OscillatorOptions options = {})]
8136+
[Exposed=Window]
81388137
interface OscillatorNode : AudioScheduledSourceNode {
8138+
constructor (BaseAudioContext context, optional OscillatorOptions options = {});
81398139
attribute OscillatorType type;
81408140
readonly attribute AudioParam frequency;
81418141
readonly attribute AudioParam detune;
@@ -8501,9 +8501,9 @@ enum DistanceModelType {
85018501
</div>
85028502

85038503
<pre class="idl">
8504-
[Exposed=Window,
8505-
Constructor (BaseAudioContext context, optional PannerOptions options = {})]
8504+
[Exposed=Window]
85068505
interface PannerNode : AudioNode {
8506+
constructor (BaseAudioContext context, optional PannerOptions options = {});
85078507
attribute PanningModelType panningModel;
85088508
readonly attribute AudioParam positionX;
85098509
readonly attribute AudioParam positionY;
@@ -8894,9 +8894,9 @@ A <a>conforming implementation</a> MUST support {{PeriodicWave}}
88948894
up to at least 8192 elements.
88958895

88968896
<pre class="idl">
8897-
[Exposed=Window,
8898-
Constructor (BaseAudioContext context, optional PeriodicWaveOptions options = {})]
8897+
[Exposed=Window]
88998898
interface PeriodicWave {
8899+
constructor (BaseAudioContext context, optional PeriodicWaveOptions options = {});
89008900
};
89018901
</pre>
89028902

@@ -9238,9 +9238,9 @@ The output of this node is hard-coded to stereo (2 channels) and
92389238
cannot be configured.
92399239

92409240
<pre class="idl">
9241-
[Exposed=Window,
9242-
Constructor (BaseAudioContext context, optional StereoPannerOptions options = {})]
9241+
[Exposed=Window]
92439242
interface StereoPannerNode : AudioNode {
9243+
constructor (BaseAudioContext context, optional StereoPannerOptions options = {});
92449244
readonly attribute AudioParam pan;
92459245
};
92469246
</pre>
@@ -9368,9 +9368,9 @@ enum OverSampleType {
93689368
</div>
93699369

93709370
<pre class="idl">
9371-
[Exposed=Window,
9372-
Constructor (BaseAudioContext context, optional WaveShaperOptions options = {})]
9371+
[Exposed=Window]
93739372
interface WaveShaperNode : AudioNode {
9373+
constructor (BaseAudioContext context, optional WaveShaperOptions options = {});
93749374
attribute Float32Array? curve;
93759375
attribute OverSampleType oversample;
93769376
};
@@ -9925,11 +9925,10 @@ This interface has "entries", "forEach", "get", "has", "keys",
99259925
<code>readonly maplike</code>.
99269926

99279927
<pre class="idl">
9928-
[Exposed=Window,
9929-
SecureContext,
9930-
Constructor (BaseAudioContext context, DOMString name,
9931-
optional AudioWorkletNodeOptions options = {})]
9928+
[Exposed=Window, SecureContext]
99329929
interface AudioWorkletNode : AudioNode {
9930+
constructor (BaseAudioContext context, DOMString name,
9931+
optional AudioWorkletNodeOptions options = {});
99339932
readonly attribute AudioParamMap parameters;
99349933
readonly attribute MessagePort port;
99359934
attribute EventHandler onprocessorerror;
@@ -10209,9 +10208,9 @@ Note that the an {{AudioWorkletProcessor}} construction can only happen as a
1020910208
result of an {{AudioWorkletNode}} contruction.
1021010209

1021110210
<pre class="idl">
10212-
[Exposed=AudioWorklet,
10213-
Constructor (optional AudioWorkletNodeOptions options = {})]
10211+
[Exposed=AudioWorklet]
1021410212
interface AudioWorkletProcessor {
10213+
constructor (optional AudioWorkletNodeOptions options = {});
1021510214
readonly attribute MessagePort port;
1021610215
};
1021710216
</pre>

0 commit comments

Comments
 (0)