blob: 3813d0ec8511590d8dd5657554bfd383c914c88f [file] [log] [blame]
// 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.
class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
factory $CLASSNAME() => _$(CLASSNAME)FactoryProvider.create$CLASSNAME();
$!MEMBERS
$if DART2JS
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
}