summaryrefslogtreecommitdiffstats
path: root/apps/plugins/wavview.c
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-08-28 21:46:45 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-08-28 21:46:45 +0000
commitab9fd1840b8025336081bd72fb9dbaea7b9909dd (patch)
tree4c410bffcf1a9de2ce55a59bef45e3ecfa183a62 /apps/plugins/wavview.c
parent8418a2c94a97da1d6f42f21dc348aadd1e177d77 (diff)
downloadrockbox-ab9fd1840b8025336081bd72fb9dbaea7b9909dd.tar.gz
rockbox-ab9fd1840b8025336081bd72fb9dbaea7b9909dd.tar.bz2
rockbox-ab9fd1840b8025336081bd72fb9dbaea7b9909dd.zip
plugins: use lcd_putsf/lcd_putsxyf
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27926 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/wavview.c')
-rw-r--r--apps/plugins/wavview.c23
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)
int file;
uint32_t total_bytes_read = 0;
- char tstr[128];
int hours;
int minutes;
int seconds;
@@ -156,25 +155,20 @@ static int readwavpeaks(const char *filename)
rb->lcd_puts_scroll(0, 1, (unsigned char *)filename);
rb->lcd_update();
- rb->snprintf(tstr,127, "Channels: %s",
+ rb->lcd_putsf(0, 2, "Channels: %s",
header.numchannels == 1 ? "mono" : "stereo");
- rb->lcd_puts(0, 2, tstr);
-
- rb->snprintf(tstr,127, "Bits/sample: %d", header.bitspersample);
- rb->lcd_puts(0, 3, tstr);
-
- rb->snprintf(tstr,127, "Samplerate: %d Hz", (int)(header.samplerate));
- rb->lcd_puts(0, 4, tstr);
+ rb->lcd_putsf(0, 3, "Bits/sample: %d", header.bitspersample);
+ rb->lcd_putsf(0, 4, "Samplerate: %"PRIu32" Hz", header.samplerate);
seconds = header.datachunksize / header.byterate;
hours = seconds / 3600;
seconds -= hours * 3600;
minutes = seconds / 60;
seconds -= minutes * 60;
- rb->snprintf(tstr,127, "Length (hh:mm:ss): %02d:%02d:%02d", hours,
- minutes,
- seconds);
- rb->lcd_puts(0, 5, tstr);
+
+ rb->lcd_putsf(0, 5, "Length (hh:mm:ss): %02d:%02d:%02d", hours,
+ minutes,
+ seconds);
rb->lcd_puts(0, 6, "Searching for peaks... ");
rb->lcd_update();
@@ -246,10 +240,9 @@ static int readwavpeaks(const char *filename)
}
/* update progress */
- rb->snprintf(tstr,127, "Searching for peaks... %d%%",(int)
+ rb->lcd_putsf(0, 6, "Searching for peaks... %"PRIu32"%%",
(total_bytes_read / ((header.datachunksize +
sizeof(struct wav_header)) / 100)));
- rb->lcd_puts(0, 6, tstr);
rb->lcd_update();
/* allow user to abort */