| OLD | NEW |
| 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:html'; | 5 import 'dart:html'; |
| 6 import 'dart:html_common'; | 6 import 'dart:html_common'; |
| 7 import 'dart:_js_helper' show Creates, Returns; | 7 import 'dart:_js_helper' show Creates, Returns, convertDartClosureToJS; |
| 8 import 'dart:_foreign_helper' show JS; | 8 import 'dart:_foreign_helper' show JS; |
| 9 // DO NOT EDIT - unless you are editing documentation as per: | 9 // DO NOT EDIT - unless you are editing documentation as per: |
| 10 // https://code.google.com/p/dart/wiki/ContributingHTMLDocumentation | 10 // https://code.google.com/p/dart/wiki/ContributingHTMLDocumentation |
| 11 // Auto-generated dart:audio library. | 11 // Auto-generated dart:audio library. |
| 12 | 12 |
| 13 | 13 |
| 14 | 14 |
| 15 | 15 |
| 16 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 16 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 17 // for details. All rights reserved. Use of this source code is governed by a | 17 // for details. All rights reserved. Use of this source code is governed by a |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 // BSD-style license that can be found in the LICENSE file. | 177 // BSD-style license that can be found in the LICENSE file. |
| 178 | 178 |
| 179 | 179 |
| 180 @DomName('AudioContext') | 180 @DomName('AudioContext') |
| 181 class AudioContext extends EventTarget native "*AudioContext" { | 181 class AudioContext extends EventTarget native "*AudioContext" { |
| 182 | 182 |
| 183 @DomName('AudioContext.completeEvent') | 183 @DomName('AudioContext.completeEvent') |
| 184 @DocsEditable | 184 @DocsEditable |
| 185 static const EventStreamProvider<Event> completeEvent = const EventStreamProvi
der<Event>('complete'); | 185 static const EventStreamProvider<Event> completeEvent = const EventStreamProvi
der<Event>('complete'); |
| 186 | 186 |
| 187 /// Checks if this type is supported on the current platform. |
| 188 static bool get supported => JS('bool', '!!(window.AudioContext || window.webk
itAudioContext)'); |
| 189 |
| 187 @DomName('AudioContext.activeSourceCount') | 190 @DomName('AudioContext.activeSourceCount') |
| 188 @DocsEditable | 191 @DocsEditable |
| 189 final int activeSourceCount; | 192 final int activeSourceCount; |
| 190 | 193 |
| 191 @DomName('AudioContext.currentTime') | 194 @DomName('AudioContext.currentTime') |
| 192 @DocsEditable | 195 @DocsEditable |
| 193 final num currentTime; | 196 final num currentTime; |
| 194 | 197 |
| 195 @DomName('AudioContext.destination') | 198 @DomName('AudioContext.destination') |
| 196 @DocsEditable | 199 @DocsEditable |
| (...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 806 void setOrientation(num x, num y, num z) native; | 809 void setOrientation(num x, num y, num z) native; |
| 807 | 810 |
| 808 @DomName('PannerNode.setPosition') | 811 @DomName('PannerNode.setPosition') |
| 809 @DocsEditable | 812 @DocsEditable |
| 810 void setPosition(num x, num y, num z) native; | 813 void setPosition(num x, num y, num z) native; |
| 811 | 814 |
| 812 @DomName('PannerNode.setVelocity') | 815 @DomName('PannerNode.setVelocity') |
| 813 @DocsEditable | 816 @DocsEditable |
| 814 void setVelocity(num x, num y, num z) native; | 817 void setVelocity(num x, num y, num z) native; |
| 815 } | 818 } |
| 816 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 819 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 817 // for details. All rights reserved. Use of this source code is governed by a | 820 // for details. All rights reserved. Use of this source code is governed by a |
| 818 // BSD-style license that can be found in the LICENSE file. | 821 // BSD-style license that can be found in the LICENSE file. |
| 819 | 822 |
| 820 | 823 |
| 821 @DocsEditable | |
| 822 @DomName('ScriptProcessorNode') | 824 @DomName('ScriptProcessorNode') |
| 823 class ScriptProcessorNode extends AudioNode implements EventTarget native "*Scri
ptProcessorNode" { | 825 class ScriptProcessorNode extends AudioNode native "*ScriptProcessorNode" { |
| 826 Stream<AudioProcessingEvent> _eventStream; |
| 827 |
| 828 /** |
| 829 * Get a Stream that fires events when AudioProcessingEvents occur. |
| 830 * This particular stream is special in that it only allows one listener to a |
| 831 * given stream. Converting the returned Stream [asBroadcast] will likely ruin |
| 832 * the soft-real-time properties which which these events are fired and can |
| 833 * be processed. |
| 834 */ |
| 835 Stream<AudioProcessingEvent> get onAudioProcess { |
| 836 if (_eventStream == null) { |
| 837 var controller = new StreamController(); |
| 838 var callback = (audioData) { |
| 839 if (controller.hasSubscribers) { |
| 840 // This stream is a strange combination of broadcast and single |
| 841 // subscriber streams. We only allow one listener, but if there is |
| 842 // no listener, we don't queue up events, we just drop them on the |
| 843 // floor. |
| 844 controller.add(audioData); |
| 845 } |
| 846 }; |
| 847 JS('void', '#.onaudioprocess = #', this, |
| 848 convertDartClosureToJS(callback, 1)); |
| 849 |
| 850 _eventStream = controller.stream; |
| 851 } |
| 852 return _eventStream; |
| 853 } |
| 824 | 854 |
| 825 @DomName('ScriptProcessorNode.bufferSize') | 855 @DomName('ScriptProcessorNode.bufferSize') |
| 826 @DocsEditable | 856 @DocsEditable |
| 827 final int bufferSize; | 857 final int bufferSize; |
| 858 |
| 828 } | 859 } |
| 829 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 860 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 830 // for details. All rights reserved. Use of this source code is governed by a | 861 // for details. All rights reserved. Use of this source code is governed by a |
| 831 // BSD-style license that can be found in the LICENSE file. | 862 // BSD-style license that can be found in the LICENSE file. |
| 832 | 863 |
| 833 | 864 |
| 834 @DocsEditable | 865 @DocsEditable |
| 835 @DomName('WaveShaperNode') | 866 @DomName('WaveShaperNode') |
| 836 class WaveShaperNode extends AudioNode native "*WaveShaperNode" { | 867 class WaveShaperNode extends AudioNode native "*WaveShaperNode" { |
| 837 | 868 |
| 838 @DomName('WaveShaperNode.curve') | 869 @DomName('WaveShaperNode.curve') |
| 839 @DocsEditable | 870 @DocsEditable |
| 840 @Returns('Float32Array') | 871 @Returns('Float32Array') |
| 841 @Creates('Float32Array') | 872 @Creates('Float32Array') |
| 842 List<double> curve; | 873 List<double> curve; |
| 843 } | 874 } |
| 844 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 875 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 845 // for details. All rights reserved. Use of this source code is governed by a | 876 // for details. All rights reserved. Use of this source code is governed by a |
| 846 // BSD-style license that can be found in the LICENSE file. | 877 // BSD-style license that can be found in the LICENSE file. |
| 847 | 878 |
| 848 | 879 |
| 849 @DocsEditable | 880 @DocsEditable |
| 850 @DomName('WaveTable') | 881 @DomName('WaveTable') |
| 851 class WaveTable native "*WaveTable" { | 882 class WaveTable native "*WaveTable" { |
| 852 } | 883 } |
| OLD | NEW |