summaryrefslogtreecommitdiff
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
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
-rw-r--r--apps/settings.h4
-rw-r--r--apps/settings_menu.c1
-rw-r--r--apps/wps.c24
3 files changed, 15 insertions, 14 deletions
diff --git a/apps/settings.h b/apps/settings.h
index d211dcd..36cf493 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -63,10 +63,6 @@ struct user_settings
bool sort_case; /* dir sort order: 0=case insensitive, 1=sensitive */
int scroll_speed; /* long texts scrolling speed: 1-20 */
bool playlist_shuffle;
-#ifdef CUSTOM_WPS
- char custom_wps[64]; /* custom WPS string */
- bool wps_changed; /* to reload Custom WPS if changed to it */
-#endif
/* while playing screen settings */
int wps_display; /* 0=id3, 1=file, 2=parse */
diff --git a/apps/settings_menu.c b/apps/settings_menu.c
index d950bf3..2bb4ef4 100644
--- a/apps/settings_menu.c
+++ b/apps/settings_menu.c
@@ -103,7 +103,6 @@ static Menu wps_set(void)
char* names[] = { "1 Line ID3", "2 Line ID3", "File ",
"Parse ", "Custom WPS " };
set_option("[WPS display]", &global_settings.wps_display, names, 5 );
- global_settings.wps_changed = true;
#else
char* names[] = { "1 Line ID3", "2 Line ID3", "File ",
"Parse " };
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);
}