From a39f566a7f5959d8a85663f0ceccfd468e67af50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Stenberg?= Date: Thu, 16 May 2002 14:48:53 +0000 Subject: [PATCH] Moved play.* to apps/ git-svn-id: svn://svn.rockbox.org/rockbox/trunk@600 a1c6a512-1295-4272-9138-f99709370657 --- {uisimulator => apps}/play.c | 19 +++++++++++++------ {uisimulator => apps}/play.h | 0 2 files changed, 13 insertions(+), 6 deletions(-) rename {uisimulator => apps}/play.c (84%) rename {uisimulator => apps}/play.h (100%) diff --git a/uisimulator/play.c b/apps/play.c similarity index 84% rename from uisimulator/play.c rename to apps/play.c index e93f17672e..89dfa5503e 100644 --- a/uisimulator/play.c +++ b/apps/play.c @@ -17,6 +17,7 @@ * ****************************************************************************/ +#include #include #include @@ -38,11 +39,10 @@ void playtune(char *dir, char *file) { char buffer[256]; - int fd; mp3entry mp3; bool good=1; - sprintf(buffer, "%s/%s", dir, file); + snprintf(buffer, sizeof(buffer), "%s/%s", dir, file); if(mp3info(&mp3, buffer)) { DEBUGF("id3 failure!"); @@ -64,23 +64,26 @@ void playtune(char *dir, char *file) lcd_puts(0, LINE_Y+1, mp3.album?mp3.album:""); lcd_puts(0, LINE_Y+2, mp3.artist?mp3.artist:""); - sprintf(buffer, "%d ms", mp3.length); + snprintf(buffer,sizeof(buffer), "%d ms", mp3.length); lcd_puts(0, LINE_Y+3, buffer); - sprintf(buffer, "%d kbits", mp3.bitrate); + snprintf(buffer,sizeof(buffer), "%d kbits", mp3.bitrate); lcd_puts(0, LINE_Y+4, buffer); - sprintf(buffer, "%d Hz", mp3.frequency); + snprintf(buffer,sizeof(buffer), "%d Hz", mp3.frequency); lcd_puts(0, LINE_Y+5, buffer); #else lcd_puts(0, 0, mp3.artist?mp3.artist:""); lcd_puts(0, 1, mp3.title?mp3.title:""); #endif } + +#ifdef HAVE_LCD_BITMAP lcd_update(); +#endif #ifdef MPEG_PLAY - sprintf(buffer, "%s/%s", dir, file); + snprintf(buffer,sizeof(buffer), "%s/%s", dir, file); mpeg_play(buffer); return; #endif @@ -93,8 +96,12 @@ void playtune(char *dir, char *file) continue; } switch(key) { +#ifdef HAVE_RECORDER_KEYPAD case BUTTON_OFF: case BUTTON_LEFT: +#else + case BUTTON_STOP: +#endif return; break; } diff --git a/uisimulator/play.h b/apps/play.h similarity index 100% rename from uisimulator/play.h rename to apps/play.h