[Pkg-wmaker-commits] [wmcdplay] 41/79: wmcdplay: Add -i option so users can specify cd polling interval.

Doug Torrance dtorrance-guest at moszumanska.debian.org
Thu Aug 20 11:04:33 UTC 2015


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch master
in repository wmcdplay.

commit 2667404403214aeab96736519733d06afc510fbe
Author: Doug Torrance <dtorrance at monmouthcollege.edu>
Date:   Thu Dec 18 12:30:40 2014 -0600

    wmcdplay: Add -i option so users can specify cd polling interval.
    
    Based on the patch from Debian by Marcelo E. Magallon <mmagallo at 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
---
 wmcdplay.cc | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/wmcdplay.cc b/wmcdplay.cc
index 7d205ac..6e0c21d 100644
--- a/wmcdplay.cc
+++ b/wmcdplay.cc
@@ -81,6 +81,7 @@ bool artwrk=false;
 char artwrkf[256]="";
 int tsel=1;
 int vol=-1;         // -1 means don't set volume
+int uinterval_e=UINTERVAL_E;
 
 // X-Windows basics - standard
 Atom _XA_GNUSTEP_WM_FUNC;
@@ -226,7 +227,7 @@ int main(int argc, char **argv)
             }
          }
          ucount++;
-         if(ucount>=((mode==ssNoCD || mode==ssTrayOpen) ? UINTERVAL_E : UINTERVAL_N))
+         if(ucount>=((mode==ssNoCD || mode==ssTrayOpen) ? uinterval_e : UINTERVAL_N))
             checkStatus(false);
          XFlush(d_display);
          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, "   -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, "   -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, "   -b back_color          use the specified color for backgrounds\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;
       }
+      if(strcmp(argv[i], "-i")==0){
+         if(i<argc-1){
+            i++;
+            sscanf(argv[i], "%i", &uinterval_e);
+         }
+         continue;
+      }
       if(strcmp(argv[i], "-f")==0){
          artwrk=true;
 	 if(i<argc-1){

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmcdplay.git



More information about the Pkg-wmaker-commits mailing list