summaryrefslogtreecommitdiff
path: root/apps/gui/wps.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/wps.c')
-rw-r--r--apps/gui/wps.c30
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
76static int wpsbars; 76static int wpsbars;
77/* currently only one wps_state is needed */ 77/* currently only one wps_state is needed */
78struct wps_state wps_state; 78static struct wps_state wps_state;
79struct gui_wps gui_wps[NB_SCREENS]; 79static struct gui_wps gui_wps[NB_SCREENS];
80static struct wps_data wps_datas[NB_SCREENS]; 80static 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
93void 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
101void wps_data_init(enum screen_type screen)
102{
103 skin_data_init(gui_wps[screen].data);
104}
105
93bool wps_fading_out = false; 106bool wps_fading_out = false;
94void fade(bool fade_in, bool updatewps) 107void 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
168bool ffwd_rew(int button) 182bool 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 1218bool wps_uses_albumart(int *width, int *height)
1205 tag in its wps structure */
1206bool 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}