1 /* 2 * Copyright 2002, Marcus Overhagen. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 6 #ifndef _DATA_EXCHANGE_H 7 #define _DATA_EXCHANGE_H 8 9 #include <string.h> 10 11 #include <MediaFormats.h> 12 #include <MediaNode.h> 13 #include <MediaAddOn.h> 14 #include <Messenger.h> 15 #include <Buffer.h> 16 #include <Entry.h> 17 18 namespace BPrivate { 19 namespace media { 20 namespace dataexchange { 21 22 struct reply_data; 23 struct request_data; 24 struct command_data; 25 26 // BMessage based data exchange with the media_server 27 status_t SendToServer(BMessage *msg); 28 status_t QueryServer(BMessage &request, BMessage &reply); 29 30 // Raw data based data exchange with the media_server 31 status_t SendToServer(int32 msgcode, command_data *msg, int size); 32 status_t QueryServer(int32 msgcode, request_data *request, int requestsize, reply_data *reply, int replysize); 33 34 // Raw data based data exchange with the media_addon_server 35 status_t SendToAddonServer(int32 msgcode, command_data *msg, int size); 36 status_t QueryAddonServer(int32 msgcode, request_data *request, int requestsize, reply_data *reply, int replysize); 37 38 // Raw data based data exchange with any (media node control-) port 39 status_t SendToPort(port_id sendport, int32 msgcode, command_data *msg, int size); 40 status_t QueryPort(port_id requestport, int32 msgcode, request_data *request, int requestsize, reply_data *reply, int replysize); 41 42 // The base struct used for all raw requests 43 struct request_data 44 { 45 port_id reply_port; 46 47 status_t SendReply(status_t result, reply_data *reply, int replysize) const; 48 }; 49 50 // The base struct used for all raw replys 51 struct reply_data 52 { 53 status_t result; 54 }; 55 56 // The base struct used for all raw commands (asynchronous, no answer) 57 struct command_data 58 { 59 // yes, it's empty ;) 60 }; 61 62 }; // dataexchange 63 }; // media 64 }; // BPrivate 65 66 using namespace BPrivate::media::dataexchange; 67 68 // BMessage based server communication 69 enum { 70 // BMediaRoster notification service 71 MEDIA_SERVER_REQUEST_NOTIFICATIONS = 1000, 72 MEDIA_SERVER_CANCEL_NOTIFICATIONS, 73 MEDIA_SERVER_SEND_NOTIFICATIONS, 74 75 MEDIA_SERVER_GET_FORMATS, 76 MEDIA_SERVER_MAKE_FORMAT_FOR, 77 78 MEDIA_SERVER_SYSTEM_BEEP_EVENT 79 }; 80 81 // Raw port based communication 82 enum { 83 ADDONSERVER_RESCAN_MEDIAADDON_FLAVORS = 0x50, 84 85 SERVER_MESSAGE_START = 0x100, 86 SERVER_REGISTER_APP, 87 SERVER_UNREGISTER_APP, 88 SERVER_GET_NODE, 89 SERVER_SET_NODE, 90 SERVER_PUBLISH_INPUTS, 91 SERVER_PUBLISH_OUTPUTS, 92 SERVER_NODE_ID_FOR, 93 SERVER_GET_LIVE_NODE_INFO, 94 SERVER_GET_LIVE_NODES, 95 SERVER_GET_NODE_FOR, 96 SERVER_RELEASE_NODE, 97 SERVER_REGISTER_NODE, 98 SERVER_UNREGISTER_NODE, 99 SERVER_GET_DORMANT_NODE_FOR, 100 SERVER_GET_INSTANCES_FOR, 101 SERVER_GET_SHARED_BUFFER_AREA, 102 SERVER_REGISTER_BUFFER, 103 SERVER_UNREGISTER_BUFFER, 104 SERVER_RESCAN_DEFAULTS, 105 SERVER_SET_NODE_CREATOR, 106 SERVER_CHANGE_ADDON_FLAVOR_INSTANCES_COUNT, 107 SERVER_REWINDTYPES, 108 SERVER_REWINDREFS, 109 SERVER_GETREFFOR, 110 SERVER_SETREFFOR, 111 SERVER_REMOVEREFFOR, 112 SERVER_REMOVEITEM, 113 SERVER_GET_FORMAT_FOR_DESCRIPTION, 114 SERVER_GET_DESCRIPTION_FOR_FORMAT, 115 SERVER_GET_READERS, 116 SERVER_GET_DECODER_FOR_FORMAT, 117 SERVER_MESSAGE_END, 118 NODE_MESSAGE_START = 0x200, 119 120 NODE_START, 121 NODE_STOP, 122 NODE_SEEK, 123 NODE_SET_RUN_MODE, 124 NODE_TIME_WARP, 125 NODE_PREROLL, 126 NODE_SET_TIMESOURCE, 127 NODE_GET_TIMESOURCE, 128 NODE_REQUEST_COMPLETED, 129 NODE_FINAL_RELEASE, 130 131 NODE_MESSAGE_END, 132 CONSUMER_MESSAGE_START = 0x300, 133 CONSUMER_GET_NEXT_INPUT, 134 CONSUMER_DISPOSE_INPUT_COOKIE, 135 CONSUMER_ACCEPT_FORMAT, 136 CONSUMER_CONNECTED, 137 CONSUMER_DISCONNECTED, 138 139 CONSUMER_BUFFER_RECEIVED, 140 CONSUMER_PRODUCER_DATA_STATUS, 141 CONSUMER_GET_LATENCY_FOR, 142 CONSUMER_FORMAT_CHANGED, 143 CONSUMER_SEEK_TAG_REQUESTED, 144 145 CONSUMER_MESSAGE_END, 146 PRODUCER_MESSAGE_START = 0x400, 147 PRODUCER_GET_NEXT_OUTPUT, 148 PRODUCER_DISPOSE_OUTPUT_COOKIE, 149 PRODUCER_FORMAT_PROPOSAL, 150 PRODUCER_PREPARE_TO_CONNECT, 151 PRODUCER_CONNECT, 152 PRODUCER_DISCONNECT, 153 154 PRODUCER_LATE_NOTICE_RECEIVED, 155 PRODUCER_LATENCY_CHANGED, 156 PRODUCER_ADDITIONAL_BUFFER_REQUESTED, 157 PRODUCER_VIDEO_CLIPPING_CHANGED, 158 PRODUCER_FORMAT_CHANGE_REQUESTED, 159 PRODUCER_SET_BUFFER_GROUP, 160 PRODUCER_GET_LATENCY, 161 PRODUCER_GET_INITIAL_LATENCY, 162 PRODUCER_FORMAT_SUGGESTION_REQUESTED, 163 PRODUCER_SET_PLAY_RATE, 164 PRODUCER_ENABLE_OUTPUT, 165 PRODUCER_SET_RUN_MODE_DELAY, 166 167 PRODUCER_MESSAGE_END, 168 FILEINTERFACE_MESSAGE_START = 0x500, 169 FILEINTERFACE_MESSAGE_END, 170 CONTROLLABLE_MESSAGE_START = 0x600, 171 CONTROLLABLE_GET_PARAMETER_WEB, 172 CONTROLLABLE_GET_PARAMETER_DATA, 173 CONTROLLABLE_SET_PARAMETER_DATA, 174 CONTROLLABLE_MESSAGE_END, 175 TIMESOURCE_MESSAGE_START = 0x700, 176 177 TIMESOURCE_OP, // datablock is a struct time_source_op_info 178 TIMESOURCE_ADD_SLAVE_NODE, 179 TIMESOURCE_REMOVE_SLAVE_NODE, 180 TIMESOURCE_GET_START_LATENCY, 181 182 TIMESOURCE_MESSAGE_END, 183 }; 184 185 186 /* We can't send an entry_ref through a port to another team, 187 * but we can assign it to an xfer_entry_ref and send this one, 188 * when we receive it we can assign it to a normal entry_ref 189 */ 190 struct xfer_entry_ref 191 { 192 public: 193 xfer_entry_ref() 194 { 195 device = -1; 196 directory = -1; 197 name[0] = 0; 198 } 199 operator entry_ref() const 200 { 201 entry_ref ref(device, directory, name); 202 return ref; 203 } 204 void operator=(const entry_ref &ref) 205 { 206 device = ref.device; 207 directory = ref.directory; 208 if(ref.name) 209 strcpy(name, ref.name); 210 else 211 name[0] = 0; 212 } 213 private: 214 dev_t device; 215 ino_t directory; 216 char name[B_FILE_NAME_LENGTH]; // == 256 bytes 217 }; 218 219 220 221 // used by SERVER_GET_NODE and SERVER_SET_NODE 222 enum node_type 223 { 224 VIDEO_INPUT, 225 AUDIO_INPUT, 226 VIDEO_OUTPUT, 227 AUDIO_MIXER, 228 AUDIO_OUTPUT, 229 AUDIO_OUTPUT_EX, 230 TIME_SOURCE, 231 SYSTEM_TIME_SOURCE 232 }; 233 234 // used by SERVER_PUBLISH_INPUTS and SERVER_PUBLISH_OUTPUTS 235 enum 236 { 237 MAX_OUTPUTS = 8, 238 MAX_INPUTS = 8, 239 }; 240 241 // used by SERVER_GET_LIVE_NODES 242 enum 243 { 244 MAX_LIVE_INFO = 16, 245 }; 246 247 // used by SERVER_GET_INSTANCES_FOR 248 enum 249 { 250 MAX_NODE_ID = 4000, 251 }; 252 253 // used by SERVER_GET_READERS 254 enum 255 { 256 MAX_READERS = 40, 257 }; 258 259 struct addonserver_instantiate_dormant_node_request : public request_data 260 { 261 media_addon_id addonid; 262 int32 flavorid; 263 team_id creator_team; 264 }; 265 266 struct addonserver_instantiate_dormant_node_reply : public reply_data 267 { 268 media_node node; 269 }; 270 271 struct server_set_node_request : public request_data 272 { 273 node_type type; 274 bool use_node; 275 media_node node; 276 bool use_dni; 277 dormant_node_info dni; 278 bool use_input; 279 media_input input; 280 }; 281 282 struct server_set_node_reply : public reply_data 283 { 284 }; 285 286 struct server_get_node_request : public request_data 287 { 288 node_type type; 289 team_id team; 290 }; 291 292 struct server_get_node_reply : public reply_data 293 { 294 media_node node; 295 296 // for AUDIO_OUTPUT_EX 297 char input_name[B_MEDIA_NAME_LENGTH]; 298 int32 input_id; 299 }; 300 301 struct producer_format_proposal_request : public request_data 302 { 303 media_source output; 304 media_format format; 305 }; 306 307 struct producer_format_proposal_reply : public reply_data 308 { 309 media_format format; 310 }; 311 312 struct producer_prepare_to_connect_request : public request_data 313 { 314 media_source source; 315 media_destination destination; 316 media_format format; 317 char name[B_MEDIA_NAME_LENGTH]; 318 }; 319 320 struct producer_prepare_to_connect_reply : public reply_data 321 { 322 media_format format; 323 media_source out_source; 324 char name[B_MEDIA_NAME_LENGTH]; 325 }; 326 327 struct producer_connect_request : public request_data 328 { 329 status_t error; 330 media_source source; 331 media_destination destination; 332 media_format format; 333 char name[B_MEDIA_NAME_LENGTH]; 334 }; 335 336 struct producer_connect_reply : public reply_data 337 { 338 char name[B_MEDIA_NAME_LENGTH]; 339 }; 340 341 struct producer_disconnect_request : public request_data 342 { 343 media_source source; 344 media_destination destination; 345 }; 346 347 struct producer_disconnect_reply : public reply_data 348 { 349 }; 350 351 struct producer_format_suggestion_requested_request : public request_data 352 { 353 media_type type; 354 int32 quality; 355 }; 356 357 struct producer_format_suggestion_requested_reply : public reply_data 358 { 359 media_format format; 360 }; 361 362 struct producer_set_play_rate_request : public request_data 363 { 364 int32 numer; 365 int32 denom; 366 }; 367 368 struct producer_set_play_rate_reply : public reply_data 369 { 370 }; 371 372 struct producer_get_initial_latency_request : public request_data 373 { 374 }; 375 376 struct producer_get_initial_latency_reply : public reply_data 377 { 378 bigtime_t initial_latency; 379 uint32 flags; 380 }; 381 382 struct producer_get_latency_request : public request_data 383 { 384 }; 385 386 struct producer_get_latency_reply : public reply_data 387 { 388 bigtime_t latency; 389 }; 390 391 struct producer_set_buffer_group_command : public command_data 392 { 393 media_source source; 394 media_destination destination; 395 void *user_data; 396 int32 change_tag; 397 int32 buffer_count; 398 media_buffer_id buffers[1]; 399 }; 400 401 struct producer_format_change_requested_command : public command_data 402 { 403 media_source source; 404 media_destination destination; 405 media_format format; 406 void *user_data; 407 int32 change_tag; 408 }; 409 410 struct producer_video_clipping_changed_command : public command_data 411 { 412 media_source source; 413 media_destination destination; 414 media_video_display_info display; 415 void *user_data; 416 int32 change_tag; 417 int32 short_count; 418 int16 shorts[1]; 419 }; 420 421 struct producer_additional_buffer_requested_command : public command_data 422 { 423 media_source source; 424 media_buffer_id prev_buffer; 425 bigtime_t prev_time; 426 bool has_seek_tag; 427 media_seek_tag prev_tag; 428 }; 429 430 struct producer_latency_changed_command : public command_data 431 { 432 media_source source; 433 media_destination destination; 434 bigtime_t latency; 435 uint32 flags; 436 }; 437 438 struct producer_enable_output_command : public command_data 439 { 440 media_source source; 441 media_destination destination; 442 bool enabled; 443 void *user_data; 444 int32 change_tag; 445 }; 446 447 struct producer_late_notice_received_command : public command_data 448 { 449 media_source source; 450 bigtime_t how_much; 451 bigtime_t performance_time; 452 }; 453 454 struct producer_set_run_mode_delay_command : public command_data 455 { 456 BMediaNode::run_mode mode; 457 bigtime_t delay; 458 }; 459 460 struct consumer_accept_format_request : public request_data 461 { 462 media_destination dest; 463 media_format format; 464 }; 465 466 struct consumer_accept_format_reply : public reply_data 467 { 468 media_format format; 469 }; 470 471 struct consumer_connected_request : public request_data 472 { 473 media_input input; 474 }; 475 476 struct consumer_connected_reply : public reply_data 477 { 478 media_input input; 479 }; 480 481 struct server_publish_inputs_request : public request_data 482 { 483 media_node node; 484 int32 count; 485 area_id area; // if count > MAX_INPUTS, inputs are in the area 486 // area is created in the library, and also deleted 487 // in the library after the reply has been received 488 media_input inputs[MAX_INPUTS]; 489 }; 490 491 struct server_publish_inputs_reply : public reply_data 492 { 493 }; 494 495 struct server_publish_outputs_request : public request_data 496 { 497 media_node node; 498 int32 count; 499 area_id area; // if count > MAX_OUTPUTS, outputs are in the area 500 // area is created in the library, and also deleted 501 // in the library after the reply has been received 502 media_output outputs[MAX_OUTPUTS]; 503 }; 504 505 struct server_publish_outputs_reply : public reply_data 506 { 507 }; 508 509 struct producer_get_next_output_request : public request_data 510 { 511 int32 cookie; 512 }; 513 514 struct producer_get_next_output_reply : public reply_data 515 { 516 int32 cookie; 517 media_output output; 518 }; 519 520 struct producer_dispose_output_cookie_request : public request_data 521 { 522 int32 cookie; 523 }; 524 525 struct producer_dispose_output_cookie_reply : public reply_data 526 { 527 }; 528 529 struct consumer_get_next_input_request : public request_data 530 { 531 int32 cookie; 532 }; 533 534 struct consumer_get_next_input_reply : public reply_data 535 { 536 int32 cookie; 537 media_input input; 538 }; 539 540 struct consumer_dispose_input_cookie_request : public request_data 541 { 542 int32 cookie; 543 }; 544 545 struct consumer_dispose_input_cookie_reply : public reply_data 546 { 547 }; 548 549 struct consumer_disconnected_request : public request_data 550 { 551 media_source source; 552 media_destination destination; 553 }; 554 555 struct consumer_disconnected_reply : public reply_data 556 { 557 }; 558 559 struct consumer_buffer_received_command : public command_data 560 { 561 media_buffer_id buffer; 562 media_header header; 563 }; 564 565 struct consumer_producer_data_status_command : public command_data 566 { 567 media_destination for_whom; 568 int32 status; 569 bigtime_t at_performance_time; 570 }; 571 572 struct consumer_get_latency_for_request : public request_data 573 { 574 media_destination for_whom; 575 }; 576 577 struct consumer_get_latency_for_reply : public reply_data 578 { 579 bigtime_t latency; 580 media_node_id timesource; 581 }; 582 583 struct consumer_format_changed_request : public request_data 584 { 585 media_source producer; 586 media_destination consumer; 587 int32 change_tag; 588 media_format format; 589 }; 590 591 struct consumer_format_changed_reply : public reply_data 592 { 593 }; 594 595 struct consumer_seek_tag_requested_request : public request_data 596 { 597 media_destination destination; 598 bigtime_t target_time; 599 uint32 flags; 600 }; 601 602 struct consumer_seek_tag_requested_reply : public reply_data 603 { 604 media_seek_tag seek_tag; 605 bigtime_t tagged_time; 606 uint32 flags; 607 }; 608 609 struct server_register_app_request : public request_data 610 { 611 team_id team; 612 BMessenger messenger; 613 }; 614 615 struct server_register_app_reply : public reply_data 616 { 617 }; 618 619 struct server_unregister_app_request : public request_data 620 { 621 team_id team; 622 }; 623 624 struct server_unregister_app_reply : public reply_data 625 { 626 }; 627 628 struct server_set_node_creator_request : public request_data 629 { 630 media_node_id node; 631 team_id creator; 632 }; 633 634 struct server_set_node_creator_reply : public reply_data 635 { 636 }; 637 638 struct server_change_addon_flavor_instances_count_request : public request_data 639 { 640 media_addon_id addonid; 641 int32 flavorid; 642 int32 delta; // must be +1 or -1 643 team_id team; 644 }; 645 646 struct server_change_addon_flavor_instances_count_reply : public reply_data 647 { 648 }; 649 650 struct server_register_node_request : public request_data 651 { 652 media_addon_id addon_id; 653 int32 addon_flavor_id; 654 char name[B_MEDIA_NAME_LENGTH]; 655 uint64 kinds; 656 port_id port; 657 team_id team; 658 }; 659 660 struct server_register_node_reply : public reply_data 661 { 662 media_node_id nodeid; 663 }; 664 665 struct server_unregister_node_request : public request_data 666 { 667 media_node_id nodeid; 668 team_id team; 669 }; 670 671 struct server_unregister_node_reply : public reply_data 672 { 673 media_addon_id addonid; 674 int32 flavorid; 675 }; 676 677 struct server_get_live_node_info_request : public request_data 678 { 679 media_node node; 680 }; 681 682 struct server_get_live_node_info_reply : public reply_data 683 { 684 live_node_info live_info; 685 }; 686 687 struct server_get_live_nodes_request : public request_data 688 { 689 int32 maxcount; 690 bool has_input; 691 bool has_output; 692 bool has_name; 693 media_format inputformat; 694 media_format outputformat; 695 char name[B_MEDIA_NAME_LENGTH + 1]; // 1 for a trailing "*" 696 uint64 require_kinds; 697 }; 698 699 struct server_get_live_nodes_reply : public reply_data 700 { 701 int32 count; 702 area_id area; // if count > MAX_LIVE_INFO, live_node_infos are in the area 703 // area is created in the server, but deleted in the library 704 live_node_info live_info[MAX_LIVE_INFO]; 705 }; 706 707 struct server_node_id_for_request : public request_data 708 { 709 port_id port; 710 }; 711 712 struct server_node_id_for_reply : public reply_data 713 { 714 media_node_id nodeid; 715 }; 716 717 struct server_get_node_for_request : public request_data 718 { 719 media_node_id nodeid; 720 team_id team; 721 }; 722 723 struct server_get_node_for_reply : public reply_data 724 { 725 media_node clone; 726 }; 727 728 struct server_release_node_request : public request_data 729 { 730 media_node node; 731 team_id team; 732 }; 733 734 struct server_release_node_reply : public reply_data 735 { 736 }; 737 738 struct server_get_dormant_node_for_request : public request_data 739 { 740 media_node node; 741 }; 742 743 struct server_get_dormant_node_for_reply : public reply_data 744 { 745 dormant_node_info node_info; 746 }; 747 748 struct server_get_instances_for_request : public request_data 749 { 750 int32 maxcount; 751 media_addon_id addon_id; 752 int32 addon_flavor_id; 753 }; 754 755 struct server_get_instances_for_reply : public reply_data 756 { 757 int32 count; 758 media_node_id node_id[MAX_NODE_ID]; // no area here, MAX_NODE_ID is really large 759 }; 760 761 struct server_rescan_defaults_command : public command_data 762 { 763 }; 764 765 struct addonserver_rescan_mediaaddon_flavors_command : public command_data 766 { 767 media_addon_id addonid; 768 }; 769 770 struct server_register_mediaaddon_request : public request_data 771 { 772 xfer_entry_ref ref; // a ref to the file 773 }; 774 775 struct server_register_mediaaddon_reply : public reply_data 776 { 777 media_addon_id addonid; 778 }; 779 780 struct server_unregister_mediaaddon_command : public command_data 781 { 782 media_addon_id addonid; 783 }; 784 785 struct server_get_mediaaddon_ref_request : public request_data 786 { 787 media_addon_id addonid; 788 }; 789 790 struct server_get_mediaaddon_ref_reply : public reply_data 791 { 792 xfer_entry_ref ref; // a ref to the file 793 }; 794 795 struct server_get_shared_buffer_area_request : public request_data 796 { 797 }; 798 799 struct server_get_shared_buffer_area_reply : public reply_data 800 { 801 area_id area; 802 }; 803 804 struct server_register_buffer_request : public request_data 805 { 806 team_id team; 807 //either info.buffer is != 0, or the area, size, offset is used 808 buffer_clone_info info; 809 }; 810 811 struct server_register_buffer_reply : public reply_data 812 { 813 buffer_clone_info info; 814 }; 815 816 struct server_unregister_buffer_command : public command_data 817 { 818 team_id team; 819 media_buffer_id bufferid; 820 }; 821 822 struct server_rewindtypes_request : public request_data 823 { 824 }; 825 826 struct server_rewindtypes_reply : public reply_data 827 { 828 int32 count; 829 area_id area; 830 }; 831 832 struct server_rewindrefs_request : public request_data 833 { 834 char type[B_MEDIA_NAME_LENGTH]; 835 }; 836 837 struct server_rewindrefs_reply : public reply_data 838 { 839 int32 count; 840 area_id area; 841 }; 842 843 struct server_getreffor_request : public request_data 844 { 845 char type[B_MEDIA_NAME_LENGTH]; 846 char item[B_MEDIA_NAME_LENGTH]; 847 }; 848 849 struct server_getreffor_reply : public reply_data 850 { 851 xfer_entry_ref ref; // a ref to the file 852 }; 853 854 struct server_setreffor_request : public request_data 855 { 856 char type[B_MEDIA_NAME_LENGTH]; 857 char item[B_MEDIA_NAME_LENGTH]; 858 xfer_entry_ref ref; // a ref to the file 859 }; 860 861 struct server_setreffor_reply : public reply_data 862 { 863 }; 864 865 struct server_removereffor_request : public request_data 866 { 867 char type[B_MEDIA_NAME_LENGTH]; 868 char item[B_MEDIA_NAME_LENGTH]; 869 xfer_entry_ref ref; // a ref to the file 870 }; 871 872 struct server_removereffor_reply : public reply_data 873 { 874 }; 875 876 struct server_removeitem_request : public request_data 877 { 878 char type[B_MEDIA_NAME_LENGTH]; 879 char item[B_MEDIA_NAME_LENGTH]; 880 }; 881 882 struct server_removeitem_reply : public reply_data 883 { 884 }; 885 886 struct server_get_decoder_for_format_request : public request_data 887 { 888 media_format format; 889 }; 890 891 struct server_get_decoder_for_format_reply : public reply_data 892 { 893 xfer_entry_ref ref; // a ref to the decoder 894 }; 895 896 struct server_get_readers_request : public request_data 897 { 898 }; 899 900 struct server_get_readers_reply : public reply_data 901 { 902 xfer_entry_ref ref[MAX_READERS]; // a list of refs to the reader 903 int32 count; 904 }; 905 906 struct node_request_completed_command : public command_data 907 { 908 media_request_info info; 909 }; 910 911 struct node_start_command : public command_data 912 { 913 bigtime_t performance_time; 914 }; 915 916 struct node_stop_command : public command_data 917 { 918 bigtime_t performance_time; 919 bool immediate; 920 }; 921 922 struct node_seek_command : public command_data 923 { 924 bigtime_t media_time; 925 bigtime_t performance_time; 926 }; 927 928 struct node_set_run_mode_command : public command_data 929 { 930 BMediaNode::run_mode mode; 931 }; 932 933 struct node_time_warp_command : public command_data 934 { 935 bigtime_t at_real_time; 936 bigtime_t to_performance_time; 937 }; 938 939 struct node_set_timesource_command : public command_data 940 { 941 media_node_id timesource_id; 942 }; 943 944 struct node_get_timesource_request : public request_data 945 { 946 }; 947 948 struct node_get_timesource_reply : public reply_data 949 { 950 media_node_id timesource_id; 951 }; 952 953 struct node_final_release_command : public command_data 954 { 955 }; 956 957 struct timesource_add_slave_node_command : public command_data 958 { 959 media_node node; 960 }; 961 962 struct timesource_remove_slave_node_command : public command_data 963 { 964 media_node node; 965 }; 966 967 struct timesource_get_start_latency_request : public request_data 968 { 969 }; 970 971 struct timesource_get_start_latency_reply : public reply_data 972 { 973 bigtime_t start_latency; 974 }; 975 976 struct controllable_get_parameter_web_request : public request_data 977 { 978 area_id area; 979 int32 maxsize; 980 }; 981 982 struct controllable_get_parameter_web_reply : public reply_data 983 { 984 type_code code; 985 int32 size; // = -1: parameter web data too large, = 0: no p.w., > 0: flattened p.w. data 986 }; 987 988 #define MAX_PARAMETER_DATA (B_MEDIA_MESSAGE_SIZE - 100) 989 990 struct controllable_get_parameter_data_request : public request_data 991 { 992 int32 parameter_id; 993 size_t requestsize; 994 area_id area; //if area != -1, data is too large and must be passed in the area 995 }; 996 997 struct controllable_get_parameter_data_reply : public reply_data 998 { 999 bigtime_t last_change; 1000 char rawdata[MAX_PARAMETER_DATA]; 1001 size_t size; 1002 }; 1003 1004 struct controllable_set_parameter_data_request : public request_data 1005 { 1006 int32 parameter_id; 1007 bigtime_t when; 1008 area_id area; //if area != -1, data is too large and is passed in the area 1009 size_t size; 1010 char rawdata[MAX_PARAMETER_DATA]; 1011 }; 1012 1013 struct controllable_set_parameter_data_reply : public reply_data 1014 { 1015 }; 1016 1017 1018 1019 enum { 1020 SYSTEM_BEEP_EVENT_INVOKE = 1, 1021 SYSTEM_BEEP_EVENT_ADD 1022 }; 1023 #endif // _DATA_EXCHANGE_H 1024