5d50a592a3
R=blois@google.com,efortuna@google.com,podivilov@chromium.org Review URL: https://codereview.chromium.org//12052076 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17754 260f80e4-7a28-3924-810f-c04153c831b5
38 lines
1.3 KiB
Plaintext
38 lines
1.3 KiB
Plaintext
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
part of web_audio;
|
|
|
|
$(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
|
|
$!MEMBERS
|
|
$if DART2JS
|
|
factory AudioContext() => JS('AudioContext',
|
|
'new (window.AudioContext || window.webkitAudioContext)()');
|
|
|
|
GainNode createGain() {
|
|
if (JS('bool', '#.createGain !== undefined', this)) {
|
|
return JS('GainNode', '#.createGain()', this);
|
|
} else {
|
|
return JS('GainNode', '#.createGainNode()', this);
|
|
}
|
|
}
|
|
|
|
ScriptProcessorNode createScriptProcessor(int bufferSize,
|
|
[int numberOfInputChannels, int numberOfOutputChannels]) {
|
|
var function = JS('dynamic', '#.createScriptProcessor || '
|
|
'#.createJavaScriptNode', this, this);
|
|
if (?numberOfOutputChannels) {
|
|
return JS('ScriptProcessorNode', '#.call(#, #, #, #)', function, this,
|
|
bufferSize, numberOfInputChannels, numberOfOutputChannels);
|
|
} else if (?numberOfInputChannels) {
|
|
return JS('ScriptProcessorNode', '#.call(#, #, #)', function, this,
|
|
bufferSize, numberOfInputChannels);
|
|
} else {
|
|
return JS('ScriptProcessorNode', '#.call(#, #)', function, this,
|
|
bufferSize);
|
|
}
|
|
}
|
|
$endif
|
|
}
|