Changeset 5456:a854b4c5bf2a in roaraudio


Ignore:
Timestamp:
03/26/12 00:10:11 (10 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

add support for --role

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roarclients/roarcat.c

    r5381 r5456  
    4545        "  --rdtcs               - Use Radio Data and Transmitter Control System input\n" 
    4646        "  --rel-id ID           - Set ID of relative stream\n" 
     47        "  --role ROLE           - Set stream role\n" 
    4748        "  --help                - Show this help\n" 
    4849       ); 
     
    5758 int    dir      = ROAR_DIR_PLAY; 
    5859 int    rel_id   = -1; 
     60 int    role     = ROAR_ROLE_UNKNOWN; 
    5961 char * server   = NULL; 
    6062 char * k; 
     
    111113  } else if ( !strcmp(k, "--rel-id") ) { 
    112114   rel_id = atoi(argv[++i]); 
     115  } else if ( !strcmp(k, "--role") ) { 
     116   role = roar_str2role(argv[++i]); 
    113117 
    114118  } else if ( !strcmp(k, "--help") || !strcmp(k, "-h") ) { 
     
    193197 } 
    194198 
     199 if ( role != ROAR_ROLE_UNKNOWN ) { 
     200  if ( roar_stream_set_role(&con, &s, role) == -1 ) { 
     201   fprintf(stderr, "Warning: can not set stream role\n"); 
     202  } 
     203 } 
     204 
    195205 if ( roar_stream_exec(&con, &s) == -1 ) { 
    196206  fprintf(stderr, "Error: can not exec stream\n"); 
Note: See TracChangeset for help on using the changeset viewer.