Changeset 3630:89a9079f8e3f in roaraudio
- Timestamp:
- 03/08/10 02:23:23 (14 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
include/libroar/stream.h
r3538 r3630 76 76 #define ROAR_STREAMSTATE_CLOSING 4 77 77 78 // PA currently defines: video, music, game, event, phone, animation, production, a11y 79 // RA includes : YES YES YES YES YES NO NO NO 80 81 #define ROAR_ROLE_UNKNOWN -1 82 #define ROAR_ROLE_NONE 0 83 #define ROAR_ROLE_MUSIC 1 84 #define ROAR_ROLE_VIDEO 2 85 #define ROAR_ROLE_GAME 3 86 #define ROAR_ROLE_EVENT 4 87 #define ROAR_ROLE_BEEP 5 88 #define ROAR_ROLE_PHONE 6 89 #define ROAR_ROLE_BACKGROUND_MUSIC 7 90 78 91 struct roar_stream_info { 79 92 int block_size; … … 86 99 int state; 87 100 int mixer; 101 int role; 88 102 }; 89 103 … … 134 148 char * roar_streamstate2str(int streamstate); 135 149 150 int roar_str2role (char * role); 151 char * roar_role2str (int role); 152 136 153 #endif 137 154 -
libroar/stream.c
r3540 r3630 394 394 memset(info, 0, sizeof(struct roar_stream_info)); 395 395 info->mixer = -1; 396 info->role = ROAR_ROLE_UNKNOWN; 396 397 397 398 info->block_size = data[2]; … … 419 420 } else { 420 421 info->mixer = data[10]; 422 } 423 424 if ( m.datalen < 12*2 ) { 425 return 0; 426 } else { 427 info->role = data[11]; 421 428 } 422 429 … … 858 865 } 859 866 867 struct { 868 int role; 869 char * name; 870 } _libroar_role[] = { 871 {ROAR_ROLE_UNKNOWN, "unknown" }, 872 {ROAR_ROLE_NONE, "none" }, 873 {ROAR_ROLE_MUSIC, "music" }, 874 {ROAR_ROLE_VIDEO, "video" }, 875 {ROAR_ROLE_GAME, "game" }, 876 {ROAR_ROLE_EVENT, "event" }, 877 {ROAR_ROLE_BEEP, "beep" }, 878 {ROAR_ROLE_PHONE, "phone" }, 879 {ROAR_ROLE_BACKGROUND_MUSIC, "background music"}, 880 {ROAR_ROLE_BACKGROUND_MUSIC, "background_music"}, // alias 881 {-1, NULL} 882 }; 883 884 int roar_str2role (char * role) { 885 int i; 886 887 for (i = 0; _libroar_role[i].name != NULL; i++) 888 if ( !strcasecmp(_libroar_role[i].name, role) ) 889 return _libroar_role[i].role; 890 891 return ROAR_ROLE_UNKNOWN; 892 } 893 894 char * roar_role2str (int role) { 895 int i; 896 897 for (i = 0; _libroar_role[i].name != NULL; i++) 898 if ( _libroar_role[i].role == role ) 899 return _libroar_role[i].name; 900 901 return "unknown"; 902 } 903 860 904 //ll -
roarclients/roarctl.c
r3560 r3630 384 384 printf("Stream state : %s\n", roar_streamstate2str(info.state)); 385 385 386 if ( g_verbose > 1 ) 387 printf("Stream role : %s\n", roar_role2str(info.role)); 388 386 389 *flags = 0; 387 390 if ( info.flags & ROAR_FLAG_PRIMARY ) -
roard/beep.c
r3582 r3630 165 165 } 166 166 167 if ( streams_set_role(stream, ROAR_ROLE_BEEP) == -1 ) { 168 streams_delete(stream); 169 return -1; 170 } 171 167 172 if ( (buf = beep_fill_buffer(beep, &(s->info))) == NULL ) { 168 173 streams_delete(stream); -
roard/include/streams.h
r3542 r3630 91 91 int mixer_stream; 92 92 struct roardsp_chanmap chanmap; 93 int role; 93 94 } * g_streams[ROAR_STREAMS_MAX]; 94 95 … … 110 111 int streams_set_mixer_stream(int id, int mixer); 111 112 int streams_get_mixer_stream(int id, int mixer); 113 114 int streams_set_role (int id, int role); 112 115 113 116 int streams_get_subsys (int id); -
roard/req.c
r3575 r3630 596 596 audio_info = &(s->info); 597 597 598 mes->datalen = 2*1 1;598 mes->datalen = 2*12; 599 599 600 600 d[ 2] = ROAR_OUTPUT_CALC_OUTBUFSIZE(audio_info); … … 607 607 d[ 9] = (ss->flags & 0xFFFF0000) >> 16; 608 608 d[10] = ss->mixer_stream; 609 d[11] = ss->role; 609 610 610 611 ROAR_DBG("req_on_get_stream_para(*): ss->driver_id=%i", ss->driver_id); -
roard/streams.c
r3557 r3630 107 107 s->prethru = NULL; 108 108 s->mixer_stream = -1; 109 s->role = ROAR_ROLE_UNKNOWN; 109 110 110 111 s->mixer.scale = 65535; … … 376 377 } 377 378 379 int streams_set_role (int id, int role) { 380 struct roar_stream_server * ss; 381 382 _CHECK_SID(id); 383 384 if ( (ss = g_streams[id]) == NULL ) 385 return -1; 386 387 ss->role = role; 388 389 return 0; 390 } 391 378 392 int streams_get_subsys (int id) { 379 393 struct roar_stream_server * ss;
Note: See TracChangeset
for help on using the changeset viewer.