logo       

linus: apps/plugins/lib xxx2wav.c,1.4,1.5: msg#00409

Subject: linus: apps/plugins/lib xxx2wav.c,1.4,1.5
Update of /cvsroot/rockbox/apps/plugins/lib
In directory labb:/tmp/cvs-serv16398/apps/plugins/lib

Modified Files:
        xxx2wav.c 
Log Message:
Reduced the LCD updates to once per second

Index: xxx2wav.c
===================================================================
RCS file: /cvsroot/rockbox/apps/plugins/lib/xxx2wav.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- xxx2wav.c   19 Feb 2005 12:11:18 -0000      1.4
+++ xxx2wav.c   23 Feb 2005 14:04:33 -0000      1.5
@@ -109,6 +109,7 @@
   unsigned long ticks_taken;
   unsigned long long speed;
   unsigned long xspeed;
+  static long last_tick = 0;
 
   local_rb->snprintf(s,32,"Bytes read: %d",file_info->curpos);
   local_rb->lcd_putsxy(0,0,s);
@@ -129,12 +130,15 @@
 
   if (ticks_taken==0) { ticks_taken=1; } // Avoid fp exception.
 
-  speed=(100*file_info->current_sample)/file_info->samplerate;
-  xspeed=(speed*10000)/ticks_taken;
-  local_rb->snprintf(s,32,"Speed %ld.%02ld %% Secs: 
%d",(xspeed/100),(xspeed%100),ticks_taken/100); 
-  local_rb->lcd_putsxy(0,60,s);
+  if(TIME_AFTER(*(local_rb->current_tick), last_tick + HZ)) {
+      last_tick = *(local_rb->current_tick);
+      speed=(100*file_info->current_sample)/file_info->samplerate;
+      xspeed=(speed*10000)/ticks_taken;
+      local_rb->snprintf(s,32,"Speed %ld.%02ld %% Secs: 
%d",(xspeed/100),(xspeed%100),ticks_taken/100); 
+      local_rb->lcd_putsxy(0,60,s);
 
-  local_rb->lcd_update();
+      local_rb->lcd_update();
+  }
 }
 
 static unsigned char wav_header[44]={'R','I','F','F',    //  0 - ChunkID
@@ -176,6 +180,8 @@
   file_info->frames_decoded=0;
   file_info->filesize=local_rb->filesize(file_info->infile);
 
+  local_rb->splash(HZ, true, "in: %d, size: %d", file_info->infile, 
file_info->filesize);
+  
   if (file_info->filesize > (bufsize-MALLOC_BUFSIZE)) {
     local_rb->close(file_info->infile);
     local_rb->splash(HZ*2, true, "File too large");

_______________________________________________
http://cool.haxx.se/mailman/listinfo/rockbox-cvs



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
qnx.openqnx.dev...    politics.lenini...    audio.emagic.ex...    tex.texinfo.gen...    handhelds.linux...    ietf.sipping/20...    lang.erlang.gen...    cygwin.talk/200...    yellowdog.gener...    mozilla.devel.l...    xfree86.newbie/...    openbsd.ports/2...    db.oracle.devel...    kde.kalyxo.deve...    user-groups.lin...    bbc.cvs/2003-04...    gnu.libtool.bug...    redhat.k12osn/2...    emulators.wine....    freebsd.devel.d...    search.xapian.g...    java.izpack.use...    network.mrtg.us...    windows.total-c...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe