Changeset 3091:9da1d1d068c8 in roaraudio


Ignore:
Timestamp:
01/09/10 11:44:29 (14 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

updated help, added --pc and --chans

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roarclients/roarvumeter.c

    r3028 r3091  
    3232#define BUFSIZE 1024 
    3333 
     34#define LOWPASS_ORDER  6 
     35 
    3436#define MODE_NONE  0x00 
    3537#define MODE_PC    0x01 
     
    4648        "  --bits    BITS     - Set bits per sample\n" 
    4749        "  --chans   CHANNELS - Set number of channels\n" 
    48         "  --samples SAMPLES  - Set number of samples\n" 
    49         "  --help             - Show this help\n" 
     50        "  --samples SAMPLES  - Set number of input samples per block\n" 
     51        "  --pc               - Use percent scale\n" 
     52        "  --db               - Use dB scale\n" 
     53        "  --beat             - Enable beat detection\n" 
     54        "  --lowpass FREQ     - Use lowpass to filter input (-%idB/dec)\n" 
     55        "  --help             - Show this help\n", 
     56        LOWPASS_ORDER * 20 
    5057       ); 
    5158 
     
    173180  } else if ( strcmp(k, "--bits") == 0 ) { 
    174181   bits = atoi(argv[++i]); 
    175   } else if ( strcmp(k, "--channels") == 0 ) { 
     182  } else if ( strcmp(k, "--channels") == 0 || strcmp(k, "--chans") == 0) { 
    176183   channels = atoi(argv[++i]); 
    177184  } else if ( strcmp(k, "--samples") == 0 ) { 
    178185   samples = atoi(argv[++i]); 
    179186  } else if ( strcmp(k, "--db") == 0 ) { 
     187   mode |= MODE_PC; 
     188   mode -= MODE_PC; 
    180189   mode |= MODE_DB; 
     190  } else if ( strcmp(k, "--pc") == 0 ) { 
     191   mode |= MODE_DB; 
     192   mode -= MODE_DB; 
     193   mode |= MODE_PC; 
    181194  } else if ( strcmp(k, "--beat") == 0 ) { 
    182195   mode |= MODE_BEAT; 
     
    222235 
    223236 if ( lowpass_freq > 1 ) { 
    224   for (i = 0; i < 6; i++) { 
     237  for (i = 0; i < LOWPASS_ORDER; i++) { 
    225238   if ( roardsp_filter_new(&filter, &s, ROARDSP_FILTER_LOWP) == -1 ) { 
    226239    fprintf(stderr, "Error: can not open lowpass\n"); 
Note: See TracChangeset for help on using the changeset viewer.