Changeset 5950:7fe8f5df7a83 in roaraudio
- Timestamp:
- 10/20/13 13:52:15 (11 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
ChangeLog
r5949 r5950 3 3 (Closes: DEB#716264, DEB#716251, DEB#716245, DEB#716240) 4 4 * Marked roarcatvio as obsolete. Added all unique features to roarcatplay. 5 * Code cleanup. 5 6 6 7 v. 1.0beta10 - Tue Oct 15 2013 12:03 CEST -
doc/man1/roarcatplay.1
r5949 r5950 1 1 .\" roarcatplay.1: 2 2 3 .TH "roarcatplay" "1" " January 2010" "RoarAudio" "System User's Manual: roarcatplay"3 .TH "roarcatplay" "1" "October 2013" "RoarAudio" "System User's Manual: roarcatplay" 4 4 5 5 .SH NAME -
doc/man1/roarcatvio.1
r5949 r5950 1 1 .\" roarcatvio.1: 2 2 3 .TH "roarcatvio" "1" " January 2010" "RoarAudio" "System User's Manual: roarcatvio"3 .TH "roarcatvio" "1" "October 2013" "RoarAudio" "System User's Manual: roarcatvio" 4 4 5 5 .SH NAME -
doc/man1/roarfilt.1
r1625 r5950 1 1 .\" roard.1: 2 2 3 .TH "roarfilt" "1" " July 2008" "RoarAudio" "System Manager's Manual: roarfilt"3 .TH "roarfilt" "1" "October 2013" "RoarAudio" "System Manager's Manual: roarfilt" 4 4 5 5 .SH NAME … … 59 59 \fB--div n\fR 60 60 Divide volume by n. 61 62 .TP63 \fB--log n\fR64 Does a simple 'gamma correction'.65 This is done by:66 sample = 2^(bits-1) * log(1 + (n - 1)*sample/2^(bits-1)) / log(n).67 68 .TP69 \fB--lowpass freq\fR70 lowpass filter71 61 72 62 .SH "FILTER OPTIONS" -
roarclients/roarbidir.c
r5823 r5950 69 69 70 70 if ( strcmp(k, "--server") == 0 ) { 71 ROAR_CKHAVEARGS(1); 71 72 server = argv[++i]; 72 73 } else if ( strcmp(k, "--rate") == 0 || strcmp(k, "-R") == 0 ) { 74 ROAR_CKHAVEARGS(1); 73 75 info.rate = roar_str2rate(argv[++i]); 74 76 } else if ( strcmp(k, "--bits") == 0 || strcmp(k, "-B") == 0 ) { 77 ROAR_CKHAVEARGS(1); 75 78 info.bits = roar_str2bits(argv[++i]); 76 79 } else if ( strcmp(k, "--channels") == 0 || strcmp(k, "--chans") == 0 || strcmp(k, "-C") == 0 ) { 80 ROAR_CKHAVEARGS(1); 77 81 info.channels = roar_str2channels(argv[++i]); 78 82 } else if ( strcmp(k, "--codec") == 0 || strcmp(k, "-E") == 0 ) { 83 ROAR_CKHAVEARGS(1); 79 84 info.codec = roar_str2codec(argv[++i]); 80 85 } else if ( !strcmp(k, "--aiprofile") ) { 86 ROAR_CKHAVEARGS(1); 81 87 if ( roar_profile2info(&info, argv[++i]) == -1 ) { 82 88 fprintf(stderr, "Error: Can not load audio profile: %s: %s\n", argv[i], roar_error2str(roar_error)); -
roarclients/roarcat.c
r5823 r5950 82 82 83 83 if ( !strcmp(k, "--server") || !strcmp(k, "-s") ) { 84 ROAR_CKHAVEARGS(1); 84 85 server = argv[++i]; 85 86 } else if ( !strcmp(k, "-n") ) { 87 ROAR_CKHAVEARGS(1); 86 88 name = argv[++i]; 87 89 } else if ( !strcmp(k, "--rate") || !strcmp(k, "-r") || !strcmp(k, "-R") ) { 90 ROAR_CKHAVEARGS(1); 88 91 info.rate = roar_str2rate(argv[++i]); 89 92 } else if ( !strcmp(k, "--bits") || !strcmp(k, "-B") ) { 93 ROAR_CKHAVEARGS(1); 90 94 info.bits = roar_str2bits(argv[++i]); 91 95 } else if ( !strcmp(k, "-b") ) { 92 96 info.bits = 8; 93 97 } else if ( !strcmp(k, "--channels") || !strcmp(k, "--chans") || !strcmp(k, "-C") ) { 98 ROAR_CKHAVEARGS(1); 94 99 info.channels = roar_str2channels(argv[++i]); 95 100 } else if ( !strcmp(k, "-m") ) { 96 101 info.channels = 1; 97 102 } else if ( !strcmp(k, "--codec") || !strcmp(k, "-E") ) { 103 ROAR_CKHAVEARGS(1); 98 104 if ( (info.codec = roar_str2codec(argv[++i])) == ROAR_AUDIO_INFO_INVALID ) { 99 105 fprintf(stderr, "Error: Unknown codec: %s\n", argv[i]); … … 101 107 } 102 108 } else if ( !strcmp(k, "--aiprofile") ) { 109 ROAR_CKHAVEARGS(1); 103 110 if ( roar_profile2info(&info, argv[++i]) == -1 ) { 104 111 fprintf(stderr, "Error: Can not load audio profile: %s: %s\n", argv[i], roar_error2str(roar_error)); … … 120 127 121 128 } else if ( !strcmp(k, "--rel-id") ) { 129 ROAR_CKHAVEARGS(1); 122 130 rel_id = atoi(argv[++i]); 123 131 } else if ( !strcmp(k, "--role") ) { 132 ROAR_CKHAVEARGS(1); 124 133 role = roar_str2role(argv[++i]); 125 134 -
roarclients/roarcatplay.c
r5949 r5950 64 64 65 65 if ( strcmp(k, "--server") == 0 || strcmp(k, "-s") == 0 ) { 66 ROAR_CKHAVEARGS(1); 66 67 server = argv[++i]; 67 68 } else if ( strcmp(k, "--simple") == 0 ) { … … 70 71 verbose++; 71 72 } else if ( strcmp(k, "-n") == 0 ) { 73 ROAR_CKHAVEARGS(1); 74 i++; 72 75 roar_debug_option_obsolete(argv[0], "-n", NULL, "Will ignore it for now."); 73 76 } else if ( !strcmp(k, "--rate") || !strcmp(k, "-R") ) { 77 ROAR_CKHAVEARGS(1); 74 78 info.rate = roar_str2rate(argv[++i]); 75 79 auinfo_changed = 1; 76 80 } else if ( !strcmp(k, "--bits") || !strcmp(k, "-B") ) { 81 ROAR_CKHAVEARGS(1); 77 82 info.bits = roar_str2bits(argv[++i]); 78 83 auinfo_changed = 1; 79 84 } else if ( !strcmp(k, "--channels") || !strcmp(k, "--chans") || !strcmp(k, "-C") ) { 85 ROAR_CKHAVEARGS(1); 80 86 info.channels = roar_str2channels(argv[++i]); 81 87 auinfo_changed = 1; 82 88 } else if ( !strcmp(k, "--codec") || !strcmp(k, "-E") ) { 89 ROAR_CKHAVEARGS(1); 83 90 info.codec = roar_str2codec(argv[++i]); 84 91 auinfo_changed = 1; 85 92 } else if ( !strcmp(k, "--aiprofile") ) { 93 ROAR_CKHAVEARGS(1); 86 94 if ( roar_profile2info(&info, argv[++i]) == -1 ) { 87 95 fprintf(stderr, "Error: Can not load audio profile: %s: %s\n", argv[i], roar_error2str(roar_error)); -
roarclients/roarctl.c
r5853 r5950 1212 1212 1213 1213 if ( strcmp(k, "--server") == 0 ) { 1214 ROAR_CKHAVEARGS(1); 1214 1215 server = argv[++i]; 1215 1216 } else if ( strcmp(k, "-v") == 0 || strcmp(k, "--verbose") == 0 ) { … … 1262 1263 1263 1264 } else if ( !strcmp(k, "sleep") ) { 1265 ROAR_CKHAVEARGS(1); 1264 1266 roar_sleep(atoi(argv[++i])); 1265 1267 1266 1268 } else if ( !strcmp(k, "ping") ) { 1269 ROAR_CKHAVEARGS(1); 1267 1270 #ifdef ROAR_HAVE_GETTIMEOFDAY 1268 1271 if ( ping(&con, atoi(argv[++i])) == -1 ) { … … 1342 1345 list_clients(&con); 1343 1346 } else if ( !strcmp(k, "clientinfo") ) { 1347 ROAR_CKHAVEARGS(1); 1344 1348 display_client(&con, atoi(argv[++i])); 1345 1349 } else if ( !strcmp(k, "liststreams") ) { 1346 1350 list_streams(&con); 1347 1351 } else if ( !strcmp(k, "streaminfo") ) { 1352 ROAR_CKHAVEARGS(1); 1348 1353 display_stream(&con, atoi(argv[++i])); 1349 1354 } else if ( !strcmp(k, "allinfo") ) { … … 1361 1366 1362 1367 } else if ( !strcmp(k, "kick") ) { 1368 ROAR_CKHAVEARGS(2); 1363 1369 t = roar_str2ot((k = argv[++i])); 1364 1370 if ( t == -1 ) { … … 1374 1380 1375 1381 } else if ( !strcmp(k, "newvirtual") ) { 1382 ROAR_CKHAVEARGS(6); 1376 1383 if ( newvirtual(&con, argv[i+1], argv[i+2], argv[i+3], argv[i+4], argv[i+5], argv[i+6]) == -1 ) { 1377 1384 fprintf(stderr, "Error: can not create new virtual stream\n"); … … 1382 1389 1383 1390 } else if ( !strcmp(k, "volume") ) { 1391 ROAR_CKHAVEARGS(2); /* we may need more, but this is the minimum */ 1384 1392 if ( set_mixer(&con, &i, argc, argv) == -1 ) { 1385 1393 fprintf(stderr, "Error: can not set volume\n"); … … 1389 1397 1390 1398 } else if ( !strcmp(k, "flag") ) { 1399 ROAR_CKHAVEARGS(2); 1391 1400 i++; 1392 1401 if ( set_flags(&con, atoi(argv[i]), ROAR_SET_FLAG, argv[i+1]) == -1 ) { … … 1397 1406 i++; 1398 1407 } else if ( !strcmp(k, "unflag") ) { 1408 ROAR_CKHAVEARGS(2); 1399 1409 i++; 1400 1410 if ( set_flags(&con, atoi(argv[i]), ROAR_RESET_FLAG, argv[i+1]) == -1 ) { … … 1405 1415 i++; 1406 1416 } else if ( !strcmp(k, "toggleflag") ) { 1417 ROAR_CKHAVEARGS(2); 1407 1418 i++; 1408 1419 if ( set_flags(&con, atoi(argv[i]), ROAR_TOGGLE_FLAG, argv[i+1]) == -1 ) { … … 1413 1424 i++; 1414 1425 } else if ( !strcmp(k, "protectflag") ) { 1426 ROAR_CKHAVEARGS(2); 1415 1427 i++; 1416 1428 if ( set_flags(&con, atoi(argv[i]), ROAR_NOOP_FLAG|ROAR_PROTECT_FLAG, argv[i+1]) == -1 ) { … … 1422 1434 1423 1435 } else if ( !strcmp(k, "role") ) { 1436 ROAR_CKHAVEARGS(2); 1424 1437 i++; 1425 1438 if ( set_role(&con, atoi(argv[i]), roar_str2role(argv[i+1])) == -1 ) { … … 1431 1444 1432 1445 } else if ( !strcmp(k, "metaset") ) { 1446 ROAR_CKHAVEARGS(4); 1433 1447 i++; 1434 1448 if ( set_meta(&con, atoi(argv[i]), argv[i+1], argv[i+2], argv[i+3]) == -1 ) { … … 1439 1453 i += 3; 1440 1454 } else if ( !strcmp(k, "metaget") ) { 1455 ROAR_CKHAVEARGS(2); 1441 1456 i++; 1442 1457 if ( show_meta_type(&con, atoi(argv[i]), argv[i+1]) == -1 ) { … … 1445 1460 i++; 1446 1461 } else if ( !strcmp(k, "metasave") ) { 1462 ROAR_CKHAVEARGS(2); 1447 1463 i++; 1448 1464 if ( save_meta(&con, atoi(argv[i]), argv[i+1]) == -1 ) { … … 1453 1469 i++; 1454 1470 } else if ( !strcmp(k, "metaload") ) { 1471 ROAR_CKHAVEARGS(2); 1455 1472 i++; 1456 1473 if ( load_meta(&con, atoi(argv[i]), argv[i+1]) == -1 ) { … … 1467 1484 } 1468 1485 } else if ( !strcmp(k, "aiprofileget") || !strcmp(k, "profileget") ) { 1486 ROAR_CKHAVEARGS(1); 1469 1487 i++; 1470 1488 if ( show_aiprofile(argv[i]) == -1 ) { -
roarclients/roarfilt.c
r5823 r5950 32 32 33 33 #define BUFFERSIZE 1024 34 35 #ifdef ROAR_HAVE_LIBM36 struct {37 uint16_t a, b;38 int16_t old[ROAR_MAX_CHANNELS];39 } g_lowpass;40 #endif41 34 42 35 void usage (void) { … … 57 50 " --mul VAL - Set mul\n" 58 51 " --div VAL - Set div\n" 59 #ifdef ROAR_HAVE_LIBM60 " --lowpass freq - lowpass filter (obsolete)\n"61 #endif62 52 " --filter name - add filter name\n" 63 53 " --ffreq freq - set filter freq\n" … … 87 77 _volX(32,64,4) 88 78 89 #ifdef ROAR_HAVE_LIBM90 void logs2 (void * data, float scale, int len) {91 int16_t * samples = (int16_t *) data;92 int i;93 float div = logf(scale);94 float scalemul = scale - 1;95 int neg;96 97 len /= 2;98 99 //printf("logs2(data=%p, scale=%f, len=%i): scalemul=%f, div=%f\n", data, scale, len, scalemul, div);100 101 for (i = 0; i < len; i++) {102 if ( (neg = (samples[i] < 0)) )103 samples[i] = abs(samples[i]);104 105 106 samples[i] = (neg ? 32768.0 : 32767.0)*logf(1 + (scalemul*(float)samples[i]/(neg ? 32768.0 : 32767.0))) / div;107 108 if ( neg )109 samples[i] *= -1;110 }111 }112 113 void lowpass2 (void * data, int len, int channels) {114 int16_t * samples = (int16_t *) data;115 register int32_t s;116 int i, c;117 118 if ( channels > ROAR_MAX_CHANNELS )119 return;120 121 len /= 2 * channels;122 123 // * output[N] = input[N] * A + output[N-1] * B124 125 for (i = 0; i < len; i++) {126 for (c = 0; c < channels; c++) {127 s = samples[i*channels + c] * g_lowpass.a + g_lowpass.old[c] * g_lowpass.b;128 129 s /= 65536;130 131 samples[i*channels + c] = s;132 g_lowpass.old[ c] = s;133 }134 }135 }136 #endif137 138 79 int main (int argc, char * argv[]) { 139 80 struct roar_audio_info info; … … 144 85 int filter_id; 145 86 int32_t tmp; 146 float logscale = 0; 147 float lp = 0; 87 float tmpfp; 148 88 char buf[BUFFERSIZE]; 149 89 struct roardsp_filterchain fc; … … 156 96 info.codec = ROAR_CODEC_DEFAULT; 157 97 158 #ifdef ROAR_HAVE_LIBM159 memset(&g_lowpass, 0, sizeof(g_lowpass));160 #endif161 162 98 roardsp_fchain_init(&fc); 163 99 … … 166 102 167 103 if ( strcmp(k, "--server") == 0 || strcmp(k, "-s") == 0 ) { 104 ROAR_CKHAVEARGS(1); 168 105 server = argv[++i]; 169 106 } else if ( strcmp(k, "--rate") == 0 || strcmp(k, "-R") == 0 || strcmp(k, "-r") == 0 ) { 107 ROAR_CKHAVEARGS(1); 170 108 info.rate = roar_str2rate(argv[++i]); 171 109 } else if ( strcmp(k, "--bits") == 0 || strcmp(k, "-B") == 0 ) { 110 ROAR_CKHAVEARGS(1); 172 111 info.bits = roar_str2bits(argv[++i]); 173 112 } else if ( strcmp(k, "--channels") == 0 || strcmp(k, "--chans") == 0 || strcmp(k, "-C") == 0 ) { 113 ROAR_CKHAVEARGS(1); 174 114 info.channels = roar_str2channels(argv[++i]); 175 115 } else if ( strcmp(k, "-b") == 0 ) { … … 178 118 info.channels = 1; 179 119 } else if ( !strcmp(k, "--aiprofile") ) { 120 ROAR_CKHAVEARGS(1); 180 121 if ( roar_profile2info(&info, argv[++i]) == -1 ) { 181 122 fprintf(stderr, "Error: Can not load audio profile: %s: %s\n", argv[i], roar_error2str(roar_error)); … … 188 129 mul *= 2; 189 130 } else if ( strcmp(k, "--amp") == 0 ) { 131 ROAR_CKHAVEARGS(1); 190 132 mul *= atoi(argv[++i]); 191 133 } else if ( strcmp(k, "--mul") == 0 ) { 134 ROAR_CKHAVEARGS(1); 192 135 mul = atoi(argv[++i]); 193 136 } else if ( strcmp(k, "--div") == 0 ) { 137 ROAR_CKHAVEARGS(1); 194 138 div = atoi(argv[++i]); 195 } else if ( strcmp(k, "--log") == 0 ) {196 ROAR_WARN("The logscaler is obsolete and will be removed soon.");197 logscale = atof(argv[++i]);198 #ifdef ROAR_HAVE_LIBM199 } else if ( strcmp(k, "--lowpass") == 0 ) {200 ROAR_WARN("The builtin lowpass is obsolete and will be removed soon. Use --filter lowpass.");201 lp = exp(-2 * M_PI * atof(argv[++i]) / info.rate) * 65536;202 g_lowpass.b = lp;203 g_lowpass.a = 65536 - lp;204 #endif205 // printf("lowpass: A=%i, B=%i\n", g_lowpass.a, g_lowpass.b);206 139 } else if ( strcmp(k, "--filter") == 0 ) { 140 ROAR_CKHAVEARGS(1); 207 141 stream.info = info; 208 142 filter_id = roardsp_filter_str2id(argv[++i]); … … 219 153 } 220 154 } else if ( strcmp(k, "--ffreq") == 0 ) { 221 lp = atof(argv[++i]); 222 roardsp_filter_ctl(filter, ROARDSP_FCTL_FREQ, &lp); 155 ROAR_CKHAVEARGS(1); 156 tmpfp = atof(argv[++i]); 157 roardsp_filter_ctl(filter, ROARDSP_FCTL_FREQ, &tmpfp); 223 158 } else if ( strcmp(k, "--fmul") == 0 ) { 159 ROAR_CKHAVEARGS(1); 224 160 tmp = atoi(argv[++i]); 225 161 roardsp_filter_ctl(filter, ROARDSP_FCTL_MUL, &tmp); 226 162 } else if ( strcmp(k, "--fdiv") == 0 ) { 163 ROAR_CKHAVEARGS(1); 227 164 tmp = atoi(argv[++i]); 228 165 roardsp_filter_ctl(filter, ROARDSP_FCTL_DIV, &tmp); 229 166 } else if ( strcmp(k, "--fn") == 0 ) { 167 ROAR_CKHAVEARGS(1); 230 168 tmp = atoi(argv[++i]); 231 169 roardsp_filter_ctl(filter, ROARDSP_FCTL_N, &tmp); 232 170 } else if ( strcmp(k, "--fq") == 0 ) { 171 ROAR_CKHAVEARGS(1); 233 172 tmp = atoi(argv[++i]); 234 173 roardsp_filter_ctl(filter, ROARDSP_FCTL_Q, &tmp); 235 174 } else if ( strcmp(k, "--flimit") == 0 ) { 175 ROAR_CKHAVEARGS(1); 236 176 tmp = atoi(argv[++i]); 237 177 roardsp_filter_ctl(filter, ROARDSP_FCTL_LIMIT, &tmp); 238 178 } else if ( strcmp(k, "--fmode") == 0 ) { 179 ROAR_CKHAVEARGS(1); 239 180 tmp = atoi(argv[++i]); 240 181 roardsp_filter_ctl(filter, ROARDSP_FCTL_MODE, &tmp); … … 257 198 258 199 if ( mul == div && 259 #ifdef ROAR_HAVE_LIBM260 logscale == 0 && g_lowpass.a == 0 &&261 #endif262 200 roardsp_fchain_num(&fc) == 0 ) { 263 201 fprintf(stderr, "Error: filter is useless!\n"); … … 278 216 if ( mul != div ) 279 217 vol16((void*)buf, mul, div, i); 280 #ifdef ROAR_HAVE_LIBM281 if ( logscale )282 logs2((void*)buf, logscale, i);283 if ( g_lowpass.a )284 lowpass2((void*)buf, i, info.channels);285 #endif286 218 roardsp_fchain_calc(&fc, (void*)buf, (8*i)/info.bits); 287 219 if (roar_vio_write(&svio, buf, i) != i) -
roarclients/roarmon.c
r5823 r5950 84 84 85 85 if ( !strcmp(k, "--server") || !strcmp(k, "-s") ) { 86 ROAR_CKHAVEARGS(1); 86 87 server = argv[++i]; 87 88 } else if ( !strcmp(k, "--rate") || !strcmp(k, "-r") || !strcmp(k, "-R") ) { 89 ROAR_CKHAVEARGS(1); 88 90 info.rate = roar_str2rate(argv[++i]); 89 91 } else if ( !strcmp(k, "--bits") || !strcmp(k, "-B") ) { 92 ROAR_CKHAVEARGS(1); 90 93 info.bits = roar_str2bits(argv[++i]); 91 94 } else if ( !strcmp(k, "-b") ) { 92 95 info.bits = 8; 93 96 } else if ( !strcmp(k, "--channels") || !strcmp(k, "--chans") || !strcmp(k, "-C") ) { 97 ROAR_CKHAVEARGS(1); 94 98 info.channels = roar_str2channels(argv[++i]); 95 99 } else if ( !strcmp(k, "-m") ) { 96 100 info.channels = 1; 97 101 } else if ( !strcmp(k, "--codec") || !strcmp(k, "-E") ) { 102 ROAR_CKHAVEARGS(1); 98 103 if ( (info.codec = roar_str2codec(argv[++i])) == ROAR_AUDIO_INFO_INVALID ) { 99 104 fprintf(stderr, "Error: Unknown codec: %s\n", argv[i]); … … 102 107 103 108 } else if ( !strcmp(k, "--aiprofile") ) { 109 ROAR_CKHAVEARGS(1); 104 110 if ( roar_profile2info(&info, argv[++i]) == -1 ) { 105 111 fprintf(stderr, "Error: Can not load audio profile: %s: %s\n", argv[i], roar_error2str(roar_error)); … … 124 130 dir = ROAR_DIR_THRU; 125 131 } else if ( !strcmp(k, "--rel-id") ) { 132 ROAR_CKHAVEARGS(1); 126 133 rel_id = atoi(argv[++i]); 127 134 -
roarclients/roarmonhttp.c
r5823 r5950 268 268 #endif 269 269 } else if ( !strcmp(k, "--server") ) { 270 ROAR_CKHAVEARGS(1); 270 271 roar_libroar_set_server(argv[++i]); 271 272 } else if ( !strcmp(k, "--codec") || !strcmp(k, "-E") ) { 273 ROAR_CKHAVEARGS(1); 272 274 info.codec = roar_str2codec(argv[++i]); 273 275 } else if ( !strcmp(k, "--rate") || !strcmp(k, "-r") || !strcmp(k, "-R") ) { 276 ROAR_CKHAVEARGS(1); 274 277 info.rate = roar_str2rate(argv[++i]); 275 278 } else if ( !strcmp(k, "--bits") || !strcmp(k, "-B") ) { 279 ROAR_CKHAVEARGS(1); 276 280 info.bits = roar_str2bits(argv[++i]); 277 281 } else if ( !strcmp(k, "--channels") || !strcmp(k, "--chans") || !strcmp(k, "-C") ) { 282 ROAR_CKHAVEARGS(1); 278 283 info.channels = roar_str2channels(argv[++i]); 279 284 } else if ( !strcmp(k, "--aiprofile") ) { 285 ROAR_CKHAVEARGS(1); 280 286 if ( roar_profile2info(&info, argv[++i]) == -1 ) { 281 287 fprintf(stderr, "Error: Can not load audio profile: %s: %s\n", argv[i], roar_error2str(roar_error)); … … 283 289 } 284 290 } else if ( !strcmp(k, "--rel-id") ) { 291 ROAR_CKHAVEARGS(1); 285 292 rel_id = atoi(argv[++i]); 286 293 } else if ( !strcmp(k, "--help") && !strcmp(k, "-h") ) { -
roarclients/roarphone.c
r5823 r5950 432 432 433 433 if ( strcmp(k, "--server") == 0 ) { 434 ROAR_CKHAVEARGS(1); 434 435 server = argv[++i]; 435 436 } else if ( strcmp(k, "--jumbo-mtu") == 0 ) { 437 ROAR_CKHAVEARGS(1); 436 438 g_conf.jumbo_mtu = atoi(argv[++i]); 437 439 } else if ( strcmp(k, "--io-flush") == 0 ) { 440 ROAR_CKHAVEARGS(1); 438 441 g_conf.ioflush_interval = atoi(argv[++i]); 439 442 } else if ( strcmp(k, "--rate") == 0 || strcmp(k, "-R") == 0 ) { 443 ROAR_CKHAVEARGS(1); 440 444 info.rate = roar_str2rate(argv[++i]); 441 445 } else if ( strcmp(k, "--bits") == 0 || strcmp(k, "-B") == 0 ) { 446 ROAR_CKHAVEARGS(1); 442 447 info.bits = roar_str2bits(argv[++i]); 443 448 } else if ( strcmp(k, "--channels") == 0 || strcmp(k, "--chans") == 0 || strcmp(k, "-C") == 0 ) { 449 ROAR_CKHAVEARGS(1); 444 450 info.channels = roar_str2channels(argv[++i]); 445 451 } else if ( !strcmp(k, "--aiprofile") ) { 452 ROAR_CKHAVEARGS(1); 446 453 if ( roar_profile2info(&info, argv[++i]) == -1 ) { 447 454 fprintf(stderr, "Error: Can not load audio profile: %s: %s\n", argv[i], roar_error2str(roar_error)); … … 466 473 467 474 } else if ( strcmp(k, "--codec") == 0 || strcmp(k, "-E") == 0 ) { 475 ROAR_CKHAVEARGS(1); 468 476 info.codec = roar_str2codec(argv[++i]); 469 477 470 478 } else if ( strcmp(k, "--driver") == 0 ) { 479 ROAR_CKHAVEARGS(1); 471 480 driver = argv[++i]; 472 481 } else if ( strcmp(k, "--device") == 0 ) { 482 ROAR_CKHAVEARGS(1); 473 483 device = argv[++i]; 474 484 } else if ( strcmp(k, "--antiecho") == 0 ) { 485 ROAR_CKHAVEARGS(1); 475 486 k = argv[++i]; 476 487 if ( !strcmp(k, "none") ) { … … 487 498 } 488 499 } else if ( strcmp(k, "--threshold") == 0 ) { 500 ROAR_CKHAVEARGS(1); 489 501 g_conf.dtx_threshold = atol(argv[++i]); 490 502 … … 497 509 // META DATA: 498 510 } else if ( strcmp(k, "--m-rn") == 0 ) { 511 ROAR_CKHAVEARGS(1); 499 512 g_meta.rn = argv[++i]; 500 513 } else if ( strcmp(k, "--m-nick") == 0 ) { 514 ROAR_CKHAVEARGS(1); 501 515 g_meta.nick = argv[++i]; 502 516 } else if ( strcmp(k, "--m-email") == 0 ) { 517 ROAR_CKHAVEARGS(1); 503 518 g_meta.email = argv[++i]; 504 519 } else if ( strcmp(k, "--m-hp") == 0 ) { 520 ROAR_CKHAVEARGS(1); 505 521 g_meta.hp = argv[++i]; 506 522 } else if ( strcmp(k, "--m-thumbn") == 0 ) { 523 ROAR_CKHAVEARGS(1); 507 524 g_meta.thumbnail = argv[++i]; 508 525 } else if ( strcmp(k, "--m-loc") == 0 ) { 526 ROAR_CKHAVEARGS(1); 509 527 g_meta.loc = argv[++i]; 510 528 } else if ( strcmp(k, "--m-org") == 0 ) { 529 ROAR_CKHAVEARGS(1); 511 530 g_meta.org = argv[++i]; 512 531 -
roarclients/roarpluginrunner.c
r5876 r5950 623 623 g_verbose++; 624 624 } else if ( !strcmp(k, "--server") ) { 625 ROAR_CKHAVEARGS(1); 625 626 roar_libroar_set_server(argv[++i]); 626 627 … … 635 636 cpi_touched++; 636 637 } else if ( !strcmp(k, "--port") ) { 638 ROAR_CKHAVEARGS(1); 637 639 cpi_port = atoi(argv[++i]); 638 640 cpi_touched++; 639 641 } else if ( !strcmp(k, "--bind") ) { 642 ROAR_CKHAVEARGS(1); 640 643 cpi_host = argv[++i]; 641 644 cpi_touched++; 642 645 } else if ( !strcmp(k, "--proto") ) { 646 ROAR_CKHAVEARGS(1); 643 647 cpi_proto = roar_str2proto(argv[++i]); 644 648 if ( cpi_proto == -1 ) { … … 653 657 cpi_touched = 0; 654 658 } else if ( !strcmp(k, "--client-fh") ) { 659 ROAR_CKHAVEARGS(1); 655 660 if ( add_cpi_client(cpi_proto, atoi(argv[++i])) == -1 ) { 656 661 fprintf(stderr, "Can not add CPI client: %s\n", roar_error2str(roar_error)); … … 671 676 672 677 } else if ( !strcmp(k, "--appname") ) { 678 ROAR_CKHAVEARGS(1); 673 679 appname = argv[++i]; 674 680 _clear_para(); 675 681 } else if ( !strcmp(k, "--abiversion") ) { 682 ROAR_CKHAVEARGS(1); 676 683 abiversion = argv[++i]; 677 684 _clear_para(); 678 685 } else if ( !strcmp(k, "--args") ) { 686 ROAR_CKHAVEARGS(1); 679 687 pluginargs = argv[++i]; 680 688 _clear_para(); -
roarclients/roarradio.c
r5823 r5950 76 76 77 77 if ( strcmp(k, "--server") == 0 ) { 78 ROAR_CKHAVEARGS(1); 78 79 server = argv[++i]; 79 80 } else if ( strcmp(k, "--rate") == 0 || strcmp(k, "-R") == 0 ) { 81 ROAR_CKHAVEARGS(1); 80 82 info.rate = roar_str2rate(argv[++i]); 81 83 } else if ( strcmp(k, "--bits") == 0 || strcmp(k, "-B") == 0 ) { 84 ROAR_CKHAVEARGS(1); 82 85 info.bits = roar_str2bits(argv[++i]); 83 86 } else if ( strcmp(k, "--channels") == 0 || strcmp(k, "--chans") == 0 || strcmp(k, "-C") == 0 ) { 87 ROAR_CKHAVEARGS(1); 84 88 info.channels = roar_str2channels(argv[++i]); 85 89 } else if ( strcmp(k, "--codec") == 0 || strcmp(k, "-E") == 0 ) { 90 ROAR_CKHAVEARGS(1); 86 91 info.codec = roar_str2codec(argv[++i]); 87 92 } else if ( !strcmp(k, "--aiprofile") ) { 93 ROAR_CKHAVEARGS(1); 88 94 if ( roar_profile2info(&info, argv[++i]) == -1 ) { 89 95 fprintf(stderr, "Error: Can not load audio profile: %s: %s\n", argv[i], roar_error2str(roar_error)); -
roarclients/roarshout.c
r5823 r5950 121 121 122 122 if ( strcmp(k, "--server") == 0 ) { 123 ROAR_CKHAVEARGS(1); 123 124 server = argv[++i]; 124 125 } else if ( strcmp(k, "--rate") == 0 || strcmp(k, "-R") == 0 ) { 126 ROAR_CKHAVEARGS(1); 125 127 info.rate = roar_str2rate(argv[++i]); 126 128 } else if ( strcmp(k, "--bits") == 0 || strcmp(k, "-B") == 0 ) { 129 ROAR_CKHAVEARGS(1); 127 130 info.bits = roar_str2bits(argv[++i]); 128 131 } else if ( strcmp(k, "--channels") == 0 || strcmp(k, "--chans") == 0 || strcmp(k, "-C") == 0 ) { 132 ROAR_CKHAVEARGS(1); 129 133 info.channels = roar_str2channels(argv[++i]); 130 134 } else if ( strcmp(k, "--codec") == 0 || strcmp(k, "-E") == 0 ) { 135 ROAR_CKHAVEARGS(1); 131 136 info.codec = roar_str2codec(argv[++i]); 132 137 } else if ( !strcmp(k, "--aiprofile") ) { 138 ROAR_CKHAVEARGS(1); 133 139 if ( roar_profile2info(&info, argv[++i]) == -1 ) { 134 140 fprintf(stderr, "Error: Can not load audio profile: %s: %s\n", argv[i], roar_error2str(roar_error)); … … 144 150 s_public = 1; 145 151 } else if ( strcmp(k, "-d") == 0 ) { 152 ROAR_CKHAVEARGS(1); 146 153 s_desc = argv[++i]; 147 154 } else if ( strcmp(k, "-g") == 0 ) { 155 ROAR_CKHAVEARGS(1); 148 156 s_genre = argv[++i]; 149 157 } else if ( strcmp(k, "-n") == 0 ) { 158 ROAR_CKHAVEARGS(1); 150 159 s_name = argv[++i]; 151 160 } else if ( strcmp(k, "-u") == 0 ) { 161 ROAR_CKHAVEARGS(1); 152 162 s_url = argv[++i]; 153 163 } else if ( strcmp(k, "-h") == 0 || strcmp(k, "--help") == 0 ) { … … 155 165 return 0; 156 166 } else if ( s_server == NULL ) { 167 ROAR_CKHAVEARGS(1); 157 168 s_server = k; 158 169 } else if ( s_port == -1 ) { 170 ROAR_CKHAVEARGS(1); 159 171 s_port = atoi(k); 160 172 } else if ( s_pw == NULL ) { 173 ROAR_CKHAVEARGS(1); 161 174 s_pw = argv[i]; // do not use k here so k can be const. 162 175 } else if ( s_mount == NULL ) { 176 ROAR_CKHAVEARGS(1); 163 177 s_mount = k; 164 178 } else { -
roarclients/roarsin.c
r5823 r5950 97 97 98 98 int main (int argc, char * argv[]) { 99 const char * k; 99 100 const char * server = NULL; 100 101 int rate = ROAR_RATE_DEFAULT; … … 112 113 113 114 for (i = 1; i < argc; i++) { 114 if ( !strcmp(argv[i], "--freq") ) { 115 k = argv[i]; 116 if ( !strcmp(k, "--freq") ) { 117 ROAR_CKHAVEARGS(1); 115 118 freq = atof(argv[++i]); 116 } else if ( !strcmp(argv[i], "--time") ) { 119 } else if ( !strcmp(k, "--time") ) { 120 ROAR_CKHAVEARGS(1); 117 121 length = atof(argv[++i]); 118 } else if ( !strcmp(argv[i], "--server") ) { 122 } else if ( !strcmp(k, "--server") ) { 123 ROAR_CKHAVEARGS(1); 119 124 server = argv[++i]; 120 } else if ( !strcmp(argv[i], "--rate") || !strcmp(argv[i], "-R") ) { 125 } else if ( !strcmp(k, "--rate") || !strcmp(k, "-R") ) { 126 ROAR_CKHAVEARGS(1); 121 127 rate = roar_str2rate(argv[++i]); 122 } else if ( !strcmp(argv[i], "--volume") ) { 128 } else if ( !strcmp(k, "--volume") ) { 129 ROAR_CKHAVEARGS(1); 123 130 volume = atof(argv[++i]); 124 } else if ( !strcmp( argv[i], "--sin") ) {131 } else if ( !strcmp(k, "--sin") ) { 125 132 func = sin; 126 } else if ( !strcmp( argv[i], "--rect") ) {133 } else if ( !strcmp(k, "--rect") ) { 127 134 func = rect; 128 } else if ( !strcmp( argv[i], "--saw") ) {135 } else if ( !strcmp(k, "--saw") ) { 129 136 func = saw; 130 } else if ( !strcmp( argv[i], "--tri") ) {137 } else if ( !strcmp(k, "--tri") ) { 131 138 func = tri; 132 } else if ( !strcmp( argv[i], "--trap") ) {139 } else if ( !strcmp(k, "--trap") ) { 133 140 func = trap; 134 } else if ( !strcmp( argv[i], "--help") ) {141 } else if ( !strcmp(k, "--help") ) { 135 142 usage(argv[0]); 136 143 return 0; -
roarclients/roarvorbis.c
r5823 r5950 309 309 310 310 if ( strcmp(k, "--server") == 0 ) { 311 ROAR_CKHAVEARGS(1); 311 312 roar_libroar_set_server(argv[++i]); 312 313 } else if ( strcmp(k, "--vclt-out") == 0 ) { 314 ROAR_CKHAVEARGS(1); 313 315 vcltfile = argv[++i]; 314 316 } else if ( strcmp(k, "--help") == 0 ) { -
roarclients/roarvumeter.c
r5823 r5950 179 179 180 180 if ( strcmp(k, "--server") == 0 ) { 181 ROAR_CKHAVEARGS(1); 181 182 server = argv[++i]; 182 183 } else if ( strcmp(k, "--rate") == 0 || strcmp(k, "-R") == 0 ) { 184 ROAR_CKHAVEARGS(1); 183 185 info.rate = roar_str2rate(argv[++i]); 184 186 } else if ( strcmp(k, "--bits") == 0 || strcmp(k, "-B") == 0 ) { 187 ROAR_CKHAVEARGS(1); 185 188 info.bits = roar_str2bits(argv[++i]); 186 189 } else if ( strcmp(k, "--channels") == 0 || strcmp(k, "--chans") == 0 || strcmp(k, "-C") == 0 ) { 190 ROAR_CKHAVEARGS(1); 187 191 info.channels = roar_str2channels(argv[++i]); 188 192 } else if ( !strcmp(k, "--aiprofile") ) { 193 ROAR_CKHAVEARGS(1); 189 194 if ( roar_profile2info(&info, argv[++i]) == -1 ) { 190 195 fprintf(stderr, "Error: Can not load audio profile: %s: %s\n", argv[i], roar_error2str(roar_error)); … … 192 197 } 193 198 } else if ( strcmp(k, "--samples") == 0 ) { 199 ROAR_CKHAVEARGS(1); 194 200 samples = atoi(argv[++i]); 195 201 } else if ( strcmp(k, "--db") == 0 ) { … … 204 210 mode |= MODE_BEAT; 205 211 } else if ( strcmp(k, "--lowpass") == 0 ) { 212 ROAR_CKHAVEARGS(1); 206 213 lowpass_freq = atof(argv[++i]); 207 214 } else if ( strcmp(k, "--help") == 0 ) {
Note: See TracChangeset
for help on using the changeset viewer.