diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/wps.c | 59 |
1 files changed, 27 insertions, 32 deletions
diff --git a/apps/wps.c b/apps/wps.c index bc77ba41bc..855220bc22 100644 --- a/apps/wps.c +++ b/apps/wps.c | |||
@@ -40,55 +40,50 @@ | |||
40 | /* demonstrates showing different formats from playtune */ | 40 | /* demonstrates showing different formats from playtune */ |
41 | void wps_show_play(char* filename) | 41 | void wps_show_play(char* filename) |
42 | { | 42 | { |
43 | mp3entry mp3; | 43 | mp3entry mp3; |
44 | mp3info(&mp3,filename); | 44 | mp3info(&mp3,filename); |
45 | 45 | ||
46 | lcd_clear_display(); | 46 | lcd_clear_display(); |
47 | 47 | ||
48 | switch (global_settings.wps_display) | 48 | switch (global_settings.wps_display) |
49 | { | 49 | { |
50 | case PLAY_DISPLAY_TRACK_TITLE: | 50 | case PLAY_DISPLAY_TRACK_TITLE: |
51 | { | 51 | { |
52 | int ch = '/'; | 52 | int ch = '/'; |
53 | char* end; | 53 | char* end; |
54 | char* szTok; | ||
55 | char* szDelimit; | ||
54 | char szArtist[26]; | 56 | char szArtist[26]; |
55 | char szBuff[257]; | 57 | char szBuff[257]; |
56 | szBuff[sizeof(szBuff)-1] = 0; | 58 | szBuff[sizeof(szBuff)-1] = 0; |
57 | 59 | ||
58 | strncpy(szBuff, filename, sizeof(szBuff)); | 60 | strncpy(szBuff, filename, sizeof(szBuff)); |
59 | 61 | ||
60 | char* szTok = strtok_r(szBuff, "/", &end); | 62 | szTok = strtok_r(szBuff, "/", &end); |
61 | szTok = strtok_r(NULL, "/", &end); | 63 | szTok = strtok_r(NULL, "/", &end); |
62 | 64 | ||
63 | // Assume path format of: Genre/Artist/Album/Mp3_file | 65 | // Assume path format of: Genre/Artist/Album/Mp3_file |
64 | strncpy(szArtist,szTok,sizeof(szArtist)); | 66 | strncpy(szArtist,szTok,sizeof(szArtist)); |
65 | szArtist[sizeof(szArtist)-1] = 0; | 67 | szArtist[sizeof(szArtist)-1] = 0; |
66 | char* szDelimit = strrchr(filename, ch); | 68 | szDelimit = strrchr(filename, ch); |
67 | #ifdef HAVE_LCD_BITMAP | ||
68 | lcd_puts(0,0, szArtist?szArtist:"<nothing>"); | 69 | lcd_puts(0,0, szArtist?szArtist:"<nothing>"); |
69 | lcd_puts_scroll(0,LINE_Y,(++szDelimit)); | 70 | lcd_puts_scroll(0,LINE_Y,(++szDelimit)); |
70 | #else | 71 | break; |
71 | lcd_puts(0,0, szArtist?szArtist:"<nothing>"); | 72 | } |
72 | lcd_puts_scroll(0,1,(++szDelimit)); | 73 | case PLAY_DISPLAY_FILENAME_SCROLL: |
73 | #endif | 74 | { |
74 | break; | 75 | int ch = '/'; |
75 | } | 76 | char* szLast = strrchr(filename, ch); |
76 | case PLAY_DISPLAY_FILENAME_SCROLL: | 77 | |
77 | { | 78 | if (szLast) |
78 | int ch = '/'; | 79 | lcd_puts_scroll(0,0, (++szLast)); |
79 | char* szLast = strrchr(filename, ch); | 80 | else |
80 | 81 | lcd_puts_scroll(0,0, mp3.path); | |
81 | if (szLast) | 82 | |
82 | { | 83 | break; |
83 | lcd_puts_scroll(0,0, (++szLast)); | 84 | } |
84 | } else { | 85 | case PLAY_DISPLAY_DEFAULT: |
85 | lcd_puts_scroll(0,0, mp3.path); | 86 | { |
86 | } | ||
87 | |||
88 | break; | ||
89 | } | ||
90 | case PLAY_DISPLAY_DEFAULT: | ||
91 | { | ||
92 | #ifdef HAVE_LCD_BITMAP | 87 | #ifdef HAVE_LCD_BITMAP |
93 | char buffer[256]; | 88 | char buffer[256]; |
94 | 89 | ||