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

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

Issue 19018006: Convert decodeAudioData to return a Future. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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
« no previous file with comments | « no previous file | sdk/lib/web_audio/dartium/web_audio_dartium.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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' hide deprecated; 5 import 'dart:_collection-dev' hide deprecated;
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, JSName, Returns, convertDartClosureToJS; 9 import 'dart:_js_helper' show Creates, JSName, Returns, convertDartClosureToJS;
10 import 'dart:_foreign_helper' show JS; 10 import 'dart:_foreign_helper' show JS;
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 PannerNode createPanner() native; 319 PannerNode createPanner() native;
320 320
321 @DomName('AudioContext.createWaveShaper') 321 @DomName('AudioContext.createWaveShaper')
322 @DocsEditable() 322 @DocsEditable()
323 WaveShaperNode createWaveShaper() native; 323 WaveShaperNode createWaveShaper() native;
324 324
325 @DomName('AudioContext.createWaveTable') 325 @DomName('AudioContext.createWaveTable')
326 @DocsEditable() 326 @DocsEditable()
327 WaveTable createWaveTable(Float32List real, Float32List imag) native; 327 WaveTable createWaveTable(Float32List real, Float32List imag) native;
328 328
329 @JSName('decodeAudioData')
329 @DomName('AudioContext.decodeAudioData') 330 @DomName('AudioContext.decodeAudioData')
330 @DocsEditable() 331 @DocsEditable()
331 void decodeAudioData(ByteBuffer audioData, AudioBufferCallback successCallback , [AudioBufferCallback errorCallback]) native; 332 void _decodeAudioData(ByteBuffer audioData, AudioBufferCallback successCallbac k, [AudioBufferCallback errorCallback]) native;
333
334 @JSName('decodeAudioData')
335 @DomName('AudioContext.decodeAudioData')
336 @DocsEditable()
337 Future<AudioBuffer> decodeAudioData(ByteBuffer audioData) {
338 var completer = new Completer<AudioBuffer>();
339 _decodeAudioData(audioData,
340 (value) { completer.complete(value); },
341 (error) { completer.completeError(error); });
342 return completer.future;
343 }
332 344
333 @DomName('AudioContext.startRendering') 345 @DomName('AudioContext.startRendering')
334 @DocsEditable() 346 @DocsEditable()
335 void startRendering() native; 347 void startRendering() native;
336 348
337 @DomName('AudioContext.oncomplete') 349 @DomName('AudioContext.oncomplete')
338 @DocsEditable() 350 @DocsEditable()
339 Stream<Event> get onComplete => completeEvent.forTarget(this); 351 Stream<Event> get onComplete => completeEvent.forTarget(this);
340 352
341 factory AudioContext() => JS('AudioContext', 353 factory AudioContext() => JS('AudioContext',
(...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after
1115 // for details. All rights reserved. Use of this source code is governed by a 1127 // for details. All rights reserved. Use of this source code is governed by a
1116 // BSD-style license that can be found in the LICENSE file. 1128 // BSD-style license that can be found in the LICENSE file.
1117 1129
1118 1130
1119 @DocsEditable() 1131 @DocsEditable()
1120 @DomName('WaveTable') 1132 @DomName('WaveTable')
1121 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#WaveTab le-section 1133 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#WaveTab le-section
1122 @Experimental() 1134 @Experimental()
1123 class WaveTable extends Interceptor native "WaveTable" { 1135 class WaveTable extends Interceptor native "WaveTable" {
1124 } 1136 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/web_audio/dartium/web_audio_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698