Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 library dart.dom.web_audio; | 1 library dart.dom.web_audio; |
|
Anton Muhin
2013/04/30 12:55:13
there is no Dartium-specific modifications, is it
| |
| 2 | 2 |
| 3 import 'dart:async'; | 3 import 'dart:async'; |
| 4 import 'dart:collection'; | 4 import 'dart:collection'; |
| 5 import 'dart:_collection-dev'; | 5 import 'dart:_collection-dev'; |
| 6 import 'dart:html'; | 6 import 'dart:html'; |
| 7 import 'dart:html_common'; | 7 import 'dart:html_common'; |
| 8 import 'dart:typed_data'; | 8 import 'dart:typed_data'; |
| 9 import 'dart:_js_helper' show Creates, Returns, convertDartClosureToJS; | 9 import 'dart:_js_helper' show Creates, Returns, convertDartClosureToJS; |
| 10 import 'dart:_foreign_helper' show JS; | 10 import 'dart:_foreign_helper' show JS; |
| 11 // DO NOT EDIT - unless you are editing documentation as per: | 11 // DO NOT EDIT - unless you are editing documentation as per: |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 104 // BSD-style license that can be found in the LICENSE file. | 104 // BSD-style license that can be found in the LICENSE file. |
| 105 | 105 |
| 106 | 106 |
| 107 @DomName('AudioBufferSourceNode') | 107 @DomName('AudioBufferSourceNode') |
| 108 class AudioBufferSourceNode extends AudioSourceNode native "AudioBufferSourceNod e" { | 108 class AudioBufferSourceNode extends AudioSourceNode native "AudioBufferSourceNod e" { |
| 109 | 109 |
| 110 // TODO(efortuna): Remove these methods when Chrome stable also uses start | 110 // TODO(efortuna): Remove these methods when Chrome stable also uses start |
| 111 // instead of noteOn. | 111 // instead of noteOn. |
| 112 void start(num when, [num grainOffset, num grainDuration]) { | 112 void start(num when, [num grainOffset, num grainDuration]) { |
| 113 if (JS('bool', '!!#.start', this)) { | 113 if (JS('bool', '!!#.start', this)) { |
| 114 if (?grainDuration) { | 114 if (grainDuration != null) { |
| 115 JS('void', '#.start(#, #, #)', this, when, grainOffset, grainDuration); | 115 JS('void', '#.start(#, #, #)', this, when, grainOffset, grainDuration); |
| 116 } else if (?grainOffset) { | 116 } else if (grainOffset != null) { |
| 117 JS('void', '#.start(#, #)', this, when, grainOffset); | 117 JS('void', '#.start(#, #)', this, when, grainOffset); |
| 118 } else { | 118 } else { |
| 119 JS('void', '#.start(#)', this, when); | 119 JS('void', '#.start(#)', this, when); |
| 120 } | 120 } |
| 121 } else { | 121 } else { |
| 122 if (?grainDuration) { | 122 if (grainDuration != null) { |
| 123 JS('void', '#.noteOn(#, #, #)', this, when, grainOffset, grainDuration); | 123 JS('void', '#.noteOn(#, #, #)', this, when, grainOffset, grainDuration); |
| 124 } else if (?grainOffset) { | 124 } else if (grainOffset != null) { |
| 125 JS('void', '#.noteOn(#, #)', this, when, grainOffset); | 125 JS('void', '#.noteOn(#, #)', this, when, grainOffset); |
| 126 } else { | 126 } else { |
| 127 JS('void', '#.noteOn(#)', this, when); | 127 JS('void', '#.noteOn(#)', this, when); |
| 128 } | 128 } |
| 129 } | 129 } |
| 130 } | 130 } |
| 131 | 131 |
| 132 void stop(num when) { | 132 void stop(num when) { |
| 133 if (JS('bool', '!!#.stop', this)) { | 133 if (JS('bool', '!!#.stop', this)) { |
| 134 JS('void', '#.stop(#)', this, when); | 134 JS('void', '#.stop(#)', this, when); |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 293 return JS('GainNode', '#.createGain()', this); | 293 return JS('GainNode', '#.createGain()', this); |
| 294 } else { | 294 } else { |
| 295 return JS('GainNode', '#.createGainNode()', this); | 295 return JS('GainNode', '#.createGainNode()', this); |
| 296 } | 296 } |
| 297 } | 297 } |
| 298 | 298 |
| 299 ScriptProcessorNode createScriptProcessor(int bufferSize, | 299 ScriptProcessorNode createScriptProcessor(int bufferSize, |
| 300 [int numberOfInputChannels, int numberOfOutputChannels]) { | 300 [int numberOfInputChannels, int numberOfOutputChannels]) { |
| 301 var function = JS('dynamic', '#.createScriptProcessor || ' | 301 var function = JS('dynamic', '#.createScriptProcessor || ' |
| 302 '#.createJavaScriptNode', this, this); | 302 '#.createJavaScriptNode', this, this); |
| 303 if (?numberOfOutputChannels) { | 303 if (numberOfOutputChannels != null) { |
| 304 return JS('ScriptProcessorNode', '#.call(#, #, #, #)', function, this, | 304 return JS('ScriptProcessorNode', '#.call(#, #, #, #)', function, this, |
| 305 bufferSize, numberOfInputChannels, numberOfOutputChannels); | 305 bufferSize, numberOfInputChannels, numberOfOutputChannels); |
| 306 } else if (?numberOfInputChannels) { | 306 } else if (numberOfInputChannels != null) { |
| 307 return JS('ScriptProcessorNode', '#.call(#, #, #)', function, this, | 307 return JS('ScriptProcessorNode', '#.call(#, #, #)', function, this, |
| 308 bufferSize, numberOfInputChannels); | 308 bufferSize, numberOfInputChannels); |
| 309 } else { | 309 } else { |
| 310 return JS('ScriptProcessorNode', '#.call(#, #)', function, this, | 310 return JS('ScriptProcessorNode', '#.call(#, #)', function, this, |
| 311 bufferSize); | 311 bufferSize); |
| 312 } | 312 } |
| 313 } | 313 } |
| 314 } | 314 } |
| 315 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 315 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 316 // for details. All rights reserved. Use of this source code is governed by a | 316 // for details. All rights reserved. Use of this source code is governed by a |
| (...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 871 } | 871 } |
| 872 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 872 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 873 // for details. All rights reserved. Use of this source code is governed by a | 873 // for details. All rights reserved. Use of this source code is governed by a |
| 874 // BSD-style license that can be found in the LICENSE file. | 874 // BSD-style license that can be found in the LICENSE file. |
| 875 | 875 |
| 876 | 876 |
| 877 @DocsEditable | 877 @DocsEditable |
| 878 @DomName('WaveTable') | 878 @DomName('WaveTable') |
| 879 class WaveTable native "WaveTable" { | 879 class WaveTable native "WaveTable" { |
| 880 } | 880 } |
| OLD | NEW |