Changeset 4933:41edaa4019b1 in roaraudio


Ignore:
Timestamp:
05/08/11 23:09:44 (13 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added support to set a stream role

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roarclients/roarctl.c

    r4922 r4933  
    106106        "  protectflag ID FLAGS    - Protects flags on a stream. Those flags can not be\n" 
    107107        "                            changed anymore after the they got protected. See flag.\n" 
     108        "\n" 
     109        "  role ID ROLE            - Set role ROLE on stream ID.\n" 
    108110        "\n" 
    109111        "  kick TYPE ID            - Kicks object of TYPE with id ID\n" 
     
    964966} 
    965967 
     968int set_role (struct roar_connection * con, int id, int role) { 
     969 struct roar_stream s; 
     970 
     971 if ( id == -1 ) 
     972  return -1; 
     973 
     974 if ( roar_stream_new_by_id(&s, id) == -1 ) 
     975  return -1; 
     976 
     977 if ( roar_stream_set_role(con, &s, role) == -1 ) 
     978  return -1; 
     979 
     980 return 0; 
     981} 
     982 
    966983int show_aiprofile (const char * profile) { 
    967984 struct roar_audio_info info; 
     
    12081225   } 
    12091226   i++; 
     1227 
     1228  } else if ( !strcmp(k, "role") ) { 
     1229   i++; 
     1230   if ( set_role(&con, atoi(argv[i]), roar_str2role(argv[i+1])) == -1 ) { 
     1231    fprintf(stderr, "Error: can not set stream role\n"); 
     1232   } else { 
     1233    printf("flags protected\n"); 
     1234   } 
     1235   i++; 
     1236 
    12101237  } else if ( !strcmp(k, "metaset") ) { 
    12111238   i++; 
Note: See TracChangeset for help on using the changeset viewer.