diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2005-02-23 14:04:33 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2005-02-23 14:04:33 +0000 |
commit | 0cd492f5527564f0e84382637158babb7d8d98f3 (patch) | |
tree | 25b5349b0f7b7f71f47d123db99fca2f8252edd0 /apps | |
parent | b935f435ff9d945534db37c38b30c5d78362e6ee (diff) | |
download | rockbox-0cd492f5527564f0e84382637158babb7d8d98f3.tar.gz rockbox-0cd492f5527564f0e84382637158babb7d8d98f3.zip |
Reduced the LCD updates to once per second
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6046 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/plugins/lib/xxx2wav.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/apps/plugins/lib/xxx2wav.c b/apps/plugins/lib/xxx2wav.c index 052de9ad37..3f8853ffbf 100644 --- a/apps/plugins/lib/xxx2wav.c +++ b/apps/plugins/lib/xxx2wav.c | |||
@@ -109,6 +109,7 @@ void display_status(file_info_struct* file_info) { | |||
109 | unsigned long ticks_taken; | 109 | unsigned long ticks_taken; |
110 | unsigned long long speed; | 110 | unsigned long long speed; |
111 | unsigned long xspeed; | 111 | unsigned long xspeed; |
112 | static long last_tick = 0; | ||
112 | 113 | ||
113 | local_rb->snprintf(s,32,"Bytes read: %d",file_info->curpos); | 114 | local_rb->snprintf(s,32,"Bytes read: %d",file_info->curpos); |
114 | local_rb->lcd_putsxy(0,0,s); | 115 | local_rb->lcd_putsxy(0,0,s); |
@@ -129,12 +130,15 @@ void display_status(file_info_struct* file_info) { | |||
129 | 130 | ||
130 | if (ticks_taken==0) { ticks_taken=1; } // Avoid fp exception. | 131 | if (ticks_taken==0) { ticks_taken=1; } // Avoid fp exception. |
131 | 132 | ||
132 | speed=(100*file_info->current_sample)/file_info->samplerate; | 133 | if(TIME_AFTER(*(local_rb->current_tick), last_tick + HZ)) { |
133 | xspeed=(speed*10000)/ticks_taken; | 134 | last_tick = *(local_rb->current_tick); |
134 | local_rb->snprintf(s,32,"Speed %ld.%02ld %% Secs: %d",(xspeed/100),(xspeed%100),ticks_taken/100); | 135 | speed=(100*file_info->current_sample)/file_info->samplerate; |
135 | local_rb->lcd_putsxy(0,60,s); | 136 | xspeed=(speed*10000)/ticks_taken; |
137 | local_rb->snprintf(s,32,"Speed %ld.%02ld %% Secs: %d",(xspeed/100),(xspeed%100),ticks_taken/100); | ||
138 | local_rb->lcd_putsxy(0,60,s); | ||
136 | 139 | ||
137 | local_rb->lcd_update(); | 140 | local_rb->lcd_update(); |
141 | } | ||
138 | } | 142 | } |
139 | 143 | ||
140 | static unsigned char wav_header[44]={'R','I','F','F', // 0 - ChunkID | 144 | static unsigned char wav_header[44]={'R','I','F','F', // 0 - ChunkID |
@@ -176,6 +180,8 @@ int local_init(char* infilename, char* outfilename, file_info_struct* file_info, | |||
176 | file_info->frames_decoded=0; | 180 | file_info->frames_decoded=0; |
177 | file_info->filesize=local_rb->filesize(file_info->infile); | 181 | file_info->filesize=local_rb->filesize(file_info->infile); |
178 | 182 | ||
183 | local_rb->splash(HZ, true, "in: %d, size: %d", file_info->infile, file_info->filesize); | ||
184 | |||
179 | if (file_info->filesize > (bufsize-MALLOC_BUFSIZE)) { | 185 | if (file_info->filesize > (bufsize-MALLOC_BUFSIZE)) { |
180 | local_rb->close(file_info->infile); | 186 | local_rb->close(file_info->infile); |
181 | local_rb->splash(HZ*2, true, "File too large"); | 187 | local_rb->splash(HZ*2, true, "File too large"); |