diff options
Diffstat (limited to 'apps/wps.c')
-rw-r--r-- | apps/wps.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/apps/wps.c b/apps/wps.c index 32bbd0de9d..bdad325434 100644 --- a/apps/wps.c +++ b/apps/wps.c | |||
@@ -67,8 +67,13 @@ bool device_muted = false; | |||
67 | static bool ff_rewind = false; | 67 | static bool ff_rewind = false; |
68 | static bool paused = false; | 68 | static bool paused = false; |
69 | 69 | ||
70 | #ifdef CUSTOM_WPS | ||
71 | static char custom_wps[64]; | ||
72 | #endif | ||
73 | |||
70 | static void draw_screen(struct mp3entry* id3) | 74 | static void draw_screen(struct mp3entry* id3) |
71 | { | 75 | { |
76 | |||
72 | int font_height; | 77 | int font_height; |
73 | #ifdef LOADABLE_FONTS | 78 | #ifdef LOADABLE_FONTS |
74 | unsigned char *font = lcd_getcurrentldfont(); | 79 | unsigned char *font = lcd_getcurrentldfont(); |
@@ -91,10 +96,11 @@ static void draw_screen(struct mp3entry* id3) | |||
91 | else | 96 | else |
92 | { | 97 | { |
93 | #ifdef CUSTOM_WPS | 98 | #ifdef CUSTOM_WPS |
94 | if(global_settings.wps_changed) { | 99 | static int last_wps = -1; |
95 | if(global_settings.wps_display == PLAY_DISPLAY_CUSTOM_WPS) | 100 | if ( last_wps != global_settings.wps_display && |
96 | load_custom_wps(); | 101 | global_settings.wps_display == PLAY_DISPLAY_CUSTOM_WPS ) { |
97 | global_settings.wps_changed = false; | 102 | load_custom_wps(); |
103 | last_wps = global_settings.wps_display; | ||
98 | } | 104 | } |
99 | #endif | 105 | #endif |
100 | switch ( global_settings.wps_display ) { | 106 | switch ( global_settings.wps_display ) { |
@@ -225,10 +231,10 @@ static void draw_screen(struct mp3entry* id3) | |||
225 | #ifdef CUSTOM_WPS | 231 | #ifdef CUSTOM_WPS |
226 | case PLAY_DISPLAY_CUSTOM_WPS: | 232 | case PLAY_DISPLAY_CUSTOM_WPS: |
227 | { | 233 | { |
228 | if(global_settings.custom_wps[0] == 0) | 234 | if(custom_wps[0] == 0) |
229 | snprintf(global_settings.custom_wps, sizeof(global_settings.custom_wps), | 235 | snprintf(custom_wps, sizeof(custom_wps), |
230 | "Couldn't Load Custom WPS"); | 236 | "Couldn't Load Custom WPS"); |
231 | display_custom_wps(0, 0, true, global_settings.custom_wps); | 237 | display_custom_wps(0, 0, true, custom_wps); |
232 | break; | 238 | break; |
233 | } | 239 | } |
234 | #endif | 240 | #endif |
@@ -247,11 +253,11 @@ bool load_custom_wps(void) | |||
247 | fd = open("/wps.config", O_RDONLY); | 253 | fd = open("/wps.config", O_RDONLY); |
248 | if(-1 == fd) | 254 | if(-1 == fd) |
249 | { | 255 | { |
250 | global_settings.custom_wps[0] = 0; | 256 | custom_wps[0] = 0; |
251 | close(fd); | 257 | close(fd); |
252 | return(false); | 258 | return(false); |
253 | } | 259 | } |
254 | read(fd, global_settings.custom_wps, sizeof(global_settings.custom_wps)); | 260 | read(fd, custom_wps, sizeof(custom_wps)); |
255 | close(fd); | 261 | close(fd); |
256 | return(true); | 262 | return(true); |
257 | } | 263 | } |