dom/webidl/PannerNode.webidl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/webidl/PannerNode.webidl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,70 @@
     1.4 +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this file,
     1.7 + * You can obtain one at http://mozilla.org/MPL/2.0/.
     1.8 + *
     1.9 + * The origin of this IDL file is
    1.10 + * https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html
    1.11 + *
    1.12 + * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
    1.13 + * liability, trademark and document use rules apply.
    1.14 + */
    1.15 +
    1.16 +enum PanningModelType {
    1.17 +  // Hack: Use numbers to support alternate enum values
    1.18 +  "0", "1",
    1.19 +
    1.20 +  "equalpower",
    1.21 +  "HRTF"
    1.22 +};
    1.23 +
    1.24 +enum DistanceModelType {
    1.25 +  // Hack: Use numbers to support alternate enum values
    1.26 +  "0", "1", "2",
    1.27 +
    1.28 +  "linear",
    1.29 +  "inverse",
    1.30 +  "exponential"
    1.31 +};
    1.32 +
    1.33 +interface PannerNode : AudioNode {
    1.34 +
    1.35 +    // Default for stereo is HRTF 
    1.36 +    attribute PanningModelType panningModel;
    1.37 +
    1.38 +    // Uses a 3D cartesian coordinate system 
    1.39 +    void setPosition(double x, double y, double z);
    1.40 +    void setOrientation(double x, double y, double z);
    1.41 +    void setVelocity(double x, double y, double z);
    1.42 +
    1.43 +    // Distance model and attributes 
    1.44 +    attribute DistanceModelType distanceModel;
    1.45 +    attribute double refDistance;
    1.46 +    attribute double maxDistance;
    1.47 +    attribute double rolloffFactor;
    1.48 +
    1.49 +    // Directional sound cone 
    1.50 +    attribute double coneInnerAngle;
    1.51 +    attribute double coneOuterAngle;
    1.52 +    attribute double coneOuterGain;
    1.53 +
    1.54 +};
    1.55 +
    1.56 +/*
    1.57 + * The origin of this IDL file is
    1.58 + * https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AlternateNames
    1.59 + */
    1.60 +partial interface PannerNode {
    1.61 +    [Pref="media.webaudio.legacy.PannerNode"]
    1.62 +    const unsigned short EQUALPOWER = 0;
    1.63 +    [Pref="media.webaudio.legacy.PannerNode"]
    1.64 +    const unsigned short HRTF = 1;
    1.65 +
    1.66 +    [Pref="media.webaudio.legacy.PannerNode"]
    1.67 +    const unsigned short LINEAR_DISTANCE = 0;
    1.68 +    [Pref="media.webaudio.legacy.PannerNode"]
    1.69 +    const unsigned short INVERSE_DISTANCE = 1;
    1.70 +    [Pref="media.webaudio.legacy.PannerNode"]
    1.71 +    const unsigned short EXPONENTIAL_DISTANCE = 2;
    1.72 +};
    1.73 +

mercurial