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

Side by Side Diff: mojo/dart/packages/mojo_services/lib/mojo/media/audio_track.mojom.dart

Issue 2006093002: Dart: Futures -> Callbacks. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Merge Created 4 years, 6 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
OLDNEW
1 // WARNING: DO NOT EDIT. This file was generated by a program. 1 // WARNING: DO NOT EDIT. This file was generated by a program.
2 // See $MOJO_SDK/tools/bindings/mojom_bindings_generator.py. 2 // See $MOJO_SDK/tools/bindings/mojom_bindings_generator.py.
3 3
4 library audio_track_mojom; 4 library audio_track_mojom;
5 import 'dart:async'; 5 import 'dart:async';
6 import 'package:mojo/bindings.dart' as bindings; 6 import 'package:mojo/bindings.dart' as bindings;
7 import 'package:mojo/core.dart' as core; 7 import 'package:mojo/core.dart' as core;
8 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic e_describer; 8 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic e_describer;
9 import 'package:mojo_services/mojo/media/media_transport.mojom.dart' as media_tr ansport_mojom; 9 import 'package:mojo_services/mojo/media/media_transport.mojom.dart' as media_tr ansport_mojom;
10 import 'package:mojo_services/mojo/media/media_types.mojom.dart' as media_types_ mojom; 10 import 'package:mojo_services/mojo/media/media_types.mojom.dart' as media_types_ mojom;
11 import 'package:mojo_services/mojo/media/timeline_controller.mojom.dart' as time line_controller_mojom; 11 import 'package:mojo_services/mojo/media/timeline_controller.mojom.dart' as time line_controller_mojom;
12 12
13 13
14 14
15 class AudioTrackDescriptor extends bindings.Struct { 15 class AudioTrackDescriptor extends bindings.Struct {
16 static const List<bindings.StructDataHeader> kVersions = const [ 16 static const List<bindings.StructDataHeader> kVersions = const [
17 const bindings.StructDataHeader(16, 0) 17 const bindings.StructDataHeader(16, 0)
18 ]; 18 ];
19 List<media_types_mojom.MediaTypeSet> supportedMediaTypes = null; 19 List<media_types_mojom.MediaTypeSet> supportedMediaTypes = null;
20 20
21 AudioTrackDescriptor() : super(kVersions.last.size); 21 AudioTrackDescriptor() : super(kVersions.last.size);
22 22
23 AudioTrackDescriptor.init(
24 List<media_types_mojom.MediaTypeSet> this.supportedMediaTypes
25 ) : super(kVersions.last.size);
26
23 static AudioTrackDescriptor deserialize(bindings.Message message) { 27 static AudioTrackDescriptor deserialize(bindings.Message message) {
24 var decoder = new bindings.Decoder(message); 28 var decoder = new bindings.Decoder(message);
25 var result = decode(decoder); 29 var result = decode(decoder);
26 if (decoder.excessHandles != null) { 30 if (decoder.excessHandles != null) {
27 decoder.excessHandles.forEach((h) => h.close()); 31 decoder.excessHandles.forEach((h) => h.close());
28 } 32 }
29 return result; 33 return result;
30 } 34 }
31 35
32 static AudioTrackDescriptor decode(bindings.Decoder decoder0) { 36 static AudioTrackDescriptor decode(bindings.Decoder decoder0) {
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 class AudioTrackConfiguration extends bindings.Struct { 107 class AudioTrackConfiguration extends bindings.Struct {
104 static const List<bindings.StructDataHeader> kVersions = const [ 108 static const List<bindings.StructDataHeader> kVersions = const [
105 const bindings.StructDataHeader(24, 0) 109 const bindings.StructDataHeader(24, 0)
106 ]; 110 ];
107 media_types_mojom.MediaType mediaType = null; 111 media_types_mojom.MediaType mediaType = null;
108 int audioFrameRatio = 1; 112 int audioFrameRatio = 1;
109 int mediaTimeRatio = 1; 113 int mediaTimeRatio = 1;
110 114
111 AudioTrackConfiguration() : super(kVersions.last.size); 115 AudioTrackConfiguration() : super(kVersions.last.size);
112 116
117 AudioTrackConfiguration.init(
118 media_types_mojom.MediaType this.mediaType,
119 int this.audioFrameRatio,
120 int this.mediaTimeRatio
121 ) : super(kVersions.last.size);
122
113 static AudioTrackConfiguration deserialize(bindings.Message message) { 123 static AudioTrackConfiguration deserialize(bindings.Message message) {
114 var decoder = new bindings.Decoder(message); 124 var decoder = new bindings.Decoder(message);
115 var result = decode(decoder); 125 var result = decode(decoder);
116 if (decoder.excessHandles != null) { 126 if (decoder.excessHandles != null) {
117 decoder.excessHandles.forEach((h) => h.close()); 127 decoder.excessHandles.forEach((h) => h.close());
118 } 128 }
119 return result; 129 return result;
120 } 130 }
121 131
122 static AudioTrackConfiguration decode(bindings.Decoder decoder0) { 132 static AudioTrackConfiguration decode(bindings.Decoder decoder0) {
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 } 211 }
202 212
203 213
204 class _AudioTrackDescribeParams extends bindings.Struct { 214 class _AudioTrackDescribeParams extends bindings.Struct {
205 static const List<bindings.StructDataHeader> kVersions = const [ 215 static const List<bindings.StructDataHeader> kVersions = const [
206 const bindings.StructDataHeader(8, 0) 216 const bindings.StructDataHeader(8, 0)
207 ]; 217 ];
208 218
209 _AudioTrackDescribeParams() : super(kVersions.last.size); 219 _AudioTrackDescribeParams() : super(kVersions.last.size);
210 220
221 _AudioTrackDescribeParams.init(
222 ) : super(kVersions.last.size);
223
211 static _AudioTrackDescribeParams deserialize(bindings.Message message) { 224 static _AudioTrackDescribeParams deserialize(bindings.Message message) {
212 var decoder = new bindings.Decoder(message); 225 var decoder = new bindings.Decoder(message);
213 var result = decode(decoder); 226 var result = decode(decoder);
214 if (decoder.excessHandles != null) { 227 if (decoder.excessHandles != null) {
215 decoder.excessHandles.forEach((h) => h.close()); 228 decoder.excessHandles.forEach((h) => h.close());
216 } 229 }
217 return result; 230 return result;
218 } 231 }
219 232
220 static _AudioTrackDescribeParams decode(bindings.Decoder decoder0) { 233 static _AudioTrackDescribeParams decode(bindings.Decoder decoder0) {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 273
261 274
262 class AudioTrackDescribeResponseParams extends bindings.Struct { 275 class AudioTrackDescribeResponseParams extends bindings.Struct {
263 static const List<bindings.StructDataHeader> kVersions = const [ 276 static const List<bindings.StructDataHeader> kVersions = const [
264 const bindings.StructDataHeader(16, 0) 277 const bindings.StructDataHeader(16, 0)
265 ]; 278 ];
266 AudioTrackDescriptor descriptor = null; 279 AudioTrackDescriptor descriptor = null;
267 280
268 AudioTrackDescribeResponseParams() : super(kVersions.last.size); 281 AudioTrackDescribeResponseParams() : super(kVersions.last.size);
269 282
283 AudioTrackDescribeResponseParams.init(
284 AudioTrackDescriptor this.descriptor
285 ) : super(kVersions.last.size);
286
270 static AudioTrackDescribeResponseParams deserialize(bindings.Message message) { 287 static AudioTrackDescribeResponseParams deserialize(bindings.Message message) {
271 var decoder = new bindings.Decoder(message); 288 var decoder = new bindings.Decoder(message);
272 var result = decode(decoder); 289 var result = decode(decoder);
273 if (decoder.excessHandles != null) { 290 if (decoder.excessHandles != null) {
274 decoder.excessHandles.forEach((h) => h.close()); 291 decoder.excessHandles.forEach((h) => h.close());
275 } 292 }
276 return result; 293 return result;
277 } 294 }
278 295
279 static AudioTrackDescribeResponseParams decode(bindings.Decoder decoder0) { 296 static AudioTrackDescribeResponseParams decode(bindings.Decoder decoder0) {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 351
335 class _AudioTrackConfigureParams extends bindings.Struct { 352 class _AudioTrackConfigureParams extends bindings.Struct {
336 static const List<bindings.StructDataHeader> kVersions = const [ 353 static const List<bindings.StructDataHeader> kVersions = const [
337 const bindings.StructDataHeader(24, 0) 354 const bindings.StructDataHeader(24, 0)
338 ]; 355 ];
339 AudioTrackConfiguration configuration = null; 356 AudioTrackConfiguration configuration = null;
340 media_transport_mojom.MediaConsumerInterfaceRequest pipe = null; 357 media_transport_mojom.MediaConsumerInterfaceRequest pipe = null;
341 358
342 _AudioTrackConfigureParams() : super(kVersions.last.size); 359 _AudioTrackConfigureParams() : super(kVersions.last.size);
343 360
361 _AudioTrackConfigureParams.init(
362 AudioTrackConfiguration this.configuration,
363 media_transport_mojom.MediaConsumerInterfaceRequest this.pipe
364 ) : super(kVersions.last.size);
365
344 static _AudioTrackConfigureParams deserialize(bindings.Message message) { 366 static _AudioTrackConfigureParams deserialize(bindings.Message message) {
345 var decoder = new bindings.Decoder(message); 367 var decoder = new bindings.Decoder(message);
346 var result = decode(decoder); 368 var result = decode(decoder);
347 if (decoder.excessHandles != null) { 369 if (decoder.excessHandles != null) {
348 decoder.excessHandles.forEach((h) => h.close()); 370 decoder.excessHandles.forEach((h) => h.close());
349 } 371 }
350 return result; 372 return result;
351 } 373 }
352 374
353 static _AudioTrackConfigureParams decode(bindings.Decoder decoder0) { 375 static _AudioTrackConfigureParams decode(bindings.Decoder decoder0) {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 440
419 441
420 class _AudioTrackGetTimelineControlSiteParams extends bindings.Struct { 442 class _AudioTrackGetTimelineControlSiteParams extends bindings.Struct {
421 static const List<bindings.StructDataHeader> kVersions = const [ 443 static const List<bindings.StructDataHeader> kVersions = const [
422 const bindings.StructDataHeader(16, 0) 444 const bindings.StructDataHeader(16, 0)
423 ]; 445 ];
424 timeline_controller_mojom.MediaTimelineControlSiteInterfaceRequest timelineCon trolSite = null; 446 timeline_controller_mojom.MediaTimelineControlSiteInterfaceRequest timelineCon trolSite = null;
425 447
426 _AudioTrackGetTimelineControlSiteParams() : super(kVersions.last.size); 448 _AudioTrackGetTimelineControlSiteParams() : super(kVersions.last.size);
427 449
450 _AudioTrackGetTimelineControlSiteParams.init(
451 timeline_controller_mojom.MediaTimelineControlSiteInterfaceRequest this.time lineControlSite
452 ) : super(kVersions.last.size);
453
428 static _AudioTrackGetTimelineControlSiteParams deserialize(bindings.Message me ssage) { 454 static _AudioTrackGetTimelineControlSiteParams deserialize(bindings.Message me ssage) {
429 var decoder = new bindings.Decoder(message); 455 var decoder = new bindings.Decoder(message);
430 var result = decode(decoder); 456 var result = decode(decoder);
431 if (decoder.excessHandles != null) { 457 if (decoder.excessHandles != null) {
432 decoder.excessHandles.forEach((h) => h.close()); 458 decoder.excessHandles.forEach((h) => h.close());
433 } 459 }
434 return result; 460 return result;
435 } 461 }
436 462
437 static _AudioTrackGetTimelineControlSiteParams decode(bindings.Decoder decoder 0) { 463 static _AudioTrackGetTimelineControlSiteParams decode(bindings.Decoder decoder 0) {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 515
490 516
491 class _AudioTrackSetGainParams extends bindings.Struct { 517 class _AudioTrackSetGainParams extends bindings.Struct {
492 static const List<bindings.StructDataHeader> kVersions = const [ 518 static const List<bindings.StructDataHeader> kVersions = const [
493 const bindings.StructDataHeader(16, 0) 519 const bindings.StructDataHeader(16, 0)
494 ]; 520 ];
495 double dbGain = 0.0; 521 double dbGain = 0.0;
496 522
497 _AudioTrackSetGainParams() : super(kVersions.last.size); 523 _AudioTrackSetGainParams() : super(kVersions.last.size);
498 524
525 _AudioTrackSetGainParams.init(
526 double this.dbGain
527 ) : super(kVersions.last.size);
528
499 static _AudioTrackSetGainParams deserialize(bindings.Message message) { 529 static _AudioTrackSetGainParams deserialize(bindings.Message message) {
500 var decoder = new bindings.Decoder(message); 530 var decoder = new bindings.Decoder(message);
501 var result = decode(decoder); 531 var result = decode(decoder);
502 if (decoder.excessHandles != null) { 532 if (decoder.excessHandles != null) {
503 decoder.excessHandles.forEach((h) => h.close()); 533 decoder.excessHandles.forEach((h) => h.close());
504 } 534 }
505 return result; 535 return result;
506 } 536 }
507 537
508 static _AudioTrackSetGainParams decode(bindings.Decoder decoder0) { 538 static _AudioTrackSetGainParams decode(bindings.Decoder decoder0) {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 return map; 588 return map;
559 } 589 }
560 } 590 }
561 591
562 const int _audioTrackMethodDescribeName = 0; 592 const int _audioTrackMethodDescribeName = 0;
563 const int _audioTrackMethodConfigureName = 1; 593 const int _audioTrackMethodConfigureName = 1;
564 const int _audioTrackMethodGetTimelineControlSiteName = 2; 594 const int _audioTrackMethodGetTimelineControlSiteName = 2;
565 const int _audioTrackMethodSetGainName = 3; 595 const int _audioTrackMethodSetGainName = 3;
566 596
567 class _AudioTrackServiceDescription implements service_describer.ServiceDescript ion { 597 class _AudioTrackServiceDescription implements service_describer.ServiceDescript ion {
568 dynamic getTopLevelInterface([Function responseFactory]) => 598 void getTopLevelInterface(Function responder) {
569 responseFactory(null); 599 responder(null);
600 }
570 601
571 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => 602 void getTypeDefinition(String typeKey, Function responder) {
572 responseFactory(null); 603 responder(null);
604 }
573 605
574 dynamic getAllTypeDefinitions([Function responseFactory]) => 606 void getAllTypeDefinitions(Function responder) {
575 responseFactory(null); 607 responder(null);
608 }
576 } 609 }
577 610
578 abstract class AudioTrack { 611 abstract class AudioTrack {
579 static const String serviceName = null; 612 static const String serviceName = null;
580 613
581 static service_describer.ServiceDescription _cachedServiceDescription; 614 static service_describer.ServiceDescription _cachedServiceDescription;
582 static service_describer.ServiceDescription get serviceDescription { 615 static service_describer.ServiceDescription get serviceDescription {
583 if (_cachedServiceDescription == null) { 616 if (_cachedServiceDescription == null) {
584 _cachedServiceDescription = new _AudioTrackServiceDescription(); 617 _cachedServiceDescription = new _AudioTrackServiceDescription();
585 } 618 }
586 return _cachedServiceDescription; 619 return _cachedServiceDescription;
587 } 620 }
588 621
589 static AudioTrackProxy connectToService( 622 static AudioTrackProxy connectToService(
590 bindings.ServiceConnector s, String url, [String serviceName]) { 623 bindings.ServiceConnector s, String url, [String serviceName]) {
591 AudioTrackProxy p = new AudioTrackProxy.unbound(); 624 AudioTrackProxy p = new AudioTrackProxy.unbound();
592 String name = serviceName ?? AudioTrack.serviceName; 625 String name = serviceName ?? AudioTrack.serviceName;
593 if ((name == null) || name.isEmpty) { 626 if ((name == null) || name.isEmpty) {
594 throw new core.MojoApiError( 627 throw new core.MojoApiError(
595 "If an interface has no ServiceName, then one must be provided."); 628 "If an interface has no ServiceName, then one must be provided.");
596 } 629 }
597 s.connectToService(url, p, name); 630 s.connectToService(url, p, name);
598 return p; 631 return p;
599 } 632 }
600 dynamic describe([Function responseFactory = null]); 633 void describe(void callback(AudioTrackDescriptor descriptor));
601 void configure(AudioTrackConfiguration configuration, media_transport_mojom.Me diaConsumerInterfaceRequest pipe); 634 void configure(AudioTrackConfiguration configuration, media_transport_mojom.Me diaConsumerInterfaceRequest pipe);
602 void getTimelineControlSite(timeline_controller_mojom.MediaTimelineControlSite InterfaceRequest timelineControlSite); 635 void getTimelineControlSite(timeline_controller_mojom.MediaTimelineControlSite InterfaceRequest timelineControlSite);
603 void setGain(double dbGain); 636 void setGain(double dbGain);
604 static const double kMutedGain = -160.0; 637 static const double kMutedGain = -160.0;
605 static const double kMaxGain = 20.0; 638 static const double kMaxGain = 20.0;
606 } 639 }
607 640
608 abstract class AudioTrackInterface 641 abstract class AudioTrackInterface
609 implements bindings.MojoInterface<AudioTrack>, 642 implements bindings.MojoInterface<AudioTrack>,
610 AudioTrack { 643 AudioTrack {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 678
646 void handleResponse(bindings.ServiceMessage message) { 679 void handleResponse(bindings.ServiceMessage message) {
647 switch (message.header.type) { 680 switch (message.header.type) {
648 case _audioTrackMethodDescribeName: 681 case _audioTrackMethodDescribeName:
649 var r = AudioTrackDescribeResponseParams.deserialize( 682 var r = AudioTrackDescribeResponseParams.deserialize(
650 message.payload); 683 message.payload);
651 if (!message.header.hasRequestId) { 684 if (!message.header.hasRequestId) {
652 proxyError("Expected a message with a valid request Id."); 685 proxyError("Expected a message with a valid request Id.");
653 return; 686 return;
654 } 687 }
655 Completer c = completerMap[message.header.requestId]; 688 Function callback = callbackMap[message.header.requestId];
656 if (c == null) { 689 if (callback == null) {
657 proxyError( 690 proxyError(
658 "Message had unknown request Id: ${message.header.requestId}"); 691 "Message had unknown request Id: ${message.header.requestId}");
659 return; 692 return;
660 } 693 }
661 completerMap.remove(message.header.requestId); 694 callbackMap.remove(message.header.requestId);
662 if (c.isCompleted) { 695 callback(r.descriptor );
663 proxyError("Response completer already completed");
664 return;
665 }
666 c.complete(r);
667 break; 696 break;
668 default: 697 default:
669 proxyError("Unexpected message type: ${message.header.type}"); 698 proxyError("Unexpected message type: ${message.header.type}");
670 close(immediate: true); 699 close(immediate: true);
671 break; 700 break;
672 } 701 }
673 } 702 }
674 703
675 @override 704 @override
676 String toString() { 705 String toString() {
(...skipping 24 matching lines...) Expand all
701 return newMockedProxy; 730 return newMockedProxy;
702 } 731 }
703 732
704 static AudioTrackProxy newFromEndpoint( 733 static AudioTrackProxy newFromEndpoint(
705 core.MojoMessagePipeEndpoint endpoint) { 734 core.MojoMessagePipeEndpoint endpoint) {
706 assert(endpoint.setDescription("For AudioTrackProxy")); 735 assert(endpoint.setDescription("For AudioTrackProxy"));
707 return new AudioTrackProxy.fromEndpoint(endpoint); 736 return new AudioTrackProxy.fromEndpoint(endpoint);
708 } 737 }
709 738
710 739
711 dynamic describe([Function responseFactory = null]) { 740 void describe(void callback(AudioTrackDescriptor descriptor)) {
712 if (impl != null) { 741 if (impl != null) {
713 return new Future(() => impl.describe(_AudioTrackStubControl._audioTrackDe scribeResponseParamsFactory)); 742 impl.describe(callback);
743 return;
714 } 744 }
715 var params = new _AudioTrackDescribeParams(); 745 var params = new _AudioTrackDescribeParams();
716 return ctrl.sendMessageWithRequestId( 746 ctrl.sendMessageWithRequestId(
717 params, 747 params,
718 _audioTrackMethodDescribeName, 748 _audioTrackMethodDescribeName,
719 -1, 749 -1,
720 bindings.MessageHeader.kMessageExpectsResponse); 750 bindings.MessageHeader.kMessageExpectsResponse,
751 callback);
721 } 752 }
722 void configure(AudioTrackConfiguration configuration, media_transport_mojom.Me diaConsumerInterfaceRequest pipe) { 753 void configure(AudioTrackConfiguration configuration, media_transport_mojom.Me diaConsumerInterfaceRequest pipe) {
723 if (impl != null) { 754 if (impl != null) {
724 impl.configure(configuration, pipe); 755 impl.configure(configuration, pipe);
725 return; 756 return;
726 } 757 }
727 if (!ctrl.isBound) { 758 if (!ctrl.isBound) {
728 ctrl.proxyError("The Proxy is closed."); 759 ctrl.proxyError("The Proxy is closed.");
729 return; 760 return;
730 } 761 }
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 core.MojoHandle handle, [AudioTrack impl]) 810 core.MojoHandle handle, [AudioTrack impl])
780 : super.fromHandle(handle, autoBegin: impl != null) { 811 : super.fromHandle(handle, autoBegin: impl != null) {
781 _impl = impl; 812 _impl = impl;
782 } 813 }
783 814
784 _AudioTrackStubControl.unbound([this._impl]) : super.unbound(); 815 _AudioTrackStubControl.unbound([this._impl]) : super.unbound();
785 816
786 String get serviceName => AudioTrack.serviceName; 817 String get serviceName => AudioTrack.serviceName;
787 818
788 819
789 static AudioTrackDescribeResponseParams _audioTrackDescribeResponseParamsFacto ry(AudioTrackDescriptor descriptor) { 820 Function _audioTrackDescribeResponseParamsResponder(
790 var result = new AudioTrackDescribeResponseParams(); 821 int requestId) {
791 result.descriptor = descriptor; 822 return (AudioTrackDescriptor descriptor) {
792 return result; 823 var result = new AudioTrackDescribeResponseParams();
824 result.descriptor = descriptor;
825 sendResponse(buildResponseWithId(
826 result,
827 _audioTrackMethodDescribeName,
828 requestId,
829 bindings.MessageHeader.kMessageIsResponse));
830 };
793 } 831 }
794 832
795 dynamic handleMessage(bindings.ServiceMessage message) { 833 void handleMessage(bindings.ServiceMessage message) {
796 if (bindings.ControlMessageHandler.isControlMessage(message)) { 834 if (bindings.ControlMessageHandler.isControlMessage(message)) {
797 return bindings.ControlMessageHandler.handleMessage(this, 835 bindings.ControlMessageHandler.handleMessage(
798 0, 836 this, 0, message);
799 message); 837 return;
800 } 838 }
801 if (_impl == null) { 839 if (_impl == null) {
802 throw new core.MojoApiError("$this has no implementation set"); 840 throw new core.MojoApiError("$this has no implementation set");
803 } 841 }
804 switch (message.header.type) { 842 switch (message.header.type) {
805 case _audioTrackMethodDescribeName: 843 case _audioTrackMethodDescribeName:
806 var response = _impl.describe(_audioTrackDescribeResponseParamsFactory); 844 _impl.describe(_audioTrackDescribeResponseParamsResponder(message.header .requestId));
807 if (response is Future) {
808 return response.then((response) {
809 if (response != null) {
810 return buildResponseWithId(
811 response,
812 _audioTrackMethodDescribeName,
813 message.header.requestId,
814 bindings.MessageHeader.kMessageIsResponse);
815 }
816 });
817 } else if (response != null) {
818 return buildResponseWithId(
819 response,
820 _audioTrackMethodDescribeName,
821 message.header.requestId,
822 bindings.MessageHeader.kMessageIsResponse);
823 }
824 break; 845 break;
825 case _audioTrackMethodConfigureName: 846 case _audioTrackMethodConfigureName:
826 var params = _AudioTrackConfigureParams.deserialize( 847 var params = _AudioTrackConfigureParams.deserialize(
827 message.payload); 848 message.payload);
828 _impl.configure(params.configuration, params.pipe); 849 _impl.configure(params.configuration, params.pipe);
829 break; 850 break;
830 case _audioTrackMethodGetTimelineControlSiteName: 851 case _audioTrackMethodGetTimelineControlSiteName:
831 var params = _AudioTrackGetTimelineControlSiteParams.deserialize( 852 var params = _AudioTrackGetTimelineControlSiteParams.deserialize(
832 message.payload); 853 message.payload);
833 _impl.getTimelineControlSite(params.timelineControlSite); 854 _impl.getTimelineControlSite(params.timelineControlSite);
834 break; 855 break;
835 case _audioTrackMethodSetGainName: 856 case _audioTrackMethodSetGainName:
836 var params = _AudioTrackSetGainParams.deserialize( 857 var params = _AudioTrackSetGainParams.deserialize(
837 message.payload); 858 message.payload);
838 _impl.setGain(params.dbGain); 859 _impl.setGain(params.dbGain);
839 break; 860 break;
840 default: 861 default:
841 throw new bindings.MojoCodecError("Unexpected message name"); 862 throw new bindings.MojoCodecError("Unexpected message name");
842 break; 863 break;
843 } 864 }
844 return null;
845 } 865 }
846 866
847 AudioTrack get impl => _impl; 867 AudioTrack get impl => _impl;
848 set impl(AudioTrack d) { 868 set impl(AudioTrack d) {
849 if (d == null) { 869 if (d == null) {
850 throw new core.MojoApiError("$this: Cannot set a null implementation"); 870 throw new core.MojoApiError("$this: Cannot set a null implementation");
851 } 871 }
852 if (isBound && (_impl == null)) { 872 if (isBound && (_impl == null)) {
853 beginHandlingEvents(); 873 beginHandlingEvents();
854 } 874 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
888 core.MojoHandle handle, [AudioTrack impl]) 908 core.MojoHandle handle, [AudioTrack impl])
889 : super(new _AudioTrackStubControl.fromHandle(handle, impl)); 909 : super(new _AudioTrackStubControl.fromHandle(handle, impl));
890 910
891 static AudioTrackStub newFromEndpoint( 911 static AudioTrackStub newFromEndpoint(
892 core.MojoMessagePipeEndpoint endpoint) { 912 core.MojoMessagePipeEndpoint endpoint) {
893 assert(endpoint.setDescription("For AudioTrackStub")); 913 assert(endpoint.setDescription("For AudioTrackStub"));
894 return new AudioTrackStub.fromEndpoint(endpoint); 914 return new AudioTrackStub.fromEndpoint(endpoint);
895 } 915 }
896 916
897 917
898 dynamic describe([Function responseFactory = null]) { 918 void describe(void callback(AudioTrackDescriptor descriptor)) {
899 return impl.describe(responseFactory); 919 return impl.describe(callback);
900 } 920 }
901 void configure(AudioTrackConfiguration configuration, media_transport_mojom.Me diaConsumerInterfaceRequest pipe) { 921 void configure(AudioTrackConfiguration configuration, media_transport_mojom.Me diaConsumerInterfaceRequest pipe) {
902 return impl.configure(configuration, pipe); 922 return impl.configure(configuration, pipe);
903 } 923 }
904 void getTimelineControlSite(timeline_controller_mojom.MediaTimelineControlSite InterfaceRequest timelineControlSite) { 924 void getTimelineControlSite(timeline_controller_mojom.MediaTimelineControlSite InterfaceRequest timelineControlSite) {
905 return impl.getTimelineControlSite(timelineControlSite); 925 return impl.getTimelineControlSite(timelineControlSite);
906 } 926 }
907 void setGain(double dbGain) { 927 void setGain(double dbGain) {
908 return impl.setGain(dbGain); 928 return impl.setGain(dbGain);
909 } 929 }
910 } 930 }
911 931
912 932
913 933
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698