Changeset 4552:47a0412f706d in roaraudio for roarclients


Ignore:
Timestamp:
10/25/10 14:03:43 (14 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

implemented flag toggling and flag protection

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roarclients/roarctl.c

    r4536 r4552  
    9797        "                            separated list of flags.\n" 
    9898        "  unflag ID FLAGS         - Unsets flags on a stream. See flag.\n" 
     99        "  toogleflag ID FLAGS     - Toggels flags on a stream. See flag.\n" 
     100        "  protectflag ID FLAGS    - Protects flags on a stream. Those flags can not be\n" 
     101        "                            changed anymore after the they got protected. See flag.\n" 
    99102        "\n" 
    100103        "  kick TYPE ID            - Kicks object of TYPE with id ID\n" 
     
    926929} 
    927930 
    928 int set_flags (struct roar_connection * con, int id, int reset, char * flags) { 
    929  int f = ROAR_FLAG_NONE; 
     931int set_flags (struct roar_connection * con, int id, int action, char * flags) { 
     932 uint32_t f = ROAR_FLAG_NONE; 
    930933 char * c; 
    931934 struct roar_stream s[1]; 
     
    976979 } 
    977980 
    978  return roar_stream_set_flags(con, s, f, reset); 
     981 return roar_stream_set_flags2(con, s, f, action); 
    979982} 
    980983 
     
    11911194   } 
    11921195   i++; 
     1196  } else if ( !strcmp(k, "toggleflag") ) { 
     1197   i++; 
     1198   if ( set_flags(&con, atoi(argv[i]), ROAR_TOGGLE_FLAG, argv[i+1]) == -1 ) { 
     1199    fprintf(stderr, "Error: can not toggle flags\n"); 
     1200   } else { 
     1201    printf("flags changed\n"); 
     1202   } 
     1203   i++; 
     1204  } else if ( !strcmp(k, "protectflag") ) { 
     1205   i++; 
     1206   if ( set_flags(&con, atoi(argv[i]), ROAR_NOOP_FLAG|ROAR_PROTECT_FLAG, argv[i+1]) == -1 ) { 
     1207    fprintf(stderr, "Error: can not protect flags\n"); 
     1208   } else { 
     1209    printf("flags protected\n"); 
     1210   } 
     1211   i++; 
    11931212  } else if ( !strcmp(k, "metaset") ) { 
    11941213   i++; 
Note: See TracChangeset for help on using the changeset viewer.