1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/webidl/OscillatorNode.webidl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,66 @@ 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 OscillatorType { 1.17 + // Hack: Use numbers to support alternate enum values 1.18 + "0", "1", "2", "3", "4", 1.19 + 1.20 + "sine", 1.21 + "square", 1.22 + "sawtooth", 1.23 + "triangle", 1.24 + "custom" 1.25 +}; 1.26 + 1.27 +interface OscillatorNode : AudioNode { 1.28 + 1.29 + [SetterThrows] 1.30 + attribute OscillatorType type; 1.31 + 1.32 + readonly attribute AudioParam frequency; // in Hertz 1.33 + readonly attribute AudioParam detune; // in Cents 1.34 + 1.35 + [Throws] 1.36 + void start(optional double when = 0); 1.37 + [Throws] 1.38 + void stop(optional double when = 0); 1.39 + void setPeriodicWave(PeriodicWave periodicWave); 1.40 + 1.41 + attribute EventHandler onended; 1.42 + 1.43 +}; 1.44 + 1.45 +/* 1.46 + * The origin of this IDL file is 1.47 + * https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AlternateNames 1.48 + */ 1.49 +partial interface OscillatorNode { 1.50 + // Same as start() 1.51 + [Throws,Pref="media.webaudio.legacy.OscillatorNode"] 1.52 + void noteOn(double when); 1.53 + 1.54 + // Same as stop() 1.55 + [Throws,Pref="media.webaudio.legacy.OscillatorNode"] 1.56 + void noteOff(double when); 1.57 + 1.58 + [Pref="media.webaudio.legacy.OscillatorNode"] 1.59 + const unsigned short SINE = 0; 1.60 + [Pref="media.webaudio.legacy.OscillatorNode"] 1.61 + const unsigned short SQUARE = 1; 1.62 + [Pref="media.webaudio.legacy.OscillatorNode"] 1.63 + const unsigned short SAWTOOTH = 2; 1.64 + [Pref="media.webaudio.legacy.OscillatorNode"] 1.65 + const unsigned short TRIANGLE = 3; 1.66 + [Pref="media.webaudio.legacy.OscillatorNode"] 1.67 + const unsigned short CUSTOM = 4; 1.68 +}; 1.69 +