From 59acdc336b4e7856b32c374f8caec2d5b5b6fa74 Mon Sep 17 00:00:00 2001 From: Stepan Moskovchenko Date: Wed, 2 Jan 2008 06:35:59 +0000 Subject: MIDI player: Allow pause and seeking during pause. Print out the play/pause/seek position in seconds. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15985 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/midi/midiutil.c | 45 +++++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 19 deletions(-) (limited to 'apps/plugins/midi/midiutil.c') diff --git a/apps/plugins/midi/midiutil.c b/apps/plugins/midi/midiutil.c index 65ba9c8989..3cb4a9e0fb 100644 --- a/apps/plugins/midi/midiutil.c +++ b/apps/plugins/midi/midiutil.c @@ -135,25 +135,32 @@ int eof(int fd) // Here is a hacked up printf command to get the output from the game. int printf(const char *fmt, ...) { - static int p_xtpt = 0; - char p_buf[50]; - bool ok; - va_list ap; - - va_start(ap, fmt); - ok = rb->vsnprintf(p_buf,sizeof(p_buf), fmt, ap); - va_end(ap); - - rb->lcd_putsxy(1,p_xtpt, (unsigned char *)p_buf); - rb->lcd_update(); - - p_xtpt+=8; - if(p_xtpt>LCD_HEIGHT-8) - { - p_xtpt=0; - rb->lcd_clear_display(); - } - return 1; + static int p_xtpt = 0; + char p_buf[50]; + bool ok; + va_list ap; + + va_start(ap, fmt); + ok = rb->vsnprintf(p_buf,sizeof(p_buf), fmt, ap); + va_end(ap); + + int i=0; + + /* Device LCDs display newlines funny. */ + for(i=0; p_buf[i]!=0; i++) + if(p_buf[i] == '\n') + p_buf[i] = ' '; + + rb->lcd_putsxy(1,p_xtpt, (unsigned char *)p_buf); + rb->lcd_update(); + + p_xtpt+=8; + if(p_xtpt>LCD_HEIGHT-8) + { + p_xtpt=0; + rb->lcd_clear_display(); + } + return 1; } void exit(int code) -- cgit