Changeset 5950:7fe8f5df7a83 in roaraudio for roarclients/roarmon.c


Ignore:
Timestamp:
10/20/13 13:52:15 (11 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

code cleanup and again a patch for checking commandlion parameters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roarclients/roarmon.c

    r5823 r5950  
    8484 
    8585  if ( !strcmp(k, "--server") || !strcmp(k, "-s") ) { 
     86   ROAR_CKHAVEARGS(1); 
    8687   server = argv[++i]; 
    8788  } else if ( !strcmp(k, "--rate") || !strcmp(k, "-r") || !strcmp(k, "-R") ) { 
     89   ROAR_CKHAVEARGS(1); 
    8890   info.rate = roar_str2rate(argv[++i]); 
    8991  } else if ( !strcmp(k, "--bits") || !strcmp(k, "-B") ) { 
     92   ROAR_CKHAVEARGS(1); 
    9093   info.bits = roar_str2bits(argv[++i]); 
    9194  } else if ( !strcmp(k, "-b") ) { 
    9295   info.bits = 8; 
    9396  } else if ( !strcmp(k, "--channels") || !strcmp(k, "--chans") || !strcmp(k, "-C") ) { 
     97   ROAR_CKHAVEARGS(1); 
    9498   info.channels = roar_str2channels(argv[++i]); 
    9599  } else if ( !strcmp(k, "-m") ) { 
    96100   info.channels = 1; 
    97101  } else if ( !strcmp(k, "--codec") || !strcmp(k, "-E") ) { 
     102   ROAR_CKHAVEARGS(1); 
    98103   if ( (info.codec = roar_str2codec(argv[++i])) == ROAR_AUDIO_INFO_INVALID ) { 
    99104    fprintf(stderr, "Error: Unknown codec: %s\n", argv[i]); 
     
    102107 
    103108  } else if ( !strcmp(k, "--aiprofile") ) { 
     109   ROAR_CKHAVEARGS(1); 
    104110   if ( roar_profile2info(&info, argv[++i]) == -1 ) { 
    105111    fprintf(stderr, "Error: Can not load audio profile: %s: %s\n", argv[i], roar_error2str(roar_error)); 
     
    124130   dir   = ROAR_DIR_THRU; 
    125131  } else if ( !strcmp(k, "--rel-id") ) { 
     132   ROAR_CKHAVEARGS(1); 
    126133   rel_id = atoi(argv[++i]); 
    127134 
Note: See TracChangeset for help on using the changeset viewer.