summaryrefslogtreecommitdiffstats
path: root/apps/plugins/midi/midiutil.c
diff options
context:
space:
mode:
authorStepan Moskovchenko <stevenm@rockbox.org>2008-01-02 06:35:59 +0000
committerStepan Moskovchenko <stevenm@rockbox.org>2008-01-02 06:35:59 +0000
commit59acdc336b4e7856b32c374f8caec2d5b5b6fa74 (patch)
tree752dd39a8b268bbe4cfcf7bb82752aed56136b9d /apps/plugins/midi/midiutil.c
parenta39039d80b2896e69cb5d12ab7c1e17bdf43700f (diff)
downloadrockbox-59acdc336b4e7856b32c374f8caec2d5b5b6fa74.tar.gz
rockbox-59acdc336b4e7856b32c374f8caec2d5b5b6fa74.tar.bz2
rockbox-59acdc336b4e7856b32c374f8caec2d5b5b6fa74.zip
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
Diffstat (limited to 'apps/plugins/midi/midiutil.c')
-rw-r--r--apps/plugins/midi/midiutil.c45
1 files changed, 26 insertions, 19 deletions
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)