Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Side by Side Diff: sdk/lib/web_audio/dart2js/web_audio_dart2js.dart

Issue 14400004: First try at removing ? from HTML. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Made positional arguments make more sense, Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 library dart.dom.web_audio; 1 library dart.dom.web_audio;
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;
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 (grainOffset != null) {
115 JS('void', '#.start(#, #)', this, when, grainOffset);
116 } else if (grainDuration != null) {
115 JS('void', '#.start(#, #, #)', this, when, grainOffset, grainDuration); 117 JS('void', '#.start(#, #, #)', this, when, grainOffset, grainDuration);
116 } else if (?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 (grainOffset != null) {
123 JS('void', '#.noteOn(#, #)', this, when, grainOffset);
124 } else if (grainDuration != null) {
123 JS('void', '#.noteOn(#, #, #)', this, when, grainOffset, grainDuration); 125 JS('void', '#.noteOn(#, #, #)', this, when, grainOffset, grainDuration);
124 } else if (?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);
135 } else { 135 } else {
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 (numberOfInputChannels != null) {
304 return JS('ScriptProcessorNode', '#.call(#, #, #)', function, this,
305 bufferSize, numberOfInputChannels);
306 } else if (numberOfOutputChannels != null) {
304 return JS('ScriptProcessorNode', '#.call(#, #, #, #)', function, this, 307 return JS('ScriptProcessorNode', '#.call(#, #, #, #)', function, this,
305 bufferSize, numberOfInputChannels, numberOfOutputChannels); 308 bufferSize, numberOfInputChannels, numberOfOutputChannels);
306 } else if (?numberOfInputChannels) {
307 return JS('ScriptProcessorNode', '#.call(#, #, #)', function, this,
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
317 // BSD-style license that can be found in the LICENSE file. 317 // BSD-style license that can be found in the LICENSE file.
318 318
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698