Changeset 5533:42f48072307c in roaraudio for roarclients/roarshout.c
- Timestamp:
- 06/12/12 14:39:40 (12 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
roarclients/roarshout.c
r5381 r5533 37 37 38 38 printf(" --server SERVER - Set server hostname\n" 39 " --rate RATE - Set sample rate\n" 40 " --bits BITS - Set bits per sample\n" 41 " --chans CHANNELS - Set number of channels\n" 42 " --codec CODEC - Set the codec\n" 39 " -R --rate RATE - Set sample rate\n" 40 " -B --bits BITS - Set bits per sample\n" 41 " -C --chans CHANNELS - Set number of channels\n" 42 " -E --codec CODEC - Set the codec\n" 43 " --aiprofile PROFILE\n" 44 " - Set audio profile\n" 43 45 " -h --help - Show this help\n" 44 46 " --pw-arg - Password is supplied as argument (default).\n" … … 90 92 int main (int argc, char * argv[]) { 91 93 enum { ARG, ASK, DSTR } pw_source = ARG; 92 int rate = 44100; 93 int bits = 16; 94 int channels = 2; 95 int codec = ROAR_CODEC_OGG_VORBIS; 94 struct roar_audio_info info; 96 95 char * server = NULL; 97 96 char * k; … … 113 112 char password_buf[128]; 114 113 114 if ( roar_profile2info(&info, "default") == -1 ) 115 return 1; 116 117 info.codec = ROAR_CODEC_OGG_VORBIS; 118 115 119 for (i = 1; i < argc; i++) { 116 120 k = argv[i]; … … 118 122 if ( strcmp(k, "--server") == 0 ) { 119 123 server = argv[++i]; 120 } else if ( strcmp(k, "--rate") == 0 ) { 121 rate = roar_str2rate(argv[++i]); 122 } else if ( strcmp(k, "--bits") == 0 ) { 123 bits = roar_str2bits(argv[++i]); 124 } else if ( strcmp(k, "--channels") == 0 || strcmp(k, "--chans") == 0 ) { 125 channels = roar_str2channels(argv[++i]); 126 } else if ( strcmp(k, "--codec") == 0 ) { 127 codec = roar_str2codec(argv[++i]); 124 } else if ( strcmp(k, "--rate") == 0 || strcmp(k, "-R") == 0 ) { 125 info.rate = roar_str2rate(argv[++i]); 126 } else if ( strcmp(k, "--bits") == 0 || strcmp(k, "-B") == 0 ) { 127 info.bits = roar_str2bits(argv[++i]); 128 } else if ( strcmp(k, "--channels") == 0 || strcmp(k, "--chans") == 0 || strcmp(k, "-C") == 0 ) { 129 info.channels = roar_str2channels(argv[++i]); 130 } else if ( strcmp(k, "--codec") == 0 || strcmp(k, "-E") == 0 ) { 131 info.codec = roar_str2codec(argv[++i]); 132 } else if ( !strcmp(k, "--aiprofile") ) { 133 if ( roar_profile2info(&info, argv[++i]) == -1 ) { 134 fprintf(stderr, "Error: Can not load audio profile: %s: %s\n", argv[i], roar_error2str(roar_error)); 135 return 1; 136 } 128 137 } else if ( strcmp(k, "--pw-arg") == 0 ) { 129 138 pw_source = ARG; … … 254 263 shout_set_url(shout, s_url); 255 264 256 if ( (vss = roar_vs_new_simple(server, "roarshout", rate, channels, codec, bits, ROAR_DIR_MONITOR, &err)) == NULL ) { 265 if ( (vss = roar_vs_new_simple(server, "roarshout", 266 info.rate, info.channels, info.codec, info.bits, 267 ROAR_DIR_MONITOR, &err)) == NULL ) { 257 268 fprintf(stderr, "Error: can not start monitoring: %s\n", roar_vs_strerr(err)); 258 269 return 1;
Note: See TracChangeset
for help on using the changeset viewer.