wmcdplay: Add -i option so users can specify cd polling interval.

Based on the patch from Debian by Marcelo E. Magallon <mmagallo@debian.org> [1],
which fixed Debian bug #25121.

[1] http://sources.debian.net/src/wmcdplay/1.0beta1-13/debian/patches/add_interval_option.patch/
[2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=25121
This commit is contained in:
Doug Torrance 2014-12-18 12:30:40 -06:00 committed by Carlos R. Mafra
parent 34e3275338
commit ca89668d4e

View file

@ -81,6 +81,7 @@ bool artwrk=false;
char artwrkf[256]=""; char artwrkf[256]="";
int tsel=1; int tsel=1;
int vol=-1; // -1 means don't set volume int vol=-1; // -1 means don't set volume
int uinterval_e=UINTERVAL_E;
// X-Windows basics - standard // X-Windows basics - standard
Atom _XA_GNUSTEP_WM_FUNC; Atom _XA_GNUSTEP_WM_FUNC;
@ -226,7 +227,7 @@ int main(int argc, char **argv)
} }
} }
ucount++; ucount++;
if(ucount>=((mode==ssNoCD || mode==ssTrayOpen) ? UINTERVAL_E : UINTERVAL_N)) if(ucount>=((mode==ssNoCD || mode==ssTrayOpen) ? uinterval_e : UINTERVAL_N))
checkStatus(false); checkStatus(false);
XFlush(d_display); XFlush(d_display);
usleep(50000); usleep(50000);
@ -364,6 +365,7 @@ void scanArgs(int argc, char **argv){
fprintf(stderr, " -f artwork_file load the specified artwork file\n"); fprintf(stderr, " -f artwork_file load the specified artwork file\n");
fprintf(stderr, " -t track_selection set track selection (between 0 and 4)\n"); fprintf(stderr, " -t track_selection set track selection (between 0 and 4)\n");
fprintf(stderr, " -v volume set the cdrom volume (between 0 and 255)\n"); fprintf(stderr, " -v volume set the cdrom volume (between 0 and 255)\n");
fprintf(stderr, " -i interval interval in 1/20 seconds between cd polls when empty\n");
fprintf(stderr, " -l led_color use the specified color for led displays\n"); fprintf(stderr, " -l led_color use the specified color for led displays\n");
fprintf(stderr, " -b back_color use the specified color for backgrounds\n"); fprintf(stderr, " -b back_color use the specified color for backgrounds\n");
fprintf(stderr, " -d cd_device use specified device (rather than /dev/cdrom)\n"); fprintf(stderr, " -d cd_device use specified device (rather than /dev/cdrom)\n");
@ -391,6 +393,13 @@ void scanArgs(int argc, char **argv){
} }
continue; continue;
} }
if(strcmp(argv[i], "-i")==0){
if(i<argc-1){
i++;
sscanf(argv[i], "%i", &uinterval_e);
}
continue;
}
if(strcmp(argv[i], "-f")==0){ if(strcmp(argv[i], "-f")==0){
artwrk=true; artwrk=true;
if(i<argc-1){ if(i<argc-1){