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:_internal' hide deprecated; | 5 import 'dart:_internal' hide deprecated; |
6 import 'dart:html'; | 6 import 'dart:html'; |
7 import 'dart:html_common'; | 7 import 'dart:html_common'; |
8 import 'dart:nativewrappers'; | 8 import 'dart:nativewrappers'; |
9 import 'dart:typed_data'; | 9 import 'dart:typed_data'; |
10 import 'dart:_blink' as _blink; | 10 import 'dart:_blink' as _blink; |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 void noteGrainOn(num when, num grainOffset, num grainDuration) => _blink.Blink
AudioBufferSourceNode.$noteGrainOn_Callback(this, when, grainOffset, grainDurati
on); | 241 void noteGrainOn(num when, num grainOffset, num grainDuration) => _blink.Blink
AudioBufferSourceNode.$noteGrainOn_Callback(this, when, grainOffset, grainDurati
on); |
242 | 242 |
243 @DomName('AudioBufferSourceNode.noteOff') | 243 @DomName('AudioBufferSourceNode.noteOff') |
244 @DocsEditable() | 244 @DocsEditable() |
245 void noteOff(num when) => _blink.BlinkAudioBufferSourceNode.$noteOff_Callback(
this, when); | 245 void noteOff(num when) => _blink.BlinkAudioBufferSourceNode.$noteOff_Callback(
this, when); |
246 | 246 |
247 @DomName('AudioBufferSourceNode.noteOn') | 247 @DomName('AudioBufferSourceNode.noteOn') |
248 @DocsEditable() | 248 @DocsEditable() |
249 void noteOn(num when) => _blink.BlinkAudioBufferSourceNode.$noteOn_Callback(th
is, when); | 249 void noteOn(num when) => _blink.BlinkAudioBufferSourceNode.$noteOn_Callback(th
is, when); |
250 | 250 |
251 void start([num when, num grainOffset, num grainDuration]) => _blink.BlinkAudi
oBufferSourceNode.$start(this, when, grainOffset, grainDuration); | 251 void start([num when, num grainOffset, num grainDuration]) { |
| 252 if (grainDuration != null) { |
| 253 _blink.BlinkAudioBufferSourceNode.$_start_1_Callback(this, when, grainOffs
et, grainDuration); |
| 254 return; |
| 255 } |
| 256 if (grainOffset != null) { |
| 257 _blink.BlinkAudioBufferSourceNode.$_start_2_Callback(this, when, grainOffs
et); |
| 258 return; |
| 259 } |
| 260 if (when != null) { |
| 261 _blink.BlinkAudioBufferSourceNode.$_start_3_Callback(this, when); |
| 262 return; |
| 263 } |
| 264 _blink.BlinkAudioBufferSourceNode.$_start_4_Callback(this); |
| 265 return; |
| 266 } |
252 | 267 |
253 void stop([num when]) => _blink.BlinkAudioBufferSourceNode.$stop(this, when); | 268 void stop([num when]) { |
| 269 if (when != null) { |
| 270 _blink.BlinkAudioBufferSourceNode.$_stop_1_Callback(this, when); |
| 271 return; |
| 272 } |
| 273 _blink.BlinkAudioBufferSourceNode.$_stop_2_Callback(this); |
| 274 return; |
| 275 } |
254 | 276 |
255 /// Stream of `ended` events handled by this [AudioBufferSourceNode]. | 277 /// Stream of `ended` events handled by this [AudioBufferSourceNode]. |
256 @DomName('AudioBufferSourceNode.onended') | 278 @DomName('AudioBufferSourceNode.onended') |
257 @DocsEditable() | 279 @DocsEditable() |
258 @Experimental() // untriaged | 280 @Experimental() // untriaged |
259 Stream<Event> get onEnded => endedEvent.forTarget(this); | 281 Stream<Event> get onEnded => endedEvent.forTarget(this); |
260 | 282 |
261 } | 283 } |
262 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 284 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
263 // for details. All rights reserved. Use of this source code is governed by a | 285 // for details. All rights reserved. Use of this source code is governed by a |
(...skipping 14 matching lines...) Expand all Loading... |
278 * handlers that are not necessarily instances of [AudioContext]. | 300 * handlers that are not necessarily instances of [AudioContext]. |
279 * | 301 * |
280 * See [EventStreamProvider] for usage information. | 302 * See [EventStreamProvider] for usage information. |
281 */ | 303 */ |
282 @DomName('AudioContext.completeEvent') | 304 @DomName('AudioContext.completeEvent') |
283 @DocsEditable() | 305 @DocsEditable() |
284 static const EventStreamProvider<Event> completeEvent = const EventStreamProvi
der<Event>('complete'); | 306 static const EventStreamProvider<Event> completeEvent = const EventStreamProvi
der<Event>('complete'); |
285 | 307 |
286 @DomName('AudioContext.AudioContext') | 308 @DomName('AudioContext.AudioContext') |
287 @DocsEditable() | 309 @DocsEditable() |
288 factory AudioContext() => _blink.BlinkAudioContext.$mkAudioContext(); | 310 factory AudioContext() { |
| 311 return _blink.BlinkAudioContext.$_create_1constructorCallback(); |
| 312 } |
289 | 313 |
290 /// Checks if this type is supported on the current platform. | 314 /// Checks if this type is supported on the current platform. |
291 static bool get supported => true; | 315 static bool get supported => true; |
292 | 316 |
293 @DomName('AudioContext.currentTime') | 317 @DomName('AudioContext.currentTime') |
294 @DocsEditable() | 318 @DocsEditable() |
295 double get currentTime => _blink.BlinkAudioContext.$currentTime_Getter(this); | 319 double get currentTime => _blink.BlinkAudioContext.$currentTime_Getter(this); |
296 | 320 |
297 @DomName('AudioContext.destination') | 321 @DomName('AudioContext.destination') |
298 @DocsEditable() | 322 @DocsEditable() |
(...skipping 16 matching lines...) Expand all Loading... |
315 BiquadFilterNode createBiquadFilter() => _blink.BlinkAudioContext.$createBiqua
dFilter_Callback(this); | 339 BiquadFilterNode createBiquadFilter() => _blink.BlinkAudioContext.$createBiqua
dFilter_Callback(this); |
316 | 340 |
317 @DomName('AudioContext.createBuffer') | 341 @DomName('AudioContext.createBuffer') |
318 @DocsEditable() | 342 @DocsEditable() |
319 AudioBuffer createBuffer(int numberOfChannels, int numberOfFrames, num sampleR
ate) => _blink.BlinkAudioContext.$createBuffer_Callback(this, numberOfChannels,
numberOfFrames, sampleRate); | 343 AudioBuffer createBuffer(int numberOfChannels, int numberOfFrames, num sampleR
ate) => _blink.BlinkAudioContext.$createBuffer_Callback(this, numberOfChannels,
numberOfFrames, sampleRate); |
320 | 344 |
321 @DomName('AudioContext.createBufferSource') | 345 @DomName('AudioContext.createBufferSource') |
322 @DocsEditable() | 346 @DocsEditable() |
323 AudioBufferSourceNode createBufferSource() => _blink.BlinkAudioContext.$create
BufferSource_Callback(this); | 347 AudioBufferSourceNode createBufferSource() => _blink.BlinkAudioContext.$create
BufferSource_Callback(this); |
324 | 348 |
325 ChannelMergerNode createChannelMerger([int numberOfInputs]) => _blink.BlinkAud
ioContext.$createChannelMerger(this, numberOfInputs); | 349 ChannelMergerNode createChannelMerger([int numberOfInputs]) { |
| 350 if (numberOfInputs != null) { |
| 351 return _blink.BlinkAudioContext.$_createChannelMerger_1_Callback(this, num
berOfInputs); |
| 352 } |
| 353 return _blink.BlinkAudioContext.$_createChannelMerger_2_Callback(this); |
| 354 } |
326 | 355 |
327 ChannelSplitterNode createChannelSplitter([int numberOfOutputs]) => _blink.Bli
nkAudioContext.$createChannelSplitter(this, numberOfOutputs); | 356 ChannelSplitterNode createChannelSplitter([int numberOfOutputs]) { |
| 357 if (numberOfOutputs != null) { |
| 358 return _blink.BlinkAudioContext.$_createChannelSplitter_1_Callback(this, n
umberOfOutputs); |
| 359 } |
| 360 return _blink.BlinkAudioContext.$_createChannelSplitter_2_Callback(this); |
| 361 } |
328 | 362 |
329 @DomName('AudioContext.createConvolver') | 363 @DomName('AudioContext.createConvolver') |
330 @DocsEditable() | 364 @DocsEditable() |
331 ConvolverNode createConvolver() => _blink.BlinkAudioContext.$createConvolver_C
allback(this); | 365 ConvolverNode createConvolver() => _blink.BlinkAudioContext.$createConvolver_C
allback(this); |
332 | 366 |
333 DelayNode createDelay([num maxDelayTime]) => _blink.BlinkAudioContext.$createD
elay(this, maxDelayTime); | 367 DelayNode createDelay([num maxDelayTime]) { |
| 368 if (maxDelayTime != null) { |
| 369 return _blink.BlinkAudioContext.$_createDelay_1_Callback(this, maxDelayTim
e); |
| 370 } |
| 371 return _blink.BlinkAudioContext.$_createDelay_2_Callback(this); |
| 372 } |
334 | 373 |
335 @DomName('AudioContext.createDynamicsCompressor') | 374 @DomName('AudioContext.createDynamicsCompressor') |
336 @DocsEditable() | 375 @DocsEditable() |
337 DynamicsCompressorNode createDynamicsCompressor() => _blink.BlinkAudioContext.
$createDynamicsCompressor_Callback(this); | 376 DynamicsCompressorNode createDynamicsCompressor() => _blink.BlinkAudioContext.
$createDynamicsCompressor_Callback(this); |
338 | 377 |
339 @DomName('AudioContext.createGain') | 378 @DomName('AudioContext.createGain') |
340 @DocsEditable() | 379 @DocsEditable() |
341 GainNode createGain() => _blink.BlinkAudioContext.$createGain_Callback(this); | 380 GainNode createGain() => _blink.BlinkAudioContext.$createGain_Callback(this); |
342 | 381 |
343 @DomName('AudioContext.createMediaElementSource') | 382 @DomName('AudioContext.createMediaElementSource') |
(...skipping 14 matching lines...) Expand all Loading... |
358 | 397 |
359 @DomName('AudioContext.createPanner') | 398 @DomName('AudioContext.createPanner') |
360 @DocsEditable() | 399 @DocsEditable() |
361 PannerNode createPanner() => _blink.BlinkAudioContext.$createPanner_Callback(t
his); | 400 PannerNode createPanner() => _blink.BlinkAudioContext.$createPanner_Callback(t
his); |
362 | 401 |
363 @DomName('AudioContext.createPeriodicWave') | 402 @DomName('AudioContext.createPeriodicWave') |
364 @DocsEditable() | 403 @DocsEditable() |
365 @Experimental() // untriaged | 404 @Experimental() // untriaged |
366 PeriodicWave createPeriodicWave(Float32List real, Float32List imag) => _blink.
BlinkAudioContext.$createPeriodicWave_Callback(this, real, imag); | 405 PeriodicWave createPeriodicWave(Float32List real, Float32List imag) => _blink.
BlinkAudioContext.$createPeriodicWave_Callback(this, real, imag); |
367 | 406 |
368 ScriptProcessorNode createScriptProcessor([int bufferSize, int numberOfInputCh
annels, int numberOfOutputChannels]) => _blink.BlinkAudioContext.$createScriptPr
ocessor(this, bufferSize, numberOfInputChannels, numberOfOutputChannels); | 407 ScriptProcessorNode createScriptProcessor([int bufferSize, int numberOfInputCh
annels, int numberOfOutputChannels]) { |
| 408 if (numberOfOutputChannels != null) { |
| 409 return _blink.BlinkAudioContext.$_createScriptProcessor_1_Callback(this, b
ufferSize, numberOfInputChannels, numberOfOutputChannels); |
| 410 } |
| 411 if (numberOfInputChannels != null) { |
| 412 return _blink.BlinkAudioContext.$_createScriptProcessor_2_Callback(this, b
ufferSize, numberOfInputChannels); |
| 413 } |
| 414 if (bufferSize != null) { |
| 415 return _blink.BlinkAudioContext.$_createScriptProcessor_3_Callback(this, b
ufferSize); |
| 416 } |
| 417 return _blink.BlinkAudioContext.$_createScriptProcessor_4_Callback(this); |
| 418 } |
369 | 419 |
370 @DomName('AudioContext.createWaveShaper') | 420 @DomName('AudioContext.createWaveShaper') |
371 @DocsEditable() | 421 @DocsEditable() |
372 WaveShaperNode createWaveShaper() => _blink.BlinkAudioContext.$createWaveShape
r_Callback(this); | 422 WaveShaperNode createWaveShaper() => _blink.BlinkAudioContext.$createWaveShape
r_Callback(this); |
373 | 423 |
374 @DomName('AudioContext.decodeAudioData') | 424 @DomName('AudioContext.decodeAudioData') |
375 @DocsEditable() | 425 @DocsEditable() |
376 void _decodeAudioData(ByteBuffer audioData, AudioBufferCallback successCallbac
k, [AudioBufferCallback errorCallback]) => _blink.BlinkAudioContext.$decodeAudio
Data_Callback(this, audioData, successCallback, errorCallback); | 426 void _decodeAudioData(ByteBuffer audioData, AudioBufferCallback successCallbac
k, [AudioBufferCallback errorCallback]) => _blink.BlinkAudioContext.$decodeAudio
Data_Callback(this, audioData, successCallback, errorCallback); |
377 | 427 |
378 @DomName('AudioContext.startRendering') | 428 @DomName('AudioContext.startRendering') |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 AudioContext get context => _blink.BlinkAudioNode.$context_Getter(this); | 554 AudioContext get context => _blink.BlinkAudioNode.$context_Getter(this); |
505 | 555 |
506 @DomName('AudioNode.numberOfInputs') | 556 @DomName('AudioNode.numberOfInputs') |
507 @DocsEditable() | 557 @DocsEditable() |
508 int get numberOfInputs => _blink.BlinkAudioNode.$numberOfInputs_Getter(this); | 558 int get numberOfInputs => _blink.BlinkAudioNode.$numberOfInputs_Getter(this); |
509 | 559 |
510 @DomName('AudioNode.numberOfOutputs') | 560 @DomName('AudioNode.numberOfOutputs') |
511 @DocsEditable() | 561 @DocsEditable() |
512 int get numberOfOutputs => _blink.BlinkAudioNode.$numberOfOutputs_Getter(this)
; | 562 int get numberOfOutputs => _blink.BlinkAudioNode.$numberOfOutputs_Getter(this)
; |
513 | 563 |
514 void _connect(destination, int output, [int input]) => _blink.BlinkAudioNode.$
_connect(this, destination, output, input); | 564 void _connect(destination, int output, [int input]) { |
| 565 if ((input is int || input == null) && (output is int || output == null) &&
(destination is AudioNode || destination == null)) { |
| 566 _blink.BlinkAudioNode.$_connect_1_Callback(this, destination, output, inpu
t); |
| 567 return; |
| 568 } |
| 569 if ((output is int || output == null) && (destination is AudioParam || desti
nation == null) && input == null) { |
| 570 _blink.BlinkAudioNode.$_connect_2_Callback(this, destination, output); |
| 571 return; |
| 572 } |
| 573 throw new ArgumentError("Incorrect number or type of arguments"); |
| 574 } |
515 | 575 |
516 @DomName('AudioNode.disconnect') | 576 @DomName('AudioNode.disconnect') |
517 @DocsEditable() | 577 @DocsEditable() |
518 void disconnect(int output) => _blink.BlinkAudioNode.$disconnect_Callback(this
, output); | 578 void disconnect(int output) => _blink.BlinkAudioNode.$disconnect_Callback(this
, output); |
519 | 579 |
520 @DomName('AudioNode.connect') | 580 @DomName('AudioNode.connect') |
521 void connectNode(AudioNode destination, [int output = 0, int input = 0]) => | 581 void connectNode(AudioNode destination, [int output = 0, int input = 0]) => |
522 _connect(destination, output, input); | 582 _connect(destination, output, input); |
523 | 583 |
524 @DomName('AudioNode.connect') | 584 @DomName('AudioNode.connect') |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
944 @DocsEditable() | 1004 @DocsEditable() |
945 @DomName('OfflineAudioContext') | 1005 @DomName('OfflineAudioContext') |
946 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#Offline
AudioContext-section | 1006 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#Offline
AudioContext-section |
947 @Experimental() | 1007 @Experimental() |
948 class OfflineAudioContext extends AudioContext { | 1008 class OfflineAudioContext extends AudioContext { |
949 // To suppress missing implicit constructor warnings. | 1009 // To suppress missing implicit constructor warnings. |
950 factory OfflineAudioContext._() { throw new UnsupportedError("Not supported");
} | 1010 factory OfflineAudioContext._() { throw new UnsupportedError("Not supported");
} |
951 | 1011 |
952 @DomName('OfflineAudioContext.OfflineAudioContext') | 1012 @DomName('OfflineAudioContext.OfflineAudioContext') |
953 @DocsEditable() | 1013 @DocsEditable() |
954 factory OfflineAudioContext(int numberOfChannels, int numberOfFrames, num samp
leRate) => _blink.BlinkOfflineAudioContext.$mkOfflineAudioContext(numberOfChanne
ls, numberOfFrames, sampleRate); | 1014 factory OfflineAudioContext(int numberOfChannels, int numberOfFrames, num samp
leRate) { |
| 1015 return _blink.BlinkOfflineAudioContext.$_create_1constructorCallback(numberO
fChannels, numberOfFrames, sampleRate); |
| 1016 } |
955 | 1017 |
956 } | 1018 } |
957 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1019 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
958 // for details. All rights reserved. Use of this source code is governed by a | 1020 // for details. All rights reserved. Use of this source code is governed by a |
959 // BSD-style license that can be found in the LICENSE file. | 1021 // BSD-style license that can be found in the LICENSE file. |
960 | 1022 |
961 // WARNING: Do not edit - generated code. | 1023 // WARNING: Do not edit - generated code. |
962 | 1024 |
963 | 1025 |
964 @DocsEditable() | 1026 @DocsEditable() |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1018 | 1080 |
1019 @DomName('OscillatorNode.noteOn') | 1081 @DomName('OscillatorNode.noteOn') |
1020 @DocsEditable() | 1082 @DocsEditable() |
1021 void noteOn(num when) => _blink.BlinkOscillatorNode.$noteOn_Callback(this, whe
n); | 1083 void noteOn(num when) => _blink.BlinkOscillatorNode.$noteOn_Callback(this, whe
n); |
1022 | 1084 |
1023 @DomName('OscillatorNode.setPeriodicWave') | 1085 @DomName('OscillatorNode.setPeriodicWave') |
1024 @DocsEditable() | 1086 @DocsEditable() |
1025 @Experimental() // untriaged | 1087 @Experimental() // untriaged |
1026 void setPeriodicWave(PeriodicWave periodicWave) => _blink.BlinkOscillatorNode.
$setPeriodicWave_Callback(this, periodicWave); | 1088 void setPeriodicWave(PeriodicWave periodicWave) => _blink.BlinkOscillatorNode.
$setPeriodicWave_Callback(this, periodicWave); |
1027 | 1089 |
1028 void start([num when]) => _blink.BlinkOscillatorNode.$start(this, when); | 1090 void start([num when]) { |
| 1091 if (when != null) { |
| 1092 _blink.BlinkOscillatorNode.$_start_1_Callback(this, when); |
| 1093 return; |
| 1094 } |
| 1095 _blink.BlinkOscillatorNode.$_start_2_Callback(this); |
| 1096 return; |
| 1097 } |
1029 | 1098 |
1030 void stop([num when]) => _blink.BlinkOscillatorNode.$stop(this, when); | 1099 void stop([num when]) { |
| 1100 if (when != null) { |
| 1101 _blink.BlinkOscillatorNode.$_stop_1_Callback(this, when); |
| 1102 return; |
| 1103 } |
| 1104 _blink.BlinkOscillatorNode.$_stop_2_Callback(this); |
| 1105 return; |
| 1106 } |
1031 | 1107 |
1032 /// Stream of `ended` events handled by this [OscillatorNode]. | 1108 /// Stream of `ended` events handled by this [OscillatorNode]. |
1033 @DomName('OscillatorNode.onended') | 1109 @DomName('OscillatorNode.onended') |
1034 @DocsEditable() | 1110 @DocsEditable() |
1035 @Experimental() // untriaged | 1111 @Experimental() // untriaged |
1036 Stream<Event> get onEnded => endedEvent.forTarget(this); | 1112 Stream<Event> get onEnded => endedEvent.forTarget(this); |
1037 | 1113 |
1038 } | 1114 } |
1039 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1115 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
1040 // for details. All rights reserved. Use of this source code is governed by a | 1116 // for details. All rights reserved. Use of this source code is governed by a |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1217 | 1293 |
1218 @DomName('WaveShaperNode.oversample') | 1294 @DomName('WaveShaperNode.oversample') |
1219 @DocsEditable() | 1295 @DocsEditable() |
1220 String get oversample => _blink.BlinkWaveShaperNode.$oversample_Getter(this); | 1296 String get oversample => _blink.BlinkWaveShaperNode.$oversample_Getter(this); |
1221 | 1297 |
1222 @DomName('WaveShaperNode.oversample') | 1298 @DomName('WaveShaperNode.oversample') |
1223 @DocsEditable() | 1299 @DocsEditable() |
1224 void set oversample(String value) => _blink.BlinkWaveShaperNode.$oversample_Se
tter(this, value); | 1300 void set oversample(String value) => _blink.BlinkWaveShaperNode.$oversample_Se
tter(this, value); |
1225 | 1301 |
1226 } | 1302 } |
OLD | NEW |