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:nativewrappers'; | 7 import 'dart:nativewrappers'; |
8 import 'dart:typeddata' as _typeddata; | 8 import 'dart:typeddata' as _typeddata; |
9 // DO NOT EDIT | 9 // DO NOT EDIT |
10 // Auto-generated dart:audio library. | 10 // Auto-generated dart:audio library. |
(...skipping 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1089 * Get a Stream that fires events when AudioProcessingEvents occur. | 1089 * Get a Stream that fires events when AudioProcessingEvents occur. |
1090 * This particular stream is special in that it only allows one listener to a | 1090 * This particular stream is special in that it only allows one listener to a |
1091 * given stream. Converting the returned Stream [asBroadcast] will likely ruin | 1091 * given stream. Converting the returned Stream [asBroadcast] will likely ruin |
1092 * the soft-real-time properties which which these events are fired and can | 1092 * the soft-real-time properties which which these events are fired and can |
1093 * be processed. | 1093 * be processed. |
1094 */ | 1094 */ |
1095 Stream<AudioProcessingEvent> get onAudioProcess { | 1095 Stream<AudioProcessingEvent> get onAudioProcess { |
1096 if (_eventStream == null) { | 1096 if (_eventStream == null) { |
1097 var controller = new StreamController(); | 1097 var controller = new StreamController(); |
1098 var callback = (audioData) { | 1098 var callback = (audioData) { |
1099 if (controller.hasSubscribers) { | 1099 if (controller.hasListener) { |
1100 // This stream is a strange combination of broadcast and single | 1100 // This stream is a strange combination of broadcast and single |
1101 // subscriber streams. We only allow one listener, but if there is | 1101 // subscriber streams. We only allow one listener, but if there is |
1102 // no listener, we don't queue up events, we just drop them on the | 1102 // no listener, we don't queue up events, we just drop them on the |
1103 // floor. | 1103 // floor. |
1104 controller.add(audioData); | 1104 controller.add(audioData); |
1105 } | 1105 } |
1106 }; | 1106 }; |
1107 _setEventListener(callback); | 1107 _setEventListener(callback); |
1108 _eventStream = controller.stream; | 1108 _eventStream = controller.stream; |
1109 } | 1109 } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1149 | 1149 |
1150 // WARNING: Do not edit - generated code. | 1150 // WARNING: Do not edit - generated code. |
1151 | 1151 |
1152 | 1152 |
1153 @DocsEditable | 1153 @DocsEditable |
1154 @DomName('WaveTable') | 1154 @DomName('WaveTable') |
1155 class WaveTable extends NativeFieldWrapperClass1 { | 1155 class WaveTable extends NativeFieldWrapperClass1 { |
1156 WaveTable.internal(); | 1156 WaveTable.internal(); |
1157 | 1157 |
1158 } | 1158 } |
OLD | NEW |