Changeset 4614:3b1ab4d465e8 in roaraudio
- Timestamp:
- 11/21/10 16:51:56 (13 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
ChangeLog
r4611 r4614 8 8 * Added RSound's new 32 bit support to libroarrsound 9 9 * Updated docs 10 * Support dir parameter in OINFO command (Closes: #31) 10 11 11 12 v. 0.4beta1 - Mon Nov 01 2010 16:14 CET -
include/libroar/ctl.h
r4384 r4614 47 47 int roar_terminate (struct roar_connection * con, int terminate); 48 48 int roar_server_oinfo (struct roar_connection * con, struct roar_stream * s); 49 int roar_server_oinfo2 (struct roar_connection * con, struct roar_stream * s, int dir); 49 50 50 51 -
libroar/ctl.c
r4385 r4614 56 56 } 57 57 58 int roar_server_oinfo (struct roar_connection * con, struct roar_stream * sa) { 58 int roar_server_oinfo (struct roar_connection * con, struct roar_stream * s) { 59 return roar_server_oinfo2(con, s, -1); 60 } 61 62 int roar_server_oinfo2 (struct roar_connection * con, struct roar_stream * s, int dir) { 59 63 struct roar_message mes; 60 64 … … 62 66 63 67 mes.cmd = ROAR_CMD_SERVER_OINFO; 64 mes.datalen = 0; 68 69 if ( dir == -1 ) { 70 mes.datalen = 0; 71 } else { 72 mes.datalen = 2; 73 mes.data[0] = 0; 74 mes.data[1] = dir; 75 } 65 76 66 77 if ( roar_req(con, &mes, NULL) == -1 ) … … 70 81 return -1; 71 82 72 if ( roar_stream_m2s(s a, &mes) == -1 )83 if ( roar_stream_m2s(s, &mes) == -1 ) 73 84 return -1; 74 85 -
roarclients/roarctl.c
r4603 r4614 116 116 " serverinfo - Gets general information about the server\n" 117 117 " serveroinfo - Gets Information about server output\n" 118 " serveroinfo2 DIR - Gets Information about server output for stream direction dir\n" 118 119 " serverstandards - Gets list of server supported standards\n" 119 120 " listclients - Gets Information about clients\n" … … 231 232 #undef _pm 232 233 233 void server_oinfo (struct roar_connection * con ) {234 void server_oinfo (struct roar_connection * con, int dir) { 234 235 struct roar_stream s; 235 236 236 if ( roar_server_oinfo (con, &s) == -1 ) {237 if ( roar_server_oinfo2(con, &s, dir) == -1 ) { 237 238 fprintf(stderr, "Error: can not get server output info\n"); 238 239 return; … … 1145 1146 server_info(&con); 1146 1147 } else if ( !strcmp(k, "serveroinfo") ) { 1147 server_oinfo(&con); 1148 server_oinfo(&con, -1); 1149 } else if ( !strcmp(k, "serveroinfo2") ) { 1150 t = roar_str2dir(argv[++i]); 1151 if ( t == -1 ) { 1152 fprintf(stderr, "Error: unknown stream direction: %s\n", argv[i]); 1153 } else { 1154 server_oinfo(&con, t); 1155 } 1148 1156 } else if ( !strcmp(k, "serverstandards") ) { 1149 1157 server_standards(&con); … … 1153 1161 list_streams(&con); 1154 1162 } else if ( !strcmp(k, "allinfo") ) { 1155 server_oinfo(&con );1163 server_oinfo(&con, -1); 1156 1164 printf("\n"); 1157 1165 list_clients(&con); -
roard/include/streams.h
r4552 r4614 136 136 int streams_set_role (int id, int role); 137 137 138 int streams_dir2subsys (int dir); 138 139 int streams_get_subsys (int id); 139 140 int streams_get_ssdir (int id); -
roard/req.c
r4552 r4614 624 624 int req_on_server_oinfo (int client, struct roar_message * mes, char ** data, uint32_t flags[2]) { 625 625 struct roar_stream s; 626 int dir = ROAR_DIR_PLAY; 627 int subsys; 626 628 //ROAR_DIR_OUTPUT 629 630 if ( mes->datalen != 0 ) { 631 if ( mes->datalen != 2 ) 632 return -1; 633 634 if ( mes->data[0] != 0 ) 635 return -1; 636 637 dir = mes->data[1]; 638 } 639 640 subsys = streams_dir2subsys(dir); 627 641 628 642 memset(&s, 0, sizeof(struct roar_stream)); … … 630 644 s.dir = ROAR_DIR_MIXING; 631 645 s.pos_rel_id = -1; 632 s.info.rate = g_sa->rate; 633 s.info.bits = g_sa->bits; 634 s.info.channels = g_sa->channels; 635 s.info.codec = g_sa->codec; 636 s.pos = g_pos; 646 647 switch (subsys) { 648 case ROAR_SUBSYS_WAVEFORM: 649 s.info.rate = g_sa->rate; 650 s.info.bits = g_sa->bits; 651 s.info.channels = g_sa->channels; 652 s.info.codec = g_sa->codec; 653 s.pos = g_pos; 654 break; 655 #ifndef ROAR_WITHOUT_DCOMP_MIDI 656 case ROAR_SUBSYS_MIDI: 657 break; 658 #endif 659 #ifndef ROAR_WITHOUT_DCOMP_LIGHT 660 case ROAR_SUBSYS_LIGHT: 661 s.info.rate = ROAR_OUTPUT_CFREQ; 662 s.info.bits = ROAR_LIGHT_BITS; 663 s.info.channels = g_light_state.channels; 664 break; 665 #endif 666 #ifndef ROAR_WITHOUT_DCOMP_RAW 667 case ROAR_SUBSYS_RAW: 668 // no need to set anything here. 669 break; 670 #endif 671 #ifndef ROAR_WITHOUT_DCOMP_RDTCS 672 case ROAR_SUBSYS_RDTCS: 673 s.info.rate = ROAR_OUTPUT_CFREQ; 674 s.info.bits = ROAR_RDTCS_BITS; 675 s.info.channels = ROAR_RDTCS_CHANNELS; 676 s.info.codec = ROAR_RDTCS_CODEC; 677 break; 678 #endif 679 default: 680 return -1; 681 break; 682 } 637 683 638 684 if ( roar_stream_s2m(&s, mes) == -1 ) -
roard/streams.c
r4553 r4614 447 447 return -1; 448 448 449 switch (ROAR_STREAM(ss)->dir) { 449 if ( ROAR_STREAM(ss)->dir == ROAR_DIR_THRU ) 450 return streams_get_subsys(ROAR_STREAM(ss)->pos_rel_id); 451 452 return streams_dir2subsys(ROAR_STREAM(ss)->dir); 453 } 454 455 int streams_dir2subsys (int dir) { 456 switch (dir) { 450 457 case ROAR_DIR_PLAY: 451 458 case ROAR_DIR_RECORD: … … 471 478 case ROAR_DIR_COMPLEX_OUT: 472 479 return ROAR_SUBSYS_COMPLEX; 473 break;474 case ROAR_DIR_THRU:475 return streams_get_subsys(ROAR_STREAM(ss)->pos_rel_id);476 480 break; 477 481 case ROAR_DIR_MIXING:
Note: See TracChangeset
for help on using the changeset viewer.