Makefile overhaul. All generated bitmaps are now explicitly in OBJDIR/bitmaps and...
[kugel-rb.git] / apps / gui / gwps.c
blob9b6d6b555811fab3dc78cd1bc13868d9d07ecbac
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2002 Jerome Kuptz
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
21 #include <stdio.h>
22 #include <string.h>
23 #include <stdlib.h>
24 #include "config.h"
26 #include "system.h"
27 #include "file.h"
28 #include "lcd.h"
29 #include "font.h"
30 #include "backlight.h"
31 #include "action.h"
32 #include "kernel.h"
33 #include "filetypes.h"
34 #include "debug.h"
35 #include "sprintf.h"
36 #include "settings.h"
37 #include "gwps.h"
38 #include "gwps-common.h"
39 #include "audio.h"
40 #include "usb.h"
41 #include "status.h"
42 #include "storage.h"
43 #include "screens.h"
44 #include "playlist.h"
45 #ifdef HAVE_LCD_BITMAP
46 #include "icons.h"
47 #include "peakmeter.h"
48 #endif
49 #include "action.h"
50 #include "lang.h"
51 #include "bookmark.h"
52 #include "misc.h"
53 #include "sound.h"
54 #include "onplay.h"
55 #include "abrepeat.h"
56 #include "playback.h"
57 #include "splash.h"
58 #include "cuesheet.h"
59 #include "ata_idle_notify.h"
60 #include "root_menu.h"
61 #include "backdrop.h"
62 #include "quickscreen.h"
63 #include "pitchscreen.h"
64 #include "appevents.h"
66 /* currently only on wps_state is needed */
67 struct wps_state wps_state;
68 struct gui_wps gui_wps[NB_SCREENS];
69 static struct wps_data wps_datas[NB_SCREENS];
71 /* change the path to the current played track */
72 static void wps_state_update_ctp(const char *path);
73 /* initial setup of wps_data */
74 static void wps_state_init(void);
75 /* initial setup of a wps */
76 static void gui_wps_init(struct gui_wps *gui_wps);
77 /* connects a wps with a format-description of the displayed content */
78 static void gui_wps_set_data(struct gui_wps *gui_wps, struct wps_data *data);
79 /* connects a wps with a screen */
80 static void gui_wps_set_disp(struct gui_wps *gui_wps, struct screen *display);
81 /* connects a wps with a statusbar*/
82 static void gui_wps_set_statusbar(struct gui_wps *gui_wps, struct gui_statusbar *statusbar);
84 static void prev_track(unsigned skip_thresh)
86 if (!wps_state.id3 || (wps_state.id3->elapsed < skip_thresh*1000)) {
87 audio_prev();
89 else {
90 if (cuesheet_is_enabled() && wps_state.id3->cuesheet_type)
92 curr_cuesheet_skip(-1, wps_state.id3->elapsed);
93 return;
96 if (!wps_state.paused)
97 #if (CONFIG_CODEC == SWCODEC)
98 audio_pre_ff_rewind();
99 #else
100 audio_pause();
101 #endif
103 audio_ff_rewind(0);
105 #if (CONFIG_CODEC != SWCODEC)
106 if (!wps_state.paused)
107 audio_resume();
108 #endif
112 static void next_track(void)
114 /* take care of if we're playing a cuesheet */
115 if (cuesheet_is_enabled() && wps_state.id3->cuesheet_type)
117 if (curr_cuesheet_skip(1, wps_state.id3->elapsed))
119 /* if the result was false, then we really want
120 to skip to the next track */
121 return;
125 audio_next();
129 long gui_wps_show(void)
131 long button = 0;
132 bool restore = false;
133 long restoretimer = 0; /* timer to delay screen redraw temporarily */
134 bool exit = false;
135 bool bookmark = false;
136 bool update_track = false;
137 int i;
138 long last_left = 0, last_right = 0;
140 wps_state_init();
142 #ifdef HAVE_LCD_CHARCELLS
143 status_set_audio(true);
144 status_set_param(false);
145 #else
146 #if LCD_DEPTH > 1
147 show_wps_backdrop();
148 #endif /* LCD_DEPTH > 1 */
149 #endif
151 #if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
152 show_remote_wps_backdrop();
153 #endif
155 #ifdef AB_REPEAT_ENABLE
156 ab_repeat_init();
157 ab_reset_markers();
158 #endif
160 if(audio_status() & AUDIO_STATUS_PLAY)
162 wps_state.id3 = audio_current_track();
163 wps_state.nid3 = audio_next_track();
164 if (wps_state.id3) {
165 if (gui_wps_display())
166 return 0;
167 FOR_NB_SCREENS(i)
168 gui_wps_refresh(&gui_wps[i], 0, WPS_REFRESH_ALL);
169 wps_state_update_ctp(wps_state.id3->path);
172 restore = true;
174 while ( 1 )
176 bool audio_paused = (audio_status() & AUDIO_STATUS_PAUSE)?true:false;
178 /* did someone else (i.e power thread) change audio pause mode? */
179 if (wps_state.paused != audio_paused) {
180 wps_state.paused = audio_paused;
182 /* if another thread paused audio, we are probably in car mode,
183 about to shut down. lets save the settings. */
184 if (wps_state.paused) {
185 settings_save();
186 #if !defined(HAVE_RTC_RAM) && !defined(HAVE_SW_POWEROFF)
187 call_storage_idle_notifys(true);
188 #endif
192 #ifdef HAVE_LCD_BITMAP
193 /* when the peak meter is enabled we want to have a
194 few extra updates to make it look smooth. On the
195 other hand we don't want to waste energy if it
196 isn't displayed */
197 bool pm=false;
198 FOR_NB_SCREENS(i)
200 if(gui_wps[i].data->peak_meter_enabled)
201 pm = true;
204 if (pm) {
205 long next_refresh = current_tick;
206 long next_big_refresh = current_tick + HZ / 5;
207 button = BUTTON_NONE;
208 while (TIME_BEFORE(current_tick, next_big_refresh)) {
209 button = get_action(CONTEXT_WPS|ALLOW_SOFTLOCK,TIMEOUT_NOBLOCK);
210 if (button != ACTION_NONE) {
211 break;
213 peak_meter_peek();
214 sleep(0); /* Sleep until end of current tick. */
216 if (TIME_AFTER(current_tick, next_refresh)) {
217 FOR_NB_SCREENS(i)
219 if(gui_wps[i].data->peak_meter_enabled)
220 gui_wps_refresh(&gui_wps[i], 0,
221 WPS_REFRESH_PEAK_METER);
222 next_refresh += HZ / PEAK_METER_FPS;
229 /* The peak meter is disabled
230 -> no additional screen updates needed */
231 else {
232 button = get_action(CONTEXT_WPS|ALLOW_SOFTLOCK,HZ/5);
234 #else
235 button = get_action(CONTEXT_WPS|ALLOW_SOFTLOCK,HZ/5);
236 #endif
238 /* Exit if audio has stopped playing. This can happen if using the
239 sleep timer with the charger plugged or if starting a recording
240 from F1 */
241 if (!audio_status())
242 exit = true;
243 /* The iPods/X5/M5 use a single button for the A-B mode markers,
244 defined as ACTION_WPSAB_SINGLE in their config files. */
245 #ifdef ACTION_WPSAB_SINGLE
246 if (!global_settings.party_mode && ab_repeat_mode_enabled())
248 static int wps_ab_state = 0;
249 if (button == ACTION_WPSAB_SINGLE)
251 switch (wps_ab_state)
253 case 0: /* set the A spot */
254 button = ACTION_WPS_ABSETA_PREVDIR;
255 break;
256 case 1: /* set the B spot */
257 button = ACTION_WPS_ABSETB_NEXTDIR;
258 break;
259 case 2:
260 button = ACTION_WPS_ABRESET;
261 break;
263 wps_ab_state = (wps_ab_state+1) % 3;
266 #endif
267 switch(button)
269 case ACTION_WPS_CONTEXT:
270 #if LCD_DEPTH > 1
271 show_main_backdrop();
272 #endif
273 #if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
274 show_remote_main_backdrop();
275 #endif
276 /* if music is stopped in the context menu we want to exit the wps */
277 if (onplay(wps_state.id3->path,
278 FILE_ATTR_AUDIO, CONTEXT_WPS) == ONPLAY_MAINMENU
279 || !audio_status())
280 return GO_TO_ROOT;
282 /* track might have changed */
283 update_track = true;
285 #if LCD_DEPTH > 1
286 show_wps_backdrop();
287 #endif
288 #if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
289 show_remote_wps_backdrop();
290 #endif
291 restore = true;
292 break;
294 case ACTION_WPS_BROWSE:
295 #ifdef HAVE_LCD_CHARCELLS
296 status_set_record(false);
297 status_set_audio(false);
298 #endif
299 FOR_NB_SCREENS(i)
300 gui_wps[i].display->stop_scroll();
301 return GO_TO_PREVIOUS_BROWSER;
302 break;
304 /* play/pause */
305 case ACTION_WPS_PLAY:
306 if (global_settings.party_mode)
307 break;
308 if ( wps_state.paused )
310 wps_state.paused = false;
311 if ( global_settings.fade_on_stop )
312 fade(true, true);
313 else
314 audio_resume();
316 else
318 wps_state.paused = true;
319 if ( global_settings.fade_on_stop )
320 fade(false, true);
321 else
322 audio_pause();
323 settings_save();
324 #if !defined(HAVE_RTC_RAM) && !defined(HAVE_SW_POWEROFF)
325 call_storage_idle_notifys(true); /* make sure resume info is saved */
326 #endif
328 break;
330 /* volume up */
331 case ACTION_WPS_VOLUP:
333 FOR_NB_SCREENS(i)
334 gui_wps[i].data->button_time_volume = current_tick;
335 global_settings.volume++;
336 bool res = false;
337 setvol();
338 FOR_NB_SCREENS(i)
340 if(update_onvol_change(&gui_wps[i]))
341 res = true;
343 if (res) {
344 restore = true;
345 restoretimer = current_tick + HZ;
348 break;
350 /* volume down */
351 case ACTION_WPS_VOLDOWN:
353 FOR_NB_SCREENS(i)
354 gui_wps[i].data->button_time_volume = current_tick;
355 global_settings.volume--;
356 setvol();
357 bool res = false;
358 FOR_NB_SCREENS(i)
360 if(update_onvol_change(&gui_wps[i]))
361 res = true;
363 if (res) {
364 restore = true;
365 restoretimer = current_tick + HZ;
368 break;
369 /* fast forward
370 OR next dir if this is straight after ACTION_WPS_SKIPNEXT
371 OR if skip length set, next track if straight after SKIPPREV. */
372 case ACTION_WPS_SEEKFWD:
373 if (global_settings.party_mode)
374 break;
375 if (global_settings.skip_length == 0
376 && current_tick -last_right < HZ)
378 if (cuesheet_is_enabled() && wps_state.id3->cuesheet_type)
380 audio_next();
382 else
384 audio_next_dir();
387 else if (global_settings.skip_length > 0
388 && current_tick -last_left < HZ) {
389 next_track();
390 update_track = true;
392 else ffwd_rew(ACTION_WPS_SEEKFWD);
393 last_right = last_left = 0;
394 break;
395 /* fast rewind
396 OR prev dir if this is straight after ACTION_WPS_SKIPPREV,
397 OR if skip length set, beg of track or prev track if this is
398 straight after SKIPPREV */
399 case ACTION_WPS_SEEKBACK:
400 if (global_settings.party_mode)
401 break;
402 if (global_settings.skip_length == 0
403 && current_tick -last_left < HZ)
405 if (cuesheet_is_enabled() && wps_state.id3->cuesheet_type)
407 if (!wps_state.paused)
408 #if (CONFIG_CODEC == SWCODEC)
409 audio_pre_ff_rewind();
410 #else
411 audio_pause();
412 #endif
413 audio_ff_rewind(0);
415 else
417 audio_prev_dir();
420 else if (global_settings.skip_length > 0
421 && current_tick -last_right < HZ)
423 prev_track(3+global_settings.skip_length);
424 update_track = true;
426 else ffwd_rew(ACTION_WPS_SEEKBACK);
427 last_left = last_right = 0;
428 break;
430 /* prev / restart */
431 case ACTION_WPS_SKIPPREV:
432 if (global_settings.party_mode)
433 break;
434 last_left = current_tick;
435 update_track = true;
437 #ifdef AB_REPEAT_ENABLE
438 /* if we're in A/B repeat mode and the current position
439 is past the A marker, jump back to the A marker... */
440 if ( ab_repeat_mode_enabled() )
442 if ( ab_after_A_marker(wps_state.id3->elapsed) )
444 ab_jump_to_A_marker();
445 break;
446 #if (AB_REPEAT_ENABLE == 2)
447 } else {
448 ab_reset_markers();
449 #endif
452 /* ...otherwise, do it normally */
453 #endif
455 if (global_settings.skip_length > 0)
456 play_hop(-1);
457 else prev_track(3);
458 break;
460 /* next
461 OR if skip length set, hop by predetermined amount. */
462 case ACTION_WPS_SKIPNEXT:
463 if (global_settings.party_mode)
464 break;
465 last_right = current_tick;
466 update_track = true;
468 #ifdef AB_REPEAT_ENABLE
469 /* if we're in A/B repeat mode and the current position is
470 before the A marker, jump to the A marker... */
471 if ( ab_repeat_mode_enabled() )
473 if ( ab_before_A_marker(wps_state.id3->elapsed) )
475 ab_jump_to_A_marker();
476 break;
477 #if (AB_REPEAT_ENABLE == 2)
478 } else {
479 ab_reset_markers();
480 #endif
483 /* ...otherwise, do it normally */
484 #endif
486 if (global_settings.skip_length > 0)
487 play_hop(1);
488 else next_track();
489 break;
490 /* next / prev directories */
491 /* and set A-B markers if in a-b mode */
492 case ACTION_WPS_ABSETB_NEXTDIR:
493 if (global_settings.party_mode)
494 break;
495 #if defined(AB_REPEAT_ENABLE)
496 if (ab_repeat_mode_enabled())
498 ab_set_B_marker(wps_state.id3->elapsed);
499 ab_jump_to_A_marker();
500 update_track = true;
502 else
503 #endif
505 if (global_settings.skip_length > 0)
506 next_track();
507 else audio_next_dir();
509 break;
510 case ACTION_WPS_ABSETA_PREVDIR:
511 if (global_settings.party_mode)
512 break;
513 #if defined(AB_REPEAT_ENABLE)
514 if (ab_repeat_mode_enabled())
515 ab_set_A_marker(wps_state.id3->elapsed);
516 else
517 #endif
519 if (global_settings.skip_length > 0)
520 prev_track(3);
521 else audio_prev_dir();
523 break;
524 /* menu key functions */
525 case ACTION_WPS_MENU:
526 FOR_NB_SCREENS(i)
527 gui_wps[i].display->stop_scroll();
528 return GO_TO_ROOT;
529 break;
532 #ifdef HAVE_QUICKSCREEN
533 case ACTION_WPS_QUICKSCREEN:
534 #if LCD_DEPTH > 1
535 show_main_backdrop();
536 #endif
537 #if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
538 show_remote_main_backdrop();
539 #endif
540 if (quick_screen_quick(button))
541 return SYS_USB_CONNECTED;
542 #if LCD_DEPTH > 1
543 show_wps_backdrop();
544 #endif
545 #if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
546 show_remote_wps_backdrop();
547 #endif
548 restore = true;
549 break;
550 #endif /* HAVE_QUICKSCREEN */
552 /* screen settings */
553 #ifdef BUTTON_F3
554 case ACTION_F3:
555 #if LCD_DEPTH > 1
556 show_main_backdrop();
557 #endif
558 #if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
559 show_remote_main_backdrop();
560 #endif
561 if (quick_screen_f3(BUTTON_F3))
562 return SYS_USB_CONNECTED;
563 restore = true;
564 break;
565 #endif /* BUTTON_F3 */
567 /* pitch screen */
568 #ifdef HAVE_PITCHSCREEN
569 case ACTION_WPS_PITCHSCREEN:
570 #if LCD_DEPTH > 1
571 show_main_backdrop();
572 #endif
573 #if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
574 show_remote_main_backdrop();
575 #endif
576 if (1 == gui_syncpitchscreen_run())
577 return SYS_USB_CONNECTED;
578 #if LCD_DEPTH > 1
579 show_wps_backdrop();
580 #endif
581 #if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
582 show_remote_wps_backdrop();
583 #endif
584 restore = true;
585 break;
586 #endif /* HAVE_PITCHSCREEN */
588 #ifdef AB_REPEAT_ENABLE
589 /* reset A&B markers */
590 case ACTION_WPS_ABRESET:
591 if (ab_repeat_mode_enabled())
593 ab_reset_markers();
594 update_track = true;
596 break;
597 #endif /* AB_REPEAT_ENABLE */
599 /* stop and exit wps */
600 case ACTION_WPS_STOP:
601 if (global_settings.party_mode)
602 break;
603 bookmark = true;
604 exit = true;
605 break;
607 case ACTION_WPS_ID3SCREEN:
608 #if LCD_DEPTH > 1
609 show_main_backdrop();
610 #endif
611 #if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
612 show_remote_main_backdrop();
613 #endif
614 browse_id3();
615 #if LCD_DEPTH > 1
616 show_wps_backdrop();
617 #endif
618 #if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
619 show_remote_wps_backdrop();
620 #endif
621 restore = true;
622 break;
624 case ACTION_REDRAW: /* yes are locked, just redraw */
625 restore = true;
626 break;
627 case ACTION_NONE: /* Timeout */
628 update_track = true;
629 ffwd_rew(button); /* hopefully fix the ffw/rwd bug */
630 break;
631 #ifdef HAVE_RECORDING
632 case ACTION_WPS_REC:
633 exit = true;
634 break;
635 #endif
636 case SYS_POWEROFF:
637 #if LCD_DEPTH > 1
638 show_main_backdrop();
639 #endif
640 #if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
641 show_remote_main_backdrop();
642 #endif
643 default_event_handler(SYS_POWEROFF);
644 break;
646 default:
647 if(default_event_handler(button) == SYS_USB_CONNECTED)
648 return GO_TO_ROOT;
649 update_track = true;
650 break;
653 if (update_track)
655 FOR_NB_SCREENS(i)
657 if(update(&gui_wps[i]))
658 exit = true;
660 update_track = false;
663 if (restore &&
664 ((restoretimer == 0) ||
665 (restoretimer < current_tick)))
667 restore = false;
668 restoretimer = 0;
669 if (gui_wps_display()) {
670 exit = true;
672 else if (wps_state.id3){
673 FOR_NB_SCREENS(i)
674 gui_wps_refresh(&gui_wps[i], 0, WPS_REFRESH_NON_STATIC);
678 if (exit) {
679 #ifdef HAVE_LCD_CHARCELLS
680 status_set_record(false);
681 status_set_audio(false);
682 #endif
683 if (global_settings.fade_on_stop)
684 fade(false, true);
686 FOR_NB_SCREENS(i)
687 gui_wps[i].display->stop_scroll();
688 if (bookmark)
689 bookmark_autobookmark();
690 audio_stop();
691 #ifdef AB_REPEAT_ENABLE
692 ab_reset_markers();
693 #endif
694 #ifdef HAVE_RECORDING
695 if (button == ACTION_WPS_REC)
696 return GO_TO_RECSCREEN;
697 #endif
698 if (global_settings.browse_current)
699 return GO_TO_PREVIOUS_BROWSER;
700 return GO_TO_PREVIOUS;
703 if ( button )
704 storage_spin();
706 return GO_TO_ROOT; /* unreachable - just to reduce compiler warnings */
709 /* needs checking if needed end*/
711 /* wps_state */
713 static void wps_state_init(void)
715 wps_state.ff_rewind = false;
716 wps_state.paused = false;
717 wps_state.id3 = NULL;
718 wps_state.nid3 = NULL;
719 wps_state.current_track_path[0] = '\0';
722 #if 0
723 /* these are obviously not used? */
725 void wps_state_update_ff_rew(bool ff_rew)
727 wps_state.ff_rewind = ff_rew;
730 void wps_state_update_paused(bool paused)
732 wps_state.paused = paused;
734 void wps_state_update_id3_nid3(struct mp3entry *id3, struct mp3entry *nid3)
736 wps_state.id3 = id3;
737 wps_state.nid3 = nid3;
739 #endif
741 static void wps_state_update_ctp(const char *path)
743 strncpy(wps_state.current_track_path, path,
744 sizeof(wps_state.current_track_path));
745 wps_state.current_track_path[sizeof(wps_state.current_track_path)-1] = '\0';
747 /* wps_state end*/
749 /* initial setup of a wps */
750 static void gui_wps_init(struct gui_wps *gui_wps)
752 gui_wps->data = NULL;
753 gui_wps->display = NULL;
754 gui_wps->statusbar = NULL;
755 /* Currently no seperate wps_state needed/possible
756 so use the only aviable ( "global" ) one */
757 gui_wps->state = &wps_state;
760 /* connects a wps with a format-description of the displayed content */
761 static void gui_wps_set_data(struct gui_wps *gui_wps, struct wps_data *data)
763 gui_wps->data = data;
766 /* connects a wps with a screen */
767 static void gui_wps_set_disp(struct gui_wps *gui_wps, struct screen *display)
769 gui_wps->display = display;
772 static void gui_wps_set_statusbar(struct gui_wps *gui_wps, struct gui_statusbar *statusbar)
774 gui_wps->statusbar = statusbar;
776 /* gui_wps end */
778 void gui_sync_wps_screen_init(void)
780 int i;
781 FOR_NB_SCREENS(i)
782 gui_wps_set_disp(&gui_wps[i], &screens[i]);
784 #ifdef HAVE_LCD_BITMAP
785 static void statusbar_toggle_handler(void *data)
787 (void)data;
788 int i;
789 bool draw = global_settings.statusbar;
791 FOR_NB_SCREENS(i)
793 struct wps_viewport *vp = &gui_wps[i].data->viewports[0];
794 if (gui_wps[i].data->wps_sb_tag)
795 draw = gui_wps[i].data->show_sb_on_wps;
796 if (!draw)
798 vp->vp.y = 0;
799 vp->vp.height = screens[i].lcdheight;
801 else
803 vp->vp.y = STATUSBAR_HEIGHT;
804 vp->vp.height = screens[i].lcdheight - STATUSBAR_HEIGHT;
808 #endif
810 void gui_sync_wps_init(void)
812 int i;
813 FOR_NB_SCREENS(i)
815 wps_data_init(&wps_datas[i]);
816 #ifdef HAVE_REMOTE_LCD
817 wps_datas[i].remote_wps = (i != 0);
818 #endif
819 gui_wps_init(&gui_wps[i]);
820 gui_wps_set_data(&gui_wps[i], &wps_datas[i]);
821 gui_wps_set_statusbar(&gui_wps[i], &statusbars.statusbars[i]);
823 #ifdef HAVE_LCD_BITMAP
824 add_event(GUI_EVENT_STATUSBAR_TOGGLE, false, statusbar_toggle_handler);
825 #endif
826 #if LCD_DEPTH > 1
827 unload_wps_backdrop();
828 #endif
829 #if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
830 unload_remote_wps_backdrop();
831 #endif
834 #ifdef HAVE_ALBUMART
835 /* Returns true if at least one of the gui_wps screens has an album art
836 tag in its wps structure */
837 bool gui_sync_wps_uses_albumart(void)
839 int i;
840 FOR_NB_SCREENS(i) {
841 struct gui_wps *gwps = &gui_wps[i];
842 if (gwps->data && (gwps->data->wps_uses_albumart != WPS_ALBUMART_NONE))
843 return true;
845 return false;
847 #endif