summaryrefslogtreecommitdiff
path: root/apps/wps.c
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2002-08-24 11:13:35 +0000
committerBjörn Stenberg <bjorn@haxx.se>2002-08-24 11:13:35 +0000
commit26a50afc8a5f25c5fd9aef85d153a4227359f508 (patch)
tree8cdb1c5c67f179b60e0391d2bd8beaaf922bf22f /apps/wps.c
parent165f33467c53dd486ecf2fbdeb76226b8cb16dcb (diff)
downloadrockbox-26a50afc8a5f25c5fd9aef85d153a4227359f508.zip
rockbox-26a50afc8a5f25c5fd9aef85d153a4227359f508.tar.gz
rockbox-26a50afc8a5f25c5fd9aef85d153a4227359f508.tar.bz2
rockbox-26a50afc8a5f25c5fd9aef85d153a4227359f508.tar.xz
global_settings are not for runtime state variables!
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1967 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/wps.c')
-rw-r--r--apps/wps.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/apps/wps.c b/apps/wps.c
index 32bbd0d..bdad325 100644
--- a/apps/wps.c
+++ b/apps/wps.c
@@ -67,8 +67,13 @@ bool device_muted = false;
static bool ff_rewind = false;
static bool paused = false;
+#ifdef CUSTOM_WPS
+static char custom_wps[64];
+#endif
+
static void draw_screen(struct mp3entry* id3)
{
+
int font_height;
#ifdef LOADABLE_FONTS
unsigned char *font = lcd_getcurrentldfont();
@@ -91,10 +96,11 @@ static void draw_screen(struct mp3entry* id3)
else
{
#ifdef CUSTOM_WPS
- if(global_settings.wps_changed) {
- if(global_settings.wps_display == PLAY_DISPLAY_CUSTOM_WPS)
- load_custom_wps();
- global_settings.wps_changed = false;
+ static int last_wps = -1;
+ if ( last_wps != global_settings.wps_display &&
+ global_settings.wps_display == PLAY_DISPLAY_CUSTOM_WPS ) {
+ load_custom_wps();
+ last_wps = global_settings.wps_display;
}
#endif
switch ( global_settings.wps_display ) {
@@ -225,10 +231,10 @@ static void draw_screen(struct mp3entry* id3)
#ifdef CUSTOM_WPS
case PLAY_DISPLAY_CUSTOM_WPS:
{
- if(global_settings.custom_wps[0] == 0)
- snprintf(global_settings.custom_wps, sizeof(global_settings.custom_wps),
+ if(custom_wps[0] == 0)
+ snprintf(custom_wps, sizeof(custom_wps),
"Couldn't Load Custom WPS");
- display_custom_wps(0, 0, true, global_settings.custom_wps);
+ display_custom_wps(0, 0, true, custom_wps);
break;
}
#endif
@@ -247,11 +253,11 @@ bool load_custom_wps(void)
fd = open("/wps.config", O_RDONLY);
if(-1 == fd)
{
- global_settings.custom_wps[0] = 0;
+ custom_wps[0] = 0;
close(fd);
return(false);
}
- read(fd, global_settings.custom_wps, sizeof(global_settings.custom_wps));
+ read(fd, custom_wps, sizeof(custom_wps));
close(fd);
return(true);
}