diff options
author | Thomas Martitz <kugel@rockbox.org> | 2009-08-03 15:06:30 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2009-08-03 15:06:30 +0000 |
commit | 3b75c86d74937a6bffcb371bb08bdfb182db9d2b (patch) | |
tree | 3be12a89b7a5377a31a46b48e672e08af36ac949 /apps/gui/wps.c | |
parent | 0dc5cc8002e3d30fc7ae7ddf7f33a56c8b136e7e (diff) | |
download | rockbox-3b75c86d74937a6bffcb371bb08bdfb182db9d2b.tar.gz rockbox-3b75c86d74937a6bffcb371bb08bdfb182db9d2b.zip |
A bit mroe wps/skin engine cleanup so that the structs the wps uses can be static:
-add wrappers wps_data_load() and wps_data_init() so that other code doesn't need the structs for that
-change (and rename) gui_sync_wps_uses_albumart() to take points to be filled as parameter to get the AA size of a wps
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22139 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/wps.c')
-rw-r--r-- | apps/gui/wps.c | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/apps/gui/wps.c b/apps/gui/wps.c index 4a7de875d2..447c1d6b00 100644 --- a/apps/gui/wps.c +++ b/apps/gui/wps.c | |||
@@ -75,8 +75,8 @@ | |||
75 | 75 | ||
76 | static int wpsbars; | 76 | static int wpsbars; |
77 | /* currently only one wps_state is needed */ | 77 | /* currently only one wps_state is needed */ |
78 | struct wps_state wps_state; | 78 | static struct wps_state wps_state; |
79 | struct gui_wps gui_wps[NB_SCREENS]; | 79 | static struct gui_wps gui_wps[NB_SCREENS]; |
80 | static struct wps_data wps_datas[NB_SCREENS]; | 80 | static struct wps_data wps_datas[NB_SCREENS]; |
81 | 81 | ||
82 | /* initial setup of wps_data */ | 82 | /* initial setup of wps_data */ |
@@ -90,6 +90,19 @@ static void nextid3available_callback(void* param); | |||
90 | /* 3% of 30min file == 54s step size */ | 90 | /* 3% of 30min file == 54s step size */ |
91 | #define MIN_FF_REWIND_STEP 500 | 91 | #define MIN_FF_REWIND_STEP 500 |
92 | 92 | ||
93 | void wps_data_load(enum screen_type screen, const char *buf, bool is_file) | ||
94 | { | ||
95 | skin_data_load(gui_wps[screen].data, &screens[screen], buf, is_file); | ||
96 | #ifdef HAVE_REMOVE_LCD | ||
97 | gui_wps[screen].data->remote_wps = !(screen == SCREEN_MAIN); | ||
98 | #endif | ||
99 | } | ||
100 | |||
101 | void wps_data_init(enum screen_type screen) | ||
102 | { | ||
103 | skin_data_init(gui_wps[screen].data); | ||
104 | } | ||
105 | |||
93 | bool wps_fading_out = false; | 106 | bool wps_fading_out = false; |
94 | void fade(bool fade_in, bool updatewps) | 107 | void fade(bool fade_in, bool updatewps) |
95 | { | 108 | { |
@@ -165,6 +178,7 @@ bool update_onvol_change(struct gui_wps * gwps) | |||
165 | return false; | 178 | return false; |
166 | } | 179 | } |
167 | 180 | ||
181 | |||
168 | bool ffwd_rew(int button) | 182 | bool ffwd_rew(int button) |
169 | { | 183 | { |
170 | unsigned int step = 0; /* current ff/rewind step */ | 184 | unsigned int step = 0; /* current ff/rewind step */ |
@@ -1176,7 +1190,7 @@ void gui_sync_wps_init(void) | |||
1176 | int i; | 1190 | int i; |
1177 | FOR_NB_SCREENS(i) | 1191 | FOR_NB_SCREENS(i) |
1178 | { | 1192 | { |
1179 | wps_data_init(&wps_datas[i]); | 1193 | skin_data_init(&wps_datas[i]); |
1180 | #ifdef HAVE_ALBUMART | 1194 | #ifdef HAVE_ALBUMART |
1181 | wps_datas[i].wps_uses_albumart = 0; | 1195 | wps_datas[i].wps_uses_albumart = 0; |
1182 | #endif | 1196 | #endif |
@@ -1201,15 +1215,19 @@ void gui_sync_wps_init(void) | |||
1201 | } | 1215 | } |
1202 | 1216 | ||
1203 | #ifdef HAVE_ALBUMART | 1217 | #ifdef HAVE_ALBUMART |
1204 | /* Returns true if at least one of the gui_wps screens has an album art | 1218 | bool wps_uses_albumart(int *width, int *height) |
1205 | tag in its wps structure */ | ||
1206 | bool gui_sync_wps_uses_albumart(void) | ||
1207 | { | 1219 | { |
1208 | int i; | 1220 | int i; |
1209 | FOR_NB_SCREENS(i) { | 1221 | FOR_NB_SCREENS(i) { |
1210 | struct gui_wps *gwps = &gui_wps[i]; | 1222 | struct gui_wps *gwps = &gui_wps[i]; |
1211 | if (gwps->data && (gwps->data->wps_uses_albumart != WPS_ALBUMART_NONE)) | 1223 | if (gwps->data && (gwps->data->wps_uses_albumart != WPS_ALBUMART_NONE)) |
1224 | { | ||
1225 | if (width) | ||
1226 | *width = gui_wps[0].data->albumart_max_width; | ||
1227 | if (height) | ||
1228 | *height = gui_wps[0].data->albumart_max_height; | ||
1212 | return true; | 1229 | return true; |
1230 | } | ||
1213 | } | 1231 | } |
1214 | return false; | 1232 | return false; |
1215 | } | 1233 | } |