📄 parse.c
字号:
return -1; } } T_ELIF ("add-id3v2") id3tag_add_v2(gfp); T_ELIF ("id3v1-only") id3tag_v1_only(gfp); T_ELIF ("id3v2-only") id3tag_v2_only(gfp); T_ELIF ("space-id3v1") id3tag_space_v1(gfp); T_ELIF ("pad-id3v2") id3tag_pad_v2(gfp); T_ELIF ("genre-list") id3tag_genre_list(genre_list_handler, NULL); return -2; T_ELIF ("lowpass") val = atof( nextArg ); argUsed = 1; /* useful are 0.001 kHz...50 kHz, 50 Hz...50000 Hz */ if ( val < 0.001 || val > 50000. ) { fprintf(stderr,"Must specify lowpass with --lowpass freq, freq >= 0.001 kHz\n"); return -1; } lame_set_lowpassfreq(gfp,(int)(val * (val < 50. ? 1.e3 : 1.e0 ) + 0.5)); T_ELIF ("lowpass-width") argUsed=1; val = 1000.0 * atof( nextArg ) + 0.5; if (val < 0) { fprintf(stderr,"Must specify lowpass width with --lowpass-width freq, freq >= 0 kHz\n"); return -1; } lame_set_lowpasswidth(gfp,(int)val); T_ELIF ("highpass") val = atof( nextArg ); argUsed=1; /* useful are 0.001 kHz...16 kHz, 16 Hz...50000 Hz */ if ( val < 0.001 || val > 50000. ) { fprintf(stderr,"Must specify highpass with --highpass freq, freq >= 0.001 kHz\n"); return -1; } lame_set_highpassfreq(gfp, (int)(val * (val < 16. ? 1.e3 : 1.e0 ) + 0.5)); T_ELIF ("highpass-width") argUsed=1; val = 1000.0 * atof( nextArg ) + 0.5; if (val < 0) { fprintf(stderr,"Must specify highpass width with --highpass-width freq, freq >= 0 kHz\n"); return -1; } lame_set_highpasswidth(gfp,(int)val); T_ELIF ("comp") argUsed=1; val = atof( nextArg ); if (val < 1.0 ) { fprintf(stderr,"Must specify compression ratio >= 1.0\n"); return -1; } lame_set_compression_ratio(gfp,val); T_ELIF ("notemp") (void) lame_set_useTemporal( gfp, 0 ); T_ELIF ("interch") argUsed=1; (void) lame_set_interChRatio( gfp, atof(nextArg ) ); T_ELIF ("temporal-masking") argUsed = 1; (void) lame_set_useTemporal( gfp, atoi(nextArg)?1:0 ); T_ELIF ("nspsytune") lame_set_psy_model(gfp, PSY_NSPSYTUNE); T_ELIF ("nssafejoint") lame_set_exp_nspsytune(gfp,lame_get_exp_nspsytune(gfp) | 2); T_ELIF ("nsmsfix") argUsed=1; (void) lame_set_msfix( gfp, atof(nextArg) ); T_ELIF ("ns-bass") argUsed=1; { double d; int k; d = atof( nextArg ); k = (int)(d * 4); if (k < -32) k = -32; if (k > 31) k = 31; if (k < 0) k += 64; lame_set_exp_nspsytune(gfp, lame_get_exp_nspsytune(gfp) | (k << 2)); } T_ELIF ("ns-alto") argUsed=1; { double d; int k; d = atof( nextArg ); k = (int)(d * 4); if (k < -32) k = -32; if (k > 31) k = 31; if (k < 0) k += 64; lame_set_exp_nspsytune(gfp, lame_get_exp_nspsytune(gfp) | (k << 8)); } T_ELIF ("ns-treble") argUsed=1; { double d; int k; d = atof( nextArg ); k = (int)(d * 4); if (k < -32) k = -32; if (k > 31) k = 31; if (k < 0) k += 64; lame_set_exp_nspsytune(gfp, lame_get_exp_nspsytune(gfp) | (k << 14)); } T_ELIF ("ns-sfb21") /* to be compatible with Naoki's original code, * ns-sfb21 specifies how to change ns-treble for sfb21 */ argUsed=1; { double d; int k; d = atof( nextArg ); k = (int)(d * 4); if (k < -32) k = -32; if (k > 31) k = 31; if (k < 0) k += 64; lame_set_exp_nspsytune(gfp, lame_get_exp_nspsytune(gfp) | (k << 20)); } T_ELIF ("nspsytune2") { FILE *fp = fopen( nextArg, "r" ); if (fp == NULL) { fprintf(stderr,"nspsytune2 : error opening %s\n",nextArg); abort(); } lame_set_exp_nspsytune2_pointer(gfp,0,fp); } /* nspsytune2 implies nspsytune */ argUsed=1; lame_set_psy_model(gfp, PSY_NSPSYTUNE); lame_set_experimentalZ(gfp,1); lame_set_experimentalX(gfp,1); /* some more GNU-ish options could be added * brief => few messages on screen (name, status report) * o/output file => specifies output filename * O => stdout * i/input file => specifies input filename * I => stdin */ T_ELIF2 ("quiet", "silent") silent = 10; /* on a scale from 1 to 10 be very silent */ T_ELIF ("brief") silent = -5; /* print few info on screen */ T_ELIF ("verbose") silent = -10; /* print a lot on screen */ T_ELIF ("ignore-tag-errors") ignore_tag_errors = 1; T_ELIF2 ("version", "license") print_license ( stdout ); return -2; T_ELIF2 ("help", "usage") short_help ( gfp, stdout, ProgramName ); return -2; T_ELIF ("longhelp") long_help ( gfp, stdout, ProgramName, 0 /* lessmode=NO */ ); return -2; T_ELIF ("?")#ifdef __unix__ FILE* fp = popen ("less -Mqc", "w"); long_help ( gfp, fp, ProgramName, 0 /* lessmode=NO */ ); pclose (fp);#else long_help ( gfp, stdout, ProgramName, 1 /* lessmode=YES */ );#endif return -2; T_ELIF2 ("preset", "alt-preset") argUsed = 1; { int fast = 0, cbr = 0; while ((strcmp(nextArg, "fast") == 0) || (strcmp(nextArg, "cbr") == 0)) { if ((strcmp(nextArg, "fast") == 0) && (fast < 1)) fast = 1; if ((strcmp(nextArg, "cbr") == 0) && (cbr < 1)) cbr = 1; argUsed++; nextArg = i+argUsed < argc ? argv[i+argUsed] : ""; } if (presets_set ( gfp, fast, cbr, nextArg, ProgramName ) < 0) return -1; } T_ELIF ("disptime") argUsed = 1; update_interval = atof (nextArg); T_ELIF ("nogaptags") nogap_tags=1; T_ELIF ("nogapout") strcpy(outPath, nextArg); argUsed = 1; T_ELIF ("nogap") nogap=1; T_ELIF_INTERNAL ("tune") /*without helptext*/ argUsed=1; {extern void lame_set_tune(lame_t, float); lame_set_tune(gfp,atof(nextArg));} T_ELIF_INTERNAL ("psymodel") /*without helptext*/ /* 1 gpsycho, 2 nspsytune */ argUsed=1; lame_set_psy_model(gfp,atoi(nextArg)); T_ELIF_INTERNAL ("ms-sparsing") /*without helptext*/ argUsed=1; lame_set_ms_sparsing(gfp,atoi(nextArg)); T_ELIF_INTERNAL ("ms-sparse-low") /*without helptext*/ argUsed=1; lame_set_ms_sparse_low(gfp,atof(nextArg)); T_ELIF_INTERNAL ("ms-sparse-high") /*without helptext*/ argUsed=1; lame_set_ms_sparse_high(gfp,atof(nextArg)); T_ELIF_INTERNAL ("shortthreshold") { float x,y; int n = sscanf(nextArg, "%f,%f", &x, &y); if (n == 1) { y = x; } argUsed=1; (void) lame_set_short_threshold( gfp, x, y); } T_ELIF_INTERNAL ("maskingadjust") /*without helptext*/ argUsed=1; (void) lame_set_maskingadjust( gfp, atof( nextArg ) ); T_ELIF_INTERNAL ("maskingadjustshort") /*without helptext*/ argUsed=1; (void) lame_set_maskingadjust_short( gfp, atof( nextArg ) ); T_ELIF_INTERNAL ("athcurve") /*without helptext*/ argUsed=1; (void) lame_set_ATHcurve( gfp, atof( nextArg ) ); T_ELIF_INTERNAL ("no-preset-tune") /*without helptext*/ (void) lame_set_preset_notune( gfp, 0 ); T_ELIF_INTERNAL ("substep") argUsed=1; (void) lame_set_substep( gfp, atoi(nextArg) ); T_ELIF_INTERNAL ("sbgain") /*without helptext*/ argUsed=1; (void) lame_set_subblock_gain( gfp, atoi(nextArg) ); T_ELIF_INTERNAL ("sfscale") /*without helptext*/ (void) lame_set_sfscale( gfp, 1 ); T_ELIF_INTERNAL ("noath") (void) lame_set_noATH( gfp, 1 ); T_ELIF_INTERNAL ("athonly") (void) lame_set_ATHonly( gfp, 1 ); T_ELIF_INTERNAL ("athshort") (void) lame_set_ATHshort( gfp, 1 ); T_ELIF_INTERNAL ("athlower") argUsed=1; (void) lame_set_ATHlower( gfp, atof( nextArg ) ); T_ELIF_INTERNAL ("athtype") argUsed=1; (void) lame_set_ATHtype( gfp, atoi( nextArg ) ); T_ELIF_INTERNAL ("athaa-type") /* switch for developing, no DOCU */ argUsed=1; /* once was 1:Gaby, 2:Robert, 3:Jon, else:off */ lame_set_athaa_type( gfp, atoi(nextArg) );/* now: 0:off else:Jon */ T_ELIF ("athaa-sensitivity") argUsed=1; lame_set_athaa_sensitivity( gfp, atof(nextArg) ); T_ELIF_INTERNAL ("cwlimit") val = atof (nextArg); argUsed=1; /* useful are 0.001 kHz...50 kHz, 50 Hz...50000 Hz */ { int my_cwlimit = (int)(val * ( val <= 50. ? 1.e3 : 1.e0 )); lame_set_cwlimit( gfp, my_cwlimit ); if ( my_cwlimit <= 0 ) { fprintf( stderr, "Must specify cwlimit with --cwlimit freq, freq >= 0.001 kHz\n" ); return -1; } } T_ELSE
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -