OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { | 5 class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { |
| 6 factory $CLASSNAME() => _$(CLASSNAME)FactoryProvider.create$CLASSNAME(); |
6 $!MEMBERS | 7 $!MEMBERS |
7 $if DART2JS | 8 $if DART2JS |
8 GainNode createGain() { | 9 GainNode createGain() { |
9 if (JS('bool', '#.createGain !== undefined', this)) { | 10 if (JS('bool', '#.createGain !== undefined', this)) { |
10 return JS('GainNode', '#.createGain()', this); | 11 return JS('GainNode', '#.createGain()', this); |
11 } else { | 12 } else { |
12 return JS('GainNode', '#.createGainNode()', this); | 13 return JS('GainNode', '#.createGainNode()', this); |
13 } | 14 } |
14 } | 15 } |
15 | 16 |
16 ScriptProcessorNode createScriptProcessor(int bufferSize, | 17 ScriptProcessorNode createScriptProcessor(int bufferSize, |
17 [int numberOfInputChannels, int numberOfOutputChannels]) { | 18 [int numberOfInputChannels, int numberOfOutputChannels]) { |
18 var function = JS('dynamic', '#.createScriptProcessor || ' | 19 var function = JS('dynamic', '#.createScriptProcessor || ' |
19 '#.createJavaScriptNode', this, this); | 20 '#.createJavaScriptNode', this, this); |
20 if (?numberOfOutputChannels) { | 21 if (?numberOfOutputChannels) { |
21 return JS('ScriptProcessorNode', '#.call(#, #, #, #)', function, this, | 22 return JS('ScriptProcessorNode', '#.call(#, #, #, #)', function, this, |
22 bufferSize, numberOfInputChannels, numberOfOutputChannels); | 23 bufferSize, numberOfInputChannels, numberOfOutputChannels); |
23 } else if (?numberOfInputChannels) { | 24 } else if (?numberOfInputChannels) { |
24 return JS('ScriptProcessorNode', '#.call(#, #, #)', function, this, | 25 return JS('ScriptProcessorNode', '#.call(#, #, #)', function, this, |
25 bufferSize, numberOfInputChannels); | 26 bufferSize, numberOfInputChannels); |
26 } else { | 27 } else { |
27 return JS('ScriptProcessorNode', '#.call(#, #)', function, this, | 28 return JS('ScriptProcessorNode', '#.call(#, #)', function, this, |
28 bufferSize); | 29 bufferSize); |
29 } | 30 } |
30 } | 31 } |
31 $endif | 32 $endif |
32 } | 33 } |
OLD | NEW |