diff options
author | Björn Stenberg <bjorn@haxx.se> | 2002-08-24 11:13:35 +0000 |
---|---|---|
committer | Björn Stenberg <bjorn@haxx.se> | 2002-08-24 11:13:35 +0000 |
commit | 26a50afc8a5f25c5fd9aef85d153a4227359f508 (patch) | |
tree | 8cdb1c5c67f179b60e0391d2bd8beaaf922bf22f | |
parent | 165f33467c53dd486ecf2fbdeb76226b8cb16dcb (diff) | |
download | rockbox-26a50afc8a5f25c5fd9aef85d153a4227359f508.tar.gz rockbox-26a50afc8a5f25c5fd9aef85d153a4227359f508.zip |
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.h | 4 | ||||
-rw-r--r-- | apps/settings_menu.c | 1 | ||||
-rw-r--r-- | apps/wps.c | 24 |
3 files changed, 15 insertions, 14 deletions
diff --git a/apps/settings.h b/apps/settings.h index d211dcdf1a..36cf4930e1 100644 --- a/apps/settings.h +++ b/apps/settings.h | |||
@@ -63,10 +63,6 @@ struct user_settings | |||
63 | bool sort_case; /* dir sort order: 0=case insensitive, 1=sensitive */ | 63 | bool sort_case; /* dir sort order: 0=case insensitive, 1=sensitive */ |
64 | int scroll_speed; /* long texts scrolling speed: 1-20 */ | 64 | int scroll_speed; /* long texts scrolling speed: 1-20 */ |
65 | bool playlist_shuffle; | 65 | bool playlist_shuffle; |
66 | #ifdef CUSTOM_WPS | ||
67 | char custom_wps[64]; /* custom WPS string */ | ||
68 | bool wps_changed; /* to reload Custom WPS if changed to it */ | ||
69 | #endif | ||
70 | 66 | ||
71 | /* while playing screen settings */ | 67 | /* while playing screen settings */ |
72 | int wps_display; /* 0=id3, 1=file, 2=parse */ | 68 | int wps_display; /* 0=id3, 1=file, 2=parse */ |
diff --git a/apps/settings_menu.c b/apps/settings_menu.c index d950bf3b63..2bb4ef4481 100644 --- a/apps/settings_menu.c +++ b/apps/settings_menu.c | |||
@@ -103,7 +103,6 @@ static Menu wps_set(void) | |||
103 | char* names[] = { "1 Line ID3", "2 Line ID3", "File ", | 103 | char* names[] = { "1 Line ID3", "2 Line ID3", "File ", |
104 | "Parse ", "Custom WPS " }; | 104 | "Parse ", "Custom WPS " }; |
105 | set_option("[WPS display]", &global_settings.wps_display, names, 5 ); | 105 | set_option("[WPS display]", &global_settings.wps_display, names, 5 ); |
106 | global_settings.wps_changed = true; | ||
107 | #else | 106 | #else |
108 | char* names[] = { "1 Line ID3", "2 Line ID3", "File ", | 107 | char* names[] = { "1 Line ID3", "2 Line ID3", "File ", |
109 | "Parse " }; | 108 | "Parse " }; |
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 | } |