Bug 1634779 - pt 2. Partially revert Bug 1603006 r=kmag
[gecko.git] / dom / webidl / AudioNode.webidl
blob7e96a507065264d11bb2823f4e502431b9101842
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4  * You can obtain one at http://mozilla.org/MPL/2.0/.
5  *
6  * The origin of this IDL file is
7  * https://webaudio.github.io/web-audio-api/
8  *
9  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
10  * liability, trademark and document use rules apply.
11  */
13 enum ChannelCountMode {
14     "max",
15     "clamped-max",
16     "explicit"
19 enum ChannelInterpretation {
20     "speakers",
21     "discrete"
24 dictionary AudioNodeOptions {
25              unsigned long         channelCount;
26              ChannelCountMode      channelCountMode;
27              ChannelInterpretation channelInterpretation;
30 [Pref="dom.webaudio.enabled",
31  Exposed=Window]
32 interface AudioNode : EventTarget {
34     [Throws]
35     AudioNode connect(AudioNode destination, optional unsigned long output = 0, optional unsigned long input = 0);
36     [Throws]
37     void connect(AudioParam destination, optional unsigned long output = 0);
38     [Throws]
39     void disconnect();
40     [Throws]
41     void disconnect(unsigned long output);
42     [Throws]
43     void disconnect(AudioNode destination);
44     [Throws]
45     void disconnect(AudioNode destination, unsigned long output);
46     [Throws]
47     void disconnect(AudioNode destination, unsigned long output, unsigned long input);
48     [Throws]
49     void disconnect(AudioParam destination);
50     [Throws]
51     void disconnect(AudioParam destination, unsigned long output);
53     readonly attribute BaseAudioContext context;
54     readonly attribute unsigned long numberOfInputs;
55     readonly attribute unsigned long numberOfOutputs;
57     // Channel up-mixing and down-mixing rules for all inputs.
58     [SetterThrows]
59     attribute unsigned long channelCount;
60     [SetterThrows, BinaryName="channelCountModeValue"]
61     attribute ChannelCountMode channelCountMode;
62     [SetterThrows, BinaryName="channelInterpretationValue"]
63     attribute ChannelInterpretation channelInterpretation;
67 // Mozilla extension
68 partial interface AudioNode {
69   [ChromeOnly]
70   readonly attribute unsigned long id;
72 interface mixin AudioNodePassThrough {
73   [ChromeOnly]
74   attribute boolean passThrough;