Lines Matching refs:optstate

91 static lsx_getopt_t optstate;  variable
775 while (optstate.ind < argc) { in parse_effects()
791 if (strcmp(argv[optstate.ind], ":") == 0) in parse_effects()
801 optstate.ind++; in parse_effects()
805 if (strcmp(argv[optstate.ind], "newfile") == 0) in parse_effects()
820 else if (strcmp(argv[optstate.ind], "restart") == 0) in parse_effects()
836 user_effargs[eff_chain_count][eff_offset].name = lsx_strdup(argv[optstate.ind]); in parse_effects()
837 optstate.ind++; in parse_effects()
838 for (j = 0; j < (size_t)(argc - optstate.ind) && !sox_find_effect(argv[optstate.ind + j]) && in parse_effects()
839 !is_pseudo_effect(argv[optstate.ind + j]); ++j) { in parse_effects()
845 user_effargs[eff_chain_count][eff_offset].argv[j] = lsx_strdup(argv[optstate.ind + j]); in parse_effects()
849 optstate.ind += j; /* Skip past the effect arguments */ in parse_effects()
951 optstate.ind = 0; in read_user_effects()
2274 switch (c=lsx_getopt(&optstate)) { in parse_gopts_and_fopts()
2279 switch (optstate.lngind) { in parse_gopts_and_fopts()
2281 if (optstate.arg) in parse_gopts_and_fopts()
2282 sox_append_comment(&f->oob.comments, optstate.arg); in parse_gopts_and_fopts()
2287 if (sscanf(optstate.arg, "%i %c", &i, &dummy) != 1 || i <= SOX_BUFMIN) { in parse_gopts_and_fopts()
2288 lsx_fail("Buffer size `%s' must be > %d", optstate.arg, SOX_BUFMIN); in parse_gopts_and_fopts()
2295 combine_method = enum_option(optstate.arg, optstate.lngind, combine_methods); in parse_gopts_and_fopts()
2300 read_comment_file(&f->oob.comments, optstate.arg); in parse_gopts_and_fopts()
2305 if (*optstate.arg) in parse_gopts_and_fopts()
2306 sox_append_comment(&f->oob.comments, optstate.arg); in parse_gopts_and_fopts()
2312 switch (enum_option(optstate.arg, optstate.lngind, endian_options)) { in parse_gopts_and_fopts()
2320 if (sscanf(optstate.arg, "%i %c", &i, &dummy) != 1 || i <= SOX_BUFMIN) { in parse_gopts_and_fopts()
2321 lsx_fail("Buffer size `%s' must be > %d", optstate.arg, SOX_BUFMIN); in parse_gopts_and_fopts()
2334 case 8: usage_effect(optstate.arg); break; in parse_gopts_and_fopts()
2335 case 9: usage_format(optstate.arg); break; in parse_gopts_and_fopts()
2338 sox_effects_globals.plot = enum_option(optstate.arg, optstate.lngind, plot_methods); in parse_gopts_and_fopts()
2340 case 12: replay_gain_mode = enum_option(optstate.arg, optstate.lngind, rg_modes); break; in parse_gopts_and_fopts()
2343 case 15: effects_filename = lsx_strdup(optstate.arg); break; in parse_gopts_and_fopts()
2344 case 16: sox_globals.tmp_path = lsx_strdup(optstate.arg); break; in parse_gopts_and_fopts()
2348 norm_level = lsx_strdup(optstate.arg); in parse_gopts_and_fopts()
2356 case 21: play_rate_arg = lsx_strdup(optstate.arg); break; in parse_gopts_and_fopts()
2361 if (sscanf(optstate.arg, "%i %c", &i, &dummy) != 1 || i < 8 || i > 16) { in parse_gopts_and_fopts()
2380 optstate.ind = optstate.ind; in parse_gopts_and_fopts()
2392 f->filetype = optstate.arg; in parse_gopts_and_fopts()
2399 size_t n = sscanf(optstate.arg, "%lf %c %c", &f->signal.rate, &k, &dummy); in parse_gopts_and_fopts()
2401 lsx_fail("Rate value `%s' is not a positive number", optstate.arg); in parse_gopts_and_fopts()
2409 if (sscanf(optstate.arg, "%lf %c", &f->volume, &dummy) != 1) { in parse_gopts_and_fopts()
2410 lsx_fail("Volume value `%s' is not a number", optstate.arg); in parse_gopts_and_fopts()
2420 if (sscanf(optstate.arg, "%d %c", &i, &dummy) != 1 || i <= 0) { in parse_gopts_and_fopts()
2421 lsx_fail("Channels value `%s' is not a positive integer", optstate.arg); in parse_gopts_and_fopts()
2428 if (sscanf(optstate.arg, "%lf %c", &f->encoding.compression, &dummy) != 1) { in parse_gopts_and_fopts()
2429 lsx_fail("Compression value `%s' is not a number", optstate.arg); in parse_gopts_and_fopts()
2435 if (sscanf(optstate.arg, "%d %c", &i, &dummy) != 1 || i <= 0) { in parse_gopts_and_fopts()
2436 lsx_fail("Bits value `%s' is not a positive integer", optstate.arg); in parse_gopts_and_fopts()
2442 case 'e': switch (enum_option(optstate.arg, opt_index('e'), encodings)) { in parse_gopts_and_fopts()
2478 if (optstate.arg == NULL) in parse_gopts_and_fopts()
2481 if (sscanf(optstate.arg, "%d %c", &i, &dummy) != 1 || i < 0) { in parse_gopts_and_fopts()
2483 lsx_fail("Verbosity value `%s' is not a non-negative integer", optstate.arg); in parse_gopts_and_fopts()
2621 lsx_getopt_init(argc2, argv2, getoptstr, long_options, lsx_getopt_flag_opterr, 1, &optstate); in parse_options_and_filenames()
2630 lsx_getopt_init(argc, argv, getoptstr, long_options, lsx_getopt_flag_opterr, 1, &optstate); in parse_options_and_filenames()
2631 for (; optstate.ind < argc && !sox_find_effect(argv[optstate.ind]); init_file(&opts)) { in parse_options_and_filenames()
2647 else if (optstate.ind >= argc || sox_find_effect(argv[optstate.ind])) in parse_options_and_filenames()
2649 else if (!sox_is_playlist(argv[optstate.ind])) in parse_options_and_filenames()
2650 add_glob_file(&opts, argv[optstate.ind++]); in parse_options_and_filenames()
2651 …else if (sox_parse_playlist((sox_playlist_callback_t)add_file, &opts, argv[optstate.ind++]) != SOX… in parse_options_and_filenames()
2745 lsx_getopt_init(argc, argv, opts, NULL, lsx_getopt_flag_opterr, 1, &optstate); in soxi()
2746 while ((opt = lsx_getopt(&optstate)) > 0) /* act only on last option */ in soxi()
2750 if (optstate.arg == NULL) in soxi()
2753 if (sscanf(optstate.arg, "%d %c", &i, &dummy) != 1 || i < 0) { in soxi()
2755 lsx_fail("Verbosity value `%s' is not a non-negative integer", optstate.arg); in soxi()
2773 for (; optstate.ind < argc; ++optstate.ind) { in soxi()
2774 if (sox_is_playlist(argv[optstate.ind])) in soxi()
2775 …num_errors += (sox_parse_playlist((sox_playlist_callback_t)soxi1, &type, argv[optstate.ind]) != SO… in soxi()
2776 else num_errors += soxi1(&type, argv[optstate.ind]); in soxi()