diff options
author | Björn Stenberg <bjorn@haxx.se> | 2002-05-16 14:48:53 +0000 |
---|---|---|
committer | Björn Stenberg <bjorn@haxx.se> | 2002-05-16 14:48:53 +0000 |
commit | a39f566a7f5959d8a85663f0ceccfd468e67af50 (patch) | |
tree | f0aff264eccdbc86d34e9c17583a34781aa796d1 | |
parent | 244688e5c2b990393b5e309abfd1f9bf0e379636 (diff) | |
download | rockbox-a39f566a7f5959d8a85663f0ceccfd468e67af50.tar.gz rockbox-a39f566a7f5959d8a85663f0ceccfd468e67af50.zip |
Moved play.* to apps/
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@600 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/play.c (renamed from uisimulator/play.c) | 19 | ||||
-rw-r--r-- | apps/play.h (renamed from uisimulator/play.h) | 0 |
2 files changed, 13 insertions, 6 deletions
diff --git a/uisimulator/play.c b/apps/play.c index e93f17672e..89dfa5503e 100644 --- a/uisimulator/play.c +++ b/apps/play.c | |||
@@ -17,6 +17,7 @@ | |||
17 | * | 17 | * |
18 | ****************************************************************************/ | 18 | ****************************************************************************/ |
19 | 19 | ||
20 | #include <stdio.h> | ||
20 | #include <string.h> | 21 | #include <string.h> |
21 | #include <stdlib.h> | 22 | #include <stdlib.h> |
22 | 23 | ||
@@ -38,11 +39,10 @@ | |||
38 | void playtune(char *dir, char *file) | 39 | void playtune(char *dir, char *file) |
39 | { | 40 | { |
40 | char buffer[256]; | 41 | char buffer[256]; |
41 | int fd; | ||
42 | mp3entry mp3; | 42 | mp3entry mp3; |
43 | bool good=1; | 43 | bool good=1; |
44 | 44 | ||
45 | sprintf(buffer, "%s/%s", dir, file); | 45 | snprintf(buffer, sizeof(buffer), "%s/%s", dir, file); |
46 | 46 | ||
47 | if(mp3info(&mp3, buffer)) { | 47 | if(mp3info(&mp3, buffer)) { |
48 | DEBUGF("id3 failure!"); | 48 | DEBUGF("id3 failure!"); |
@@ -64,23 +64,26 @@ void playtune(char *dir, char *file) | |||
64 | lcd_puts(0, LINE_Y+1, mp3.album?mp3.album:""); | 64 | lcd_puts(0, LINE_Y+1, mp3.album?mp3.album:""); |
65 | lcd_puts(0, LINE_Y+2, mp3.artist?mp3.artist:""); | 65 | lcd_puts(0, LINE_Y+2, mp3.artist?mp3.artist:""); |
66 | 66 | ||
67 | sprintf(buffer, "%d ms", mp3.length); | 67 | snprintf(buffer,sizeof(buffer), "%d ms", mp3.length); |
68 | lcd_puts(0, LINE_Y+3, buffer); | 68 | lcd_puts(0, LINE_Y+3, buffer); |
69 | 69 | ||
70 | sprintf(buffer, "%d kbits", mp3.bitrate); | 70 | snprintf(buffer,sizeof(buffer), "%d kbits", mp3.bitrate); |
71 | lcd_puts(0, LINE_Y+4, buffer); | 71 | lcd_puts(0, LINE_Y+4, buffer); |
72 | 72 | ||
73 | sprintf(buffer, "%d Hz", mp3.frequency); | 73 | snprintf(buffer,sizeof(buffer), "%d Hz", mp3.frequency); |
74 | lcd_puts(0, LINE_Y+5, buffer); | 74 | lcd_puts(0, LINE_Y+5, buffer); |
75 | #else | 75 | #else |
76 | lcd_puts(0, 0, mp3.artist?mp3.artist:"<no artist>"); | 76 | lcd_puts(0, 0, mp3.artist?mp3.artist:"<no artist>"); |
77 | lcd_puts(0, 1, mp3.title?mp3.title:"<no title>"); | 77 | lcd_puts(0, 1, mp3.title?mp3.title:"<no title>"); |
78 | #endif | 78 | #endif |
79 | } | 79 | } |
80 | |||
81 | #ifdef HAVE_LCD_BITMAP | ||
80 | lcd_update(); | 82 | lcd_update(); |
83 | #endif | ||
81 | 84 | ||
82 | #ifdef MPEG_PLAY | 85 | #ifdef MPEG_PLAY |
83 | sprintf(buffer, "%s/%s", dir, file); | 86 | snprintf(buffer,sizeof(buffer), "%s/%s", dir, file); |
84 | mpeg_play(buffer); | 87 | mpeg_play(buffer); |
85 | return; | 88 | return; |
86 | #endif | 89 | #endif |
@@ -93,8 +96,12 @@ void playtune(char *dir, char *file) | |||
93 | continue; | 96 | continue; |
94 | } | 97 | } |
95 | switch(key) { | 98 | switch(key) { |
99 | #ifdef HAVE_RECORDER_KEYPAD | ||
96 | case BUTTON_OFF: | 100 | case BUTTON_OFF: |
97 | case BUTTON_LEFT: | 101 | case BUTTON_LEFT: |
102 | #else | ||
103 | case BUTTON_STOP: | ||
104 | #endif | ||
98 | return; | 105 | return; |
99 | break; | 106 | break; |
100 | } | 107 | } |
diff --git a/uisimulator/play.h b/apps/play.h index b63df29c82..b63df29c82 100644 --- a/uisimulator/play.h +++ b/apps/play.h | |||