diff options
Diffstat (limited to 'apps/plugins/wavview.c')
-rw-r--r-- | apps/plugins/wavview.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/apps/plugins/wavview.c b/apps/plugins/wavview.c index ddf72e10af..25afa40901 100644 --- a/apps/plugins/wavview.c +++ b/apps/plugins/wavview.c | |||
@@ -109,7 +109,6 @@ static int readwavpeaks(const char *filename) | |||
109 | 109 | ||
110 | int file; | 110 | int file; |
111 | uint32_t total_bytes_read = 0; | 111 | uint32_t total_bytes_read = 0; |
112 | char tstr[128]; | ||
113 | int hours; | 112 | int hours; |
114 | int minutes; | 113 | int minutes; |
115 | int seconds; | 114 | int seconds; |
@@ -156,25 +155,20 @@ static int readwavpeaks(const char *filename) | |||
156 | rb->lcd_puts_scroll(0, 1, (unsigned char *)filename); | 155 | rb->lcd_puts_scroll(0, 1, (unsigned char *)filename); |
157 | rb->lcd_update(); | 156 | rb->lcd_update(); |
158 | 157 | ||
159 | rb->snprintf(tstr,127, "Channels: %s", | 158 | rb->lcd_putsf(0, 2, "Channels: %s", |
160 | header.numchannels == 1 ? "mono" : "stereo"); | 159 | header.numchannels == 1 ? "mono" : "stereo"); |
161 | rb->lcd_puts(0, 2, tstr); | 160 | rb->lcd_putsf(0, 3, "Bits/sample: %d", header.bitspersample); |
162 | 161 | rb->lcd_putsf(0, 4, "Samplerate: %"PRIu32" Hz", header.samplerate); | |
163 | rb->snprintf(tstr,127, "Bits/sample: %d", header.bitspersample); | ||
164 | rb->lcd_puts(0, 3, tstr); | ||
165 | |||
166 | rb->snprintf(tstr,127, "Samplerate: %d Hz", (int)(header.samplerate)); | ||
167 | rb->lcd_puts(0, 4, tstr); | ||
168 | 162 | ||
169 | seconds = header.datachunksize / header.byterate; | 163 | seconds = header.datachunksize / header.byterate; |
170 | hours = seconds / 3600; | 164 | hours = seconds / 3600; |
171 | seconds -= hours * 3600; | 165 | seconds -= hours * 3600; |
172 | minutes = seconds / 60; | 166 | minutes = seconds / 60; |
173 | seconds -= minutes * 60; | 167 | seconds -= minutes * 60; |
174 | rb->snprintf(tstr,127, "Length (hh:mm:ss): %02d:%02d:%02d", hours, | 168 | |
175 | minutes, | 169 | rb->lcd_putsf(0, 5, "Length (hh:mm:ss): %02d:%02d:%02d", hours, |
176 | seconds); | 170 | minutes, |
177 | rb->lcd_puts(0, 5, tstr); | 171 | seconds); |
178 | rb->lcd_puts(0, 6, "Searching for peaks... "); | 172 | rb->lcd_puts(0, 6, "Searching for peaks... "); |
179 | rb->lcd_update(); | 173 | rb->lcd_update(); |
180 | 174 | ||
@@ -246,10 +240,9 @@ static int readwavpeaks(const char *filename) | |||
246 | } | 240 | } |
247 | 241 | ||
248 | /* update progress */ | 242 | /* update progress */ |
249 | rb->snprintf(tstr,127, "Searching for peaks... %d%%",(int) | 243 | rb->lcd_putsf(0, 6, "Searching for peaks... %"PRIu32"%%", |
250 | (total_bytes_read / ((header.datachunksize + | 244 | (total_bytes_read / ((header.datachunksize + |
251 | sizeof(struct wav_header)) / 100))); | 245 | sizeof(struct wav_header)) / 100))); |
252 | rb->lcd_puts(0, 6, tstr); | ||
253 | rb->lcd_update(); | 246 | rb->lcd_update(); |
254 | 247 | ||
255 | /* allow user to abort */ | 248 | /* allow user to abort */ |