summaryrefslogtreecommitdiff
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.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)
135// Here is a hacked up printf command to get the output from the game. 135// Here is a hacked up printf command to get the output from the game.
136int printf(const char *fmt, ...) 136int printf(const char *fmt, ...)
137{ 137{
138 static int p_xtpt = 0; 138 static int p_xtpt = 0;
139 char p_buf[50]; 139 char p_buf[50];
140 bool ok; 140 bool ok;
141 va_list ap; 141 va_list ap;
142 142
143 va_start(ap, fmt); 143 va_start(ap, fmt);
144 ok = rb->vsnprintf(p_buf,sizeof(p_buf), fmt, ap); 144 ok = rb->vsnprintf(p_buf,sizeof(p_buf), fmt, ap);
145 va_end(ap); 145 va_end(ap);
146 146
147 rb->lcd_putsxy(1,p_xtpt, (unsigned char *)p_buf); 147 int i=0;
148 rb->lcd_update(); 148
149 149 /* Device LCDs display newlines funny. */
150 p_xtpt+=8; 150 for(i=0; p_buf[i]!=0; i++)
151 if(p_xtpt>LCD_HEIGHT-8) 151 if(p_buf[i] == '\n')
152 { 152 p_buf[i] = ' ';
153 p_xtpt=0; 153
154 rb->lcd_clear_display(); 154 rb->lcd_putsxy(1,p_xtpt, (unsigned char *)p_buf);
155 } 155 rb->lcd_update();
156 return 1; 156
157 p_xtpt+=8;
158 if(p_xtpt>LCD_HEIGHT-8)
159 {
160 p_xtpt=0;
161 rb->lcd_clear_display();
162 }
163 return 1;
157} 164}
158 165
159void exit(int code) 166void exit(int code)