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:_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:nativewrappers'; | 8 import 'dart:nativewrappers'; |
9 import 'dart:typed_data'; | 9 import 'dart:typed_data'; |
10 // DO NOT EDIT | 10 // DO NOT EDIT |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 num get sampleRate native "AudioContext_sampleRate_Getter"; | 291 num get sampleRate native "AudioContext_sampleRate_Getter"; |
292 | 292 |
293 @DomName('AudioContext.createAnalyser') | 293 @DomName('AudioContext.createAnalyser') |
294 @DocsEditable() | 294 @DocsEditable() |
295 AnalyserNode createAnalyser() native "AudioContext_createAnalyser_Callback"; | 295 AnalyserNode createAnalyser() native "AudioContext_createAnalyser_Callback"; |
296 | 296 |
297 @DomName('AudioContext.createBiquadFilter') | 297 @DomName('AudioContext.createBiquadFilter') |
298 @DocsEditable() | 298 @DocsEditable() |
299 BiquadFilterNode createBiquadFilter() native "AudioContext_createBiquadFilter_
Callback"; | 299 BiquadFilterNode createBiquadFilter() native "AudioContext_createBiquadFilter_
Callback"; |
300 | 300 |
301 AudioBuffer createBuffer(buffer_OR_numberOfChannels, mixToMono_OR_numberOfFram
es, [num sampleRate]) { | 301 @DomName('AudioContext.createBuffer') |
302 if ((sampleRate is num || sampleRate == null) && (mixToMono_OR_numberOfFrame
s is int || mixToMono_OR_numberOfFrames == null) && (buffer_OR_numberOfChannels
is int || buffer_OR_numberOfChannels == null)) { | 302 @DocsEditable() |
303 return _createBuffer_1(buffer_OR_numberOfChannels, mixToMono_OR_numberOfFr
ames, sampleRate); | 303 AudioBuffer createBuffer(int numberOfChannels, int numberOfFrames, num sampleR
ate) native "AudioContext_createBuffer_Callback"; |
304 } | |
305 if ((mixToMono_OR_numberOfFrames is bool || mixToMono_OR_numberOfFrames == n
ull) && (buffer_OR_numberOfChannels is ByteBuffer || buffer_OR_numberOfChannels
== null) && sampleRate == null) { | |
306 return _createBuffer_2(buffer_OR_numberOfChannels, mixToMono_OR_numberOfFr
ames); | |
307 } | |
308 throw new ArgumentError("Incorrect number or type of arguments"); | |
309 } | |
310 | 304 |
311 AudioBuffer _createBuffer_1(buffer_OR_numberOfChannels, mixToMono_OR_numberOfF
rames, sampleRate) native "AudioContext__createBuffer_1_Callback"; | 305 @DomName('AudioContext.createBufferFromBuffer') |
312 | 306 @DocsEditable() |
313 AudioBuffer _createBuffer_2(buffer_OR_numberOfChannels, mixToMono_OR_numberOfF
rames) native "AudioContext__createBuffer_2_Callback"; | 307 AudioBuffer createBufferFromBuffer(ByteBuffer buffer, bool mixToMono) native "
AudioContext_createBufferFromBuffer_Callback"; |
314 | 308 |
315 @DomName('AudioContext.createBufferSource') | 309 @DomName('AudioContext.createBufferSource') |
316 @DocsEditable() | 310 @DocsEditable() |
317 AudioBufferSourceNode createBufferSource() native "AudioContext_createBufferSo
urce_Callback"; | 311 AudioBufferSourceNode createBufferSource() native "AudioContext_createBufferSo
urce_Callback"; |
318 | 312 |
319 ChannelMergerNode createChannelMerger([int numberOfInputs]) { | 313 ChannelMergerNode createChannelMerger([int numberOfInputs]) { |
320 if (numberOfInputs != null) { | 314 if (numberOfInputs != null) { |
321 return _createChannelMerger_1(numberOfInputs); | 315 return _createChannelMerger_1(numberOfInputs); |
322 } | 316 } |
323 return _createChannelMerger_2(); | 317 return _createChannelMerger_2(); |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 | 502 |
509 @DomName('AudioListener.setVelocity') | 503 @DomName('AudioListener.setVelocity') |
510 @DocsEditable() | 504 @DocsEditable() |
511 void setVelocity(num x, num y, num z) native "AudioListener_setVelocity_Callba
ck"; | 505 void setVelocity(num x, num y, num z) native "AudioListener_setVelocity_Callba
ck"; |
512 | 506 |
513 } | 507 } |
514 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 508 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
515 // for details. All rights reserved. Use of this source code is governed by a | 509 // for details. All rights reserved. Use of this source code is governed by a |
516 // BSD-style license that can be found in the LICENSE file. | 510 // BSD-style license that can be found in the LICENSE file. |
517 | 511 |
518 // WARNING: Do not edit - generated code. | |
519 | 512 |
520 | |
521 @DocsEditable() | |
522 @DomName('AudioNode') | 513 @DomName('AudioNode') |
523 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioNo
de-section | 514 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioNo
de-section |
524 @Experimental() | 515 @Experimental() |
525 class AudioNode extends EventTarget { | 516 class AudioNode extends EventTarget { |
526 // To suppress missing implicit constructor warnings. | 517 // To suppress missing implicit constructor warnings. |
527 factory AudioNode._() { throw new UnsupportedError("Not supported"); } | 518 factory AudioNode._() { throw new UnsupportedError("Not supported"); } |
528 | 519 |
529 @DomName('AudioNode.channelCount') | 520 @DomName('AudioNode.channelCount') |
530 @DocsEditable() | 521 @DocsEditable() |
531 int get channelCount native "AudioNode_channelCount_Getter"; | 522 int get channelCount native "AudioNode_channelCount_Getter"; |
(...skipping 27 matching lines...) Expand all Loading... |
559 int get numberOfInputs native "AudioNode_numberOfInputs_Getter"; | 550 int get numberOfInputs native "AudioNode_numberOfInputs_Getter"; |
560 | 551 |
561 @DomName('AudioNode.numberOfOutputs') | 552 @DomName('AudioNode.numberOfOutputs') |
562 @DocsEditable() | 553 @DocsEditable() |
563 int get numberOfOutputs native "AudioNode_numberOfOutputs_Getter"; | 554 int get numberOfOutputs native "AudioNode_numberOfOutputs_Getter"; |
564 | 555 |
565 @DomName('AudioNode.addEventListener') | 556 @DomName('AudioNode.addEventListener') |
566 @DocsEditable() | 557 @DocsEditable() |
567 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu
re]) native "AudioNode_addEventListener_Callback"; | 558 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu
re]) native "AudioNode_addEventListener_Callback"; |
568 | 559 |
569 void connect(destination, int output, [int input]) { | 560 void $dom_connect(destination, int output, [int input]) { |
570 if ((input is int || input == null) && (output is int || output == null) &&
(destination is AudioNode || destination == null)) { | 561 if ((input is int || input == null) && (output is int || output == null) &&
(destination is AudioNode || destination == null)) { |
571 _connect_1(destination, output, input); | 562 _connect_1(destination, output, input); |
572 return; | 563 return; |
573 } | 564 } |
574 if ((output is int || output == null) && (destination is AudioParam || desti
nation == null) && input == null) { | 565 if ((output is int || output == null) && (destination is AudioParam || desti
nation == null) && input == null) { |
575 _connect_2(destination, output); | 566 _connect_2(destination, output); |
576 return; | 567 return; |
577 } | 568 } |
578 throw new ArgumentError("Incorrect number or type of arguments"); | 569 throw new ArgumentError("Incorrect number or type of arguments"); |
579 } | 570 } |
580 | 571 |
581 void _connect_1(destination, output, input) native "AudioNode__connect_1_Callb
ack"; | 572 void _connect_1(destination, output, input) native "AudioNode__connect_1_Callb
ack"; |
582 | 573 |
583 void _connect_2(destination, output) native "AudioNode__connect_2_Callback"; | 574 void _connect_2(destination, output) native "AudioNode__connect_2_Callback"; |
584 | 575 |
585 @DomName('AudioNode.disconnect') | 576 @DomName('AudioNode.disconnect') |
586 @DocsEditable() | 577 @DocsEditable() |
587 void disconnect(int output) native "AudioNode_disconnect_Callback"; | 578 void disconnect(int output) native "AudioNode_disconnect_Callback"; |
588 | 579 |
589 @DomName('AudioNode.dispatchEvent') | 580 @DomName('AudioNode.dispatchEvent') |
590 @DocsEditable() | 581 @DocsEditable() |
591 bool dispatchEvent(Event event) native "AudioNode_dispatchEvent_Callback"; | 582 bool dispatchEvent(Event event) native "AudioNode_dispatchEvent_Callback"; |
592 | 583 |
593 @DomName('AudioNode.removeEventListener') | 584 @DomName('AudioNode.removeEventListener') |
594 @DocsEditable() | 585 @DocsEditable() |
595 void $dom_removeEventListener(String type, EventListener listener, [bool useCa
pture]) native "AudioNode_removeEventListener_Callback"; | 586 void $dom_removeEventListener(String type, EventListener listener, [bool useCa
pture]) native "AudioNode_removeEventListener_Callback"; |
596 | 587 |
| 588 @DomName('AudioNode.connect') |
| 589 void connectNode(AudioNode destination, [int output = 0, int input = 0]) => |
| 590 $dom_connect(destination, output, input); |
| 591 |
| 592 @DomName('AudioNode.connect') |
| 593 void connectParam(AudioParam destination, [int output = 0]) => |
| 594 $dom_connect(destination, output); |
597 } | 595 } |
598 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 596 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
599 // for details. All rights reserved. Use of this source code is governed by a | 597 // for details. All rights reserved. Use of this source code is governed by a |
600 // BSD-style license that can be found in the LICENSE file. | 598 // BSD-style license that can be found in the LICENSE file. |
601 | 599 |
602 // WARNING: Do not edit - generated code. | 600 // WARNING: Do not edit - generated code. |
603 | 601 |
604 | 602 |
605 @DocsEditable() | 603 @DocsEditable() |
606 @DomName('AudioParam') | 604 @DomName('AudioParam') |
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1350 // WARNING: Do not edit - generated code. | 1348 // WARNING: Do not edit - generated code. |
1351 | 1349 |
1352 | 1350 |
1353 @DocsEditable() | 1351 @DocsEditable() |
1354 @DomName('WaveTable') | 1352 @DomName('WaveTable') |
1355 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#WaveTab
le-section | 1353 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#WaveTab
le-section |
1356 @Experimental() | 1354 @Experimental() |
1357 class WaveTable extends NativeFieldWrapperClass1 { | 1355 class WaveTable extends NativeFieldWrapperClass1 { |
1358 | 1356 |
1359 } | 1357 } |
OLD | NEW |