mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
Add backdrop functions to the multiscreen api and add a enum backdrop_type parameter for different backdrops (main, wps), symplifying calls and removing dozens of #ifdefs (stubs added for non-backdrop displays that can't do backdrops).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22176 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
4632fc0682
commit
4764ee04c9
13 changed files with 185 additions and 144 deletions
|
@ -164,6 +164,7 @@ bool bookmark_autobookmark(void)
|
||||||
char* bookmark;
|
char* bookmark;
|
||||||
if (!system_check())
|
if (!system_check())
|
||||||
return false;
|
return false;
|
||||||
|
int i;
|
||||||
|
|
||||||
audio_pause(); /* first pause playback */
|
audio_pause(); /* first pause playback */
|
||||||
bookmark = create_bookmark();
|
bookmark = create_bookmark();
|
||||||
|
@ -191,12 +192,9 @@ bool bookmark_autobookmark(void)
|
||||||
str(LANG_CONFIRM_WITH_BUTTON)};
|
str(LANG_CONFIRM_WITH_BUTTON)};
|
||||||
const struct text_message message={lines, 2};
|
const struct text_message message={lines, 2};
|
||||||
#endif
|
#endif
|
||||||
#if LCD_DEPTH > 1
|
FOR_NB_SCREENS(i)
|
||||||
show_main_backdrop(); /* switch to main backdrop as we may come from wps */
|
screens[i].backdrop_show(BACKDROP_MAIN);
|
||||||
#endif
|
|
||||||
#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
|
|
||||||
show_remote_main_backdrop();
|
|
||||||
#endif
|
|
||||||
if(gui_syncyesno_run(&message, NULL, NULL)==YESNO_YES)
|
if(gui_syncyesno_run(&message, NULL, NULL)==YESNO_YES)
|
||||||
{
|
{
|
||||||
if (global_settings.autocreatebookmark == BOOKMARK_RECENT_ONLY_ASK)
|
if (global_settings.autocreatebookmark == BOOKMARK_RECENT_ONLY_ASK)
|
||||||
|
|
|
@ -482,7 +482,7 @@ int ft_enter(struct tree_context* c)
|
||||||
case FILE_ATTR_WPS:
|
case FILE_ATTR_WPS:
|
||||||
splash(0, ID2P(LANG_WAIT));
|
splash(0, ID2P(LANG_WAIT));
|
||||||
#if LCD_DEPTH > 1
|
#if LCD_DEPTH > 1
|
||||||
unload_wps_backdrop();
|
backdrop_unload(BACKDROP_SKIN_WPS);
|
||||||
#endif
|
#endif
|
||||||
wps_data_load(SCREEN_MAIN, buf, true);
|
wps_data_load(SCREEN_MAIN, buf, true);
|
||||||
set_file(buf, (char *)global_settings.wps_file,
|
set_file(buf, (char *)global_settings.wps_file,
|
||||||
|
@ -494,7 +494,7 @@ int ft_enter(struct tree_context* c)
|
||||||
case FILE_ATTR_RWPS:
|
case FILE_ATTR_RWPS:
|
||||||
splash(0, ID2P(LANG_WAIT));
|
splash(0, ID2P(LANG_WAIT));
|
||||||
#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
|
#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
|
||||||
unload_remote_wps_backdrop();
|
remote_backdrop_unload(BACKDROP_SKIN_WPS);
|
||||||
#endif
|
#endif
|
||||||
wps_data_load(SCREEN_REMOTE, buf, true);
|
wps_data_load(SCREEN_REMOTE, buf, true);
|
||||||
set_file(buf, (char *)global_settings.rwps_file,
|
set_file(buf, (char *)global_settings.rwps_file,
|
||||||
|
|
|
@ -27,21 +27,19 @@
|
||||||
#endif
|
#endif
|
||||||
#include "backdrop.h"
|
#include "backdrop.h"
|
||||||
|
|
||||||
#if LCD_DEPTH >= 8
|
static fb_data main_backdrop[LCD_FBHEIGHT][LCD_FBHEIGHT]
|
||||||
static fb_data main_backdrop[LCD_HEIGHT][LCD_WIDTH] __attribute__ ((aligned (16)));
|
__attribute__ ((aligned (16)));
|
||||||
static fb_data wps_backdrop[LCD_HEIGHT][LCD_WIDTH] __attribute__ ((aligned (16)));
|
static fb_data skin_backdrop[LCD_FBHEIGHT][LCD_FBHEIGHT]
|
||||||
#elif LCD_DEPTH == 2
|
__attribute__ ((aligned (16)));
|
||||||
static fb_data main_backdrop[LCD_FBHEIGHT][LCD_FBWIDTH];
|
|
||||||
static fb_data wps_backdrop[LCD_FBHEIGHT][LCD_FBWIDTH];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
|
#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
|
||||||
static fb_remote_data remote_wps_backdrop[LCD_REMOTE_FBHEIGHT][LCD_REMOTE_FBWIDTH];
|
static fb_remote_data
|
||||||
static bool remote_wps_backdrop_valid = false;
|
remote_skin_backdrop[LCD_REMOTE_FBHEIGHT][LCD_REMOTE_FBWIDTH];
|
||||||
|
static bool remote_skin_backdrop_valid = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static bool main_backdrop_valid = false;
|
static bool main_backdrop_valid = false;
|
||||||
static bool wps_backdrop_valid = false;
|
static bool skin_backdrop_valid = false;
|
||||||
|
|
||||||
/* load a backdrop into a buffer */
|
/* load a backdrop into a buffer */
|
||||||
static bool load_backdrop(const char* filename, fb_data* backdrop_buffer)
|
static bool load_backdrop(const char* filename, fb_data* backdrop_buffer)
|
||||||
|
@ -54,49 +52,43 @@ static bool load_backdrop(const char* filename, fb_data* backdrop_buffer)
|
||||||
ret = read_bmp_file(filename, &bm, sizeof(main_backdrop),
|
ret = read_bmp_file(filename, &bm, sizeof(main_backdrop),
|
||||||
FORMAT_NATIVE | FORMAT_DITHER, NULL);
|
FORMAT_NATIVE | FORMAT_DITHER, NULL);
|
||||||
|
|
||||||
if ((ret > 0) && (bm.width == LCD_WIDTH) && (bm.height == LCD_HEIGHT))
|
return ((ret > 0)
|
||||||
{
|
&& (bm.width == LCD_WIDTH) && (bm.height == LCD_HEIGHT));
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool load_main_backdrop(const char* filename)
|
static bool load_main_backdrop(const char* filename)
|
||||||
{
|
{
|
||||||
main_backdrop_valid = load_backdrop(filename, &main_backdrop[0][0]);
|
main_backdrop_valid = load_backdrop(filename, &main_backdrop[0][0]);
|
||||||
return main_backdrop_valid;
|
return main_backdrop_valid;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool load_wps_backdrop(const char* filename)
|
static inline bool load_skin_backdrop(const char* filename)
|
||||||
{
|
{
|
||||||
wps_backdrop_valid = load_backdrop(filename, &wps_backdrop[0][0]);
|
skin_backdrop_valid = load_backdrop(filename, &skin_backdrop[0][0]);
|
||||||
return wps_backdrop_valid;
|
return skin_backdrop_valid;
|
||||||
}
|
}
|
||||||
|
|
||||||
void unload_main_backdrop(void)
|
static inline void unload_main_backdrop(void)
|
||||||
{
|
{
|
||||||
main_backdrop_valid = false;
|
main_backdrop_valid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void unload_wps_backdrop(void)
|
static inline void unload_skin_backdrop(void)
|
||||||
{
|
{
|
||||||
wps_backdrop_valid = false;
|
skin_backdrop_valid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_main_backdrop(void)
|
static inline void show_main_backdrop(void)
|
||||||
{
|
{
|
||||||
lcd_set_backdrop(main_backdrop_valid ? &main_backdrop[0][0] : NULL);
|
lcd_set_backdrop(main_backdrop_valid ? &main_backdrop[0][0] : NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_wps_backdrop(void)
|
static void show_skin_backdrop(void)
|
||||||
{
|
{
|
||||||
/* if no wps backdrop, fall back to main backdrop */
|
/* if no wps backdrop, fall back to main backdrop */
|
||||||
if(wps_backdrop_valid)
|
if(skin_backdrop_valid)
|
||||||
{
|
{
|
||||||
lcd_set_backdrop(&wps_backdrop[0][0]);
|
lcd_set_backdrop(&skin_backdrop[0][0]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -104,9 +96,39 @@ void show_wps_backdrop(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* api functions */
|
||||||
|
|
||||||
|
bool backdrop_load(enum backdrop_type bdrop, const char* filename)
|
||||||
|
{
|
||||||
|
if (bdrop == BACKDROP_MAIN)
|
||||||
|
return load_main_backdrop(filename);
|
||||||
|
else if (bdrop == BACKDROP_SKIN_WPS)
|
||||||
|
return load_skin_backdrop(filename);
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void backdrop_unload(enum backdrop_type bdrop)
|
||||||
|
{
|
||||||
|
if (bdrop == BACKDROP_MAIN)
|
||||||
|
unload_main_backdrop();
|
||||||
|
else if (bdrop == BACKDROP_SKIN_WPS)
|
||||||
|
unload_skin_backdrop();
|
||||||
|
}
|
||||||
|
|
||||||
|
void backdrop_show(enum backdrop_type bdrop)
|
||||||
|
{
|
||||||
|
if (bdrop == BACKDROP_MAIN)
|
||||||
|
show_main_backdrop();
|
||||||
|
else if (bdrop == BACKDROP_SKIN_WPS)
|
||||||
|
show_skin_backdrop();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
|
#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
|
||||||
|
|
||||||
static bool load_remote_backdrop(const char* filename, fb_remote_data* backdrop_buffer)
|
static bool load_remote_backdrop(const char* filename,
|
||||||
|
fb_remote_data* backdrop_buffer)
|
||||||
{
|
{
|
||||||
struct bitmap bm;
|
struct bitmap bm;
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -116,33 +138,29 @@ static bool load_remote_backdrop(const char* filename, fb_remote_data* backdrop_
|
||||||
ret = read_bmp_file(filename, &bm, sizeof(main_backdrop),
|
ret = read_bmp_file(filename, &bm, sizeof(main_backdrop),
|
||||||
FORMAT_NATIVE | FORMAT_DITHER | FORMAT_REMOTE, NULL);
|
FORMAT_NATIVE | FORMAT_DITHER | FORMAT_REMOTE, NULL);
|
||||||
|
|
||||||
if ((ret > 0) && (bm.width == LCD_REMOTE_WIDTH) && (bm.height == LCD_REMOTE_HEIGHT))
|
return ((ret > 0)
|
||||||
{
|
&& (bm.width == LCD_REMOTE_WIDTH)
|
||||||
return true;
|
&& (bm.height == LCD_REMOTE_HEIGHT));
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool load_remote_wps_backdrop(const char* filename)
|
static inline bool load_remote_skin_backdrop(const char* filename)
|
||||||
{
|
{
|
||||||
remote_wps_backdrop_valid = load_remote_backdrop(filename, &remote_wps_backdrop[0][0]);
|
remote_skin_backdrop_valid =
|
||||||
return remote_wps_backdrop_valid;
|
load_remote_backdrop(filename, &remote_skin_backdrop[0][0]);
|
||||||
|
return remote_skin_backdrop_valid;
|
||||||
}
|
}
|
||||||
|
|
||||||
void unload_remote_wps_backdrop(void)
|
static inline void unload_remote_skin_backdrop(void)
|
||||||
{
|
{
|
||||||
remote_wps_backdrop_valid = false;
|
remote_skin_backdrop_valid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_remote_wps_backdrop(void)
|
static inline void show_remote_skin_backdrop(void)
|
||||||
{
|
{
|
||||||
/* if no wps backdrop, fall back to main backdrop */
|
/* if no wps backdrop, fall back to main backdrop */
|
||||||
if(remote_wps_backdrop_valid)
|
if(remote_skin_backdrop_valid)
|
||||||
{
|
{
|
||||||
lcd_remote_set_backdrop(&remote_wps_backdrop[0][0]);
|
lcd_remote_set_backdrop(&remote_skin_backdrop[0][0]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -150,8 +168,37 @@ void show_remote_wps_backdrop(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_remote_main_backdrop(void)
|
static line void show_remote_main_backdrop(void)
|
||||||
{
|
{
|
||||||
lcd_remote_set_backdrop(NULL);
|
lcd_remote_set_backdrop(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* api functions */
|
||||||
|
bool remote_backdrop_load(enum backdrop_type bdrop,
|
||||||
|
const char *filename)
|
||||||
|
{
|
||||||
|
if (bdrop == BACKDROP_SKIN_WPS)
|
||||||
|
return load_remote_skin_backdrop(filename);
|
||||||
|
else if (bdrop == BACKDROP_MAIN)
|
||||||
|
return true;
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void remote_backrop_show(enum backdrop_type bdrop)
|
||||||
|
{
|
||||||
|
if (bdrop == BACKDROP_MAIN)
|
||||||
|
show_remote_main_backdrop();
|
||||||
|
else if (bdrop == BACKDROP_SKIN_WPS)
|
||||||
|
show_remote_skin_backdrop();
|
||||||
|
}
|
||||||
|
|
||||||
|
void remote_backdrop_unload(enum backdrop_type bdrop)
|
||||||
|
{
|
||||||
|
if (bdrop != BACKDROP_MAIN)
|
||||||
|
unload_remote_skin_backdrop();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -22,27 +22,62 @@
|
||||||
#ifndef _BACKDROP_H
|
#ifndef _BACKDROP_H
|
||||||
#define _BACKDROP_H
|
#define _BACKDROP_H
|
||||||
|
|
||||||
|
enum backdrop_type {
|
||||||
|
BACKDROP_MAIN,
|
||||||
|
BACKDROP_SKIN_WPS,
|
||||||
|
};
|
||||||
|
|
||||||
#if LCD_DEPTH > 1
|
#if LCD_DEPTH > 1
|
||||||
|
|
||||||
#include "lcd.h"
|
#include "lcd.h"
|
||||||
#include "bmp.h"
|
#include "bmp.h"
|
||||||
|
|
||||||
bool load_main_backdrop(const char* filename);
|
bool backdrop_load(enum backdrop_type bdrop, const char*);
|
||||||
bool load_wps_backdrop(const char* filename);
|
void backdrop_unload(enum backdrop_type bdrop);
|
||||||
|
void backdrop_show(enum backdrop_type bdrop);
|
||||||
|
|
||||||
void unload_main_backdrop(void);
|
#else /* LCD_DEPTH > 1 */
|
||||||
void unload_wps_backdrop(void);
|
|
||||||
|
|
||||||
void show_main_backdrop(void);
|
static inline
|
||||||
void show_wps_backdrop(void);
|
bool backdrop_load(enum backdrop_type bdrop, const char* filename)
|
||||||
|
{
|
||||||
|
(void)filename; (void)bdrop; return true;
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* LCD_DEPTH > 1 */
|
static inline void backdrop_unload(enum backdrop_type bdrop)
|
||||||
|
{
|
||||||
|
(void)bdrop;
|
||||||
|
}
|
||||||
|
static inline void backdrop_show(enum backdrop_type bdrop)
|
||||||
|
{
|
||||||
|
(void)bdrop;
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
|
#endif
|
||||||
bool load_remote_wps_backdrop(const char* filename);
|
|
||||||
void unload_remote_wps_backdrop(void);
|
#if defined(HAVE_REMOTE_LCD)
|
||||||
void show_remote_wps_backdrop(void);
|
/* no main backdrop, stubs! */
|
||||||
void show_remote_main_backdrop(void); /* only clears the wps backdrop */
|
#if LCD_REMOTE_DEPTH > 1
|
||||||
|
bool remote_backdrop_load(enum backdrop_type bdrop,const char* filename);
|
||||||
|
void remote_backdropunload(enum backdrop_type bdrop);
|
||||||
|
void remote_backdrop_show(enum backdrop_type bdrop);
|
||||||
|
#else
|
||||||
|
static inline
|
||||||
|
bool remote_backdrop_load(enum backdrop_type bdrop,const char* filename)
|
||||||
|
{
|
||||||
|
(void)filename; (void)bdrop; return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void remote_backdrop_unload(enum backdrop_type bdrop)
|
||||||
|
{
|
||||||
|
(void)bdrop;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void remote_backdrop_show(enum backdrop_type bdrop)
|
||||||
|
{
|
||||||
|
(void)bdrop;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* _BACKDROP_H */
|
#endif /* _BACKDROP_H */
|
||||||
|
|
|
@ -82,14 +82,7 @@ bool gui_wps_display(struct gui_wps *gwps)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
display->clear_display();
|
display->clear_display();
|
||||||
#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
|
display->backdrop_show(BACKDROP_SKIN_WPS);
|
||||||
if (display->screen_type == SCREEN_REMOTE)
|
|
||||||
show_remote_wps_backdrop();
|
|
||||||
else if (display->screen_type == SCREEN_MAIN)
|
|
||||||
#endif
|
|
||||||
#if LCD_DEPTH > 1
|
|
||||||
show_wps_backdrop();
|
|
||||||
#endif
|
|
||||||
return gui_wps_redraw(gwps, WPS_REFRESH_ALL);
|
return gui_wps_redraw(gwps, WPS_REFRESH_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1635,26 +1635,15 @@ static bool load_wps_bitmaps(struct wps_data *wps_data, char *bmpdir)
|
||||||
#if (LCD_DEPTH > 1) || (defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1))
|
#if (LCD_DEPTH > 1) || (defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1))
|
||||||
if (bmp_names[BACKDROP_BMP])
|
if (bmp_names[BACKDROP_BMP])
|
||||||
{
|
{
|
||||||
|
int screen = SCREEN_MAIN;
|
||||||
get_image_filename(bmp_names[BACKDROP_BMP], bmpdir,
|
get_image_filename(bmp_names[BACKDROP_BMP], bmpdir,
|
||||||
img_path, sizeof(img_path));
|
img_path, sizeof(img_path));
|
||||||
|
|
||||||
#if defined(HAVE_REMOTE_LCD)
|
#if defined(HAVE_REMOTE_LCD)
|
||||||
/* We only need to check LCD type if there is a remote LCD */
|
/* We only need to check LCD type if there is a remote LCD */
|
||||||
if (!wps_data->remote_wps)
|
if (wps_data->remote_wps)
|
||||||
#endif
|
screen = SCREEN_REMOTE;
|
||||||
{
|
|
||||||
/* Load backdrop for the main LCD */
|
|
||||||
if (!load_wps_backdrop(img_path))
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* Load backdrop for the remote LCD */
|
|
||||||
if (!load_remote_wps_backdrop(img_path))
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
screens[screen].backdrop_load(BACKDROP_SKIN_WPS, img_path);
|
||||||
}
|
}
|
||||||
#endif /* has backdrop support */
|
#endif /* has backdrop support */
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,8 @@ static void nextid3available_callback(void* param);
|
||||||
|
|
||||||
void wps_data_load(enum screen_type screen, const char *buf, bool isfile)
|
void wps_data_load(enum screen_type screen, const char *buf, bool isfile)
|
||||||
{
|
{
|
||||||
bool loaded_ok = buf && skin_data_load(gui_wps[screen].data, &screens[screen], buf, isfile);
|
bool loaded_ok = buf && skin_data_load(gui_wps[screen].data,
|
||||||
|
&screens[screen], buf, isfile);
|
||||||
if (!loaded_ok) /* load the hardcoded default */
|
if (!loaded_ok) /* load the hardcoded default */
|
||||||
{
|
{
|
||||||
char *skin_buf[NB_SCREENS] = {
|
char *skin_buf[NB_SCREENS] = {
|
||||||
|
@ -115,24 +116,9 @@ void wps_data_load(enum screen_type screen, const char *buf, bool isfile)
|
||||||
"%pb\n",
|
"%pb\n",
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
screens[screen].backdrop_unload(BACKDROP_SKIN_WPS);
|
||||||
skin_data_load(gui_wps[screen].data, &screens[screen],
|
skin_data_load(gui_wps[screen].data, &screens[screen],
|
||||||
skin_buf[screen], false);
|
skin_buf[screen], false);
|
||||||
/* set the default wps for the main-screen */
|
|
||||||
if(screen == SCREEN_MAIN)
|
|
||||||
{
|
|
||||||
#if LCD_DEPTH > 1
|
|
||||||
unload_wps_backdrop();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
#ifdef HAVE_REMOTE_LCD
|
|
||||||
/* set the default wps for the remote-screen */
|
|
||||||
else if(screen == SCREEN_REMOTE)
|
|
||||||
{
|
|
||||||
#if LCD_REMOTE_DEPTH > 1
|
|
||||||
unload_remote_wps_backdrop();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#ifdef HAVE_REMOVE_LCD
|
#ifdef HAVE_REMOVE_LCD
|
||||||
gui_wps[screen].data->remote_wps = !(screen == SCREEN_MAIN);
|
gui_wps[screen].data->remote_wps = !(screen == SCREEN_MAIN);
|
||||||
|
@ -564,16 +550,13 @@ static void gwps_leave_wps(void)
|
||||||
int i, oldbars = VP_SB_HIDE_ALL;
|
int i, oldbars = VP_SB_HIDE_ALL;
|
||||||
|
|
||||||
FOR_NB_SCREENS(i)
|
FOR_NB_SCREENS(i)
|
||||||
|
{
|
||||||
gui_wps[i].display->stop_scroll();
|
gui_wps[i].display->stop_scroll();
|
||||||
|
gui_wps[i].display->backdrop_show(BACKDROP_MAIN);
|
||||||
|
}
|
||||||
if (global_settings.statusbar)
|
if (global_settings.statusbar)
|
||||||
oldbars = VP_SB_ALLSCREENS;
|
oldbars = VP_SB_ALLSCREENS;
|
||||||
|
|
||||||
#if LCD_DEPTH > 1
|
|
||||||
show_main_backdrop();
|
|
||||||
#endif
|
|
||||||
#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
|
|
||||||
show_remote_main_backdrop();
|
|
||||||
#endif
|
|
||||||
viewportmanager_set_statusbar(oldbars);
|
viewportmanager_set_statusbar(oldbars);
|
||||||
#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
|
#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
|
||||||
/* Play safe and unregister the hook */
|
/* Play safe and unregister the hook */
|
||||||
|
@ -1237,23 +1220,18 @@ void gui_sync_wps_init(void)
|
||||||
wps_datas[i].wps_uses_albumart = 0;
|
wps_datas[i].wps_uses_albumart = 0;
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_REMOTE_LCD
|
#ifdef HAVE_REMOTE_LCD
|
||||||
wps_datas[i].remote_wps = (i != 0);
|
wps_datas[i].remote_wps = (i == SCREEN_REMOTE);
|
||||||
#endif
|
#endif
|
||||||
gui_wps[i].data = &wps_datas[i];
|
gui_wps[i].data = &wps_datas[i];
|
||||||
gui_wps[i].display = &screens[i];
|
gui_wps[i].display = &screens[i];
|
||||||
/* Currently no seperate wps_state needed/possible
|
/* Currently no seperate wps_state needed/possible
|
||||||
so use the only available ( "global" ) one */
|
so use the only available ( "global" ) one */
|
||||||
gui_wps[i].state = &wps_state;
|
gui_wps[i].state = &wps_state;
|
||||||
|
gui_wps[i].display->backdrop_unload(BACKDROP_SKIN_WPS);
|
||||||
}
|
}
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
add_event(GUI_EVENT_STATUSBAR_TOGGLE, false, statusbar_toggle_handler);
|
add_event(GUI_EVENT_STATUSBAR_TOGGLE, false, statusbar_toggle_handler);
|
||||||
#endif
|
#endif
|
||||||
#if LCD_DEPTH > 1
|
|
||||||
unload_wps_backdrop();
|
|
||||||
#endif
|
|
||||||
#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
|
|
||||||
unload_remote_wps_backdrop();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_ALBUMART
|
#ifdef HAVE_ALBUMART
|
||||||
|
|
|
@ -46,8 +46,8 @@
|
||||||
static int clear_main_backdrop(void)
|
static int clear_main_backdrop(void)
|
||||||
{
|
{
|
||||||
global_settings.backdrop_file[0]=0;
|
global_settings.backdrop_file[0]=0;
|
||||||
unload_main_backdrop();
|
backdrop_unload(BACKDROP_MAIN);
|
||||||
show_main_backdrop();
|
backdrop_show(BACKDROP_MAIN);
|
||||||
settings_save();
|
settings_save();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -560,11 +560,11 @@ static bool delete_dir(void)
|
||||||
static bool set_backdrop(void)
|
static bool set_backdrop(void)
|
||||||
{
|
{
|
||||||
/* load the image */
|
/* load the image */
|
||||||
if(load_main_backdrop(selected_file)) {
|
if(backdrop_load(BACKDROP_MAIN, selected_file)) {
|
||||||
splash(HZ, str(LANG_BACKDROP_LOADED));
|
splash(HZ, str(LANG_BACKDROP_LOADED));
|
||||||
set_file(selected_file, (char *)global_settings.backdrop_file,
|
set_file(selected_file, (char *)global_settings.backdrop_file,
|
||||||
MAX_FILENAME);
|
MAX_FILENAME);
|
||||||
show_main_backdrop();
|
backdrop_show(BACKDROP_MAIN);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
splash(HZ, str(LANG_BACKDROP_FAILED));
|
splash(HZ, str(LANG_BACKDROP_FAILED));
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
#include <icons.h>
|
#include <icons.h>
|
||||||
|
|
||||||
#include "screen_access.h"
|
#include "screen_access.h"
|
||||||
|
#include "backdrop.h"
|
||||||
|
|
||||||
/* some helper functions to calculate metrics on the fly */
|
/* some helper functions to calculate metrics on the fly */
|
||||||
static int screen_helper_getcharwidth(void)
|
static int screen_helper_getcharwidth(void)
|
||||||
|
@ -197,8 +198,11 @@ struct screen screens[NB_SCREENS] =
|
||||||
.backlight_off=&backlight_off,
|
.backlight_off=&backlight_off,
|
||||||
.is_backlight_on=&is_backlight_on,
|
.is_backlight_on=&is_backlight_on,
|
||||||
.backlight_set_timeout=&backlight_set_timeout,
|
.backlight_set_timeout=&backlight_set_timeout,
|
||||||
|
.backdrop_load=&backdrop_load,
|
||||||
|
.backdrop_unload=&backdrop_unload,
|
||||||
|
.backdrop_show=&backdrop_show,
|
||||||
#ifdef HAVE_BUTTONBAR
|
#ifdef HAVE_BUTTONBAR
|
||||||
.has_buttonbar=false
|
.has_buttonbar=false,
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
#if NB_SCREENS == 2
|
#if NB_SCREENS == 2
|
||||||
|
@ -278,7 +282,10 @@ struct screen screens[NB_SCREENS] =
|
||||||
.backlight_on=&remote_backlight_on,
|
.backlight_on=&remote_backlight_on,
|
||||||
.backlight_off=&remote_backlight_off,
|
.backlight_off=&remote_backlight_off,
|
||||||
.is_backlight_on=&is_remote_backlight_on,
|
.is_backlight_on=&is_remote_backlight_on,
|
||||||
.backlight_set_timeout=&remote_backlight_set_timeout
|
.backlight_set_timeout=&remote_backlight_set_timeout,
|
||||||
|
.backdrop_load=&remote_backdrop_load,
|
||||||
|
.backdrop_unload=&remote_backdrop_unload,
|
||||||
|
.backdrop_show=&remote_backdrop_show,
|
||||||
}
|
}
|
||||||
#endif /* HAVE_REMOTE_LCD */
|
#endif /* HAVE_REMOTE_LCD */
|
||||||
};
|
};
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
#include "lcd.h"
|
#include "lcd.h"
|
||||||
#include "buttonbar.h"
|
#include "buttonbar.h"
|
||||||
|
#include "backdrop.h"
|
||||||
|
|
||||||
enum screen_type {
|
enum screen_type {
|
||||||
SCREEN_MAIN
|
SCREEN_MAIN
|
||||||
|
@ -152,6 +153,9 @@ struct screen
|
||||||
void (*backlight_off)(void);
|
void (*backlight_off)(void);
|
||||||
bool (*is_backlight_on)(bool ignore_always_off);
|
bool (*is_backlight_on)(bool ignore_always_off);
|
||||||
void (*backlight_set_timeout)(int index);
|
void (*backlight_set_timeout)(int index);
|
||||||
|
bool (*backdrop_load)(enum backdrop_type bdrop, const char* filename);
|
||||||
|
void (*backdrop_unload)(enum backdrop_type bdrop);
|
||||||
|
void (*backdrop_show)(enum backdrop_type bdrop);
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(HAVE_LCD_BITMAP) || defined(HAVE_REMOTE_LCD)
|
#if defined(HAVE_LCD_BITMAP) || defined(HAVE_REMOTE_LCD)
|
||||||
|
|
|
@ -183,14 +183,9 @@ void usb_screen(void)
|
||||||
int i;
|
int i;
|
||||||
bool statusbar = global_settings.statusbar; /* force the statusbar */
|
bool statusbar = global_settings.statusbar; /* force the statusbar */
|
||||||
global_settings.statusbar = true;
|
global_settings.statusbar = true;
|
||||||
#if LCD_DEPTH > 1
|
|
||||||
show_main_backdrop();
|
|
||||||
#endif
|
|
||||||
#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
|
|
||||||
show_remote_main_backdrop();
|
|
||||||
#endif
|
|
||||||
FOR_NB_SCREENS(i)
|
FOR_NB_SCREENS(i)
|
||||||
{
|
{
|
||||||
|
screens[i].backdrop_show(BACKDROP_MAIN);
|
||||||
screens[i].backlight_on();
|
screens[i].backlight_on();
|
||||||
screens[i].clear_display();
|
screens[i].clear_display();
|
||||||
#if NB_SCREENS > 1
|
#if NB_SCREENS > 1
|
||||||
|
|
|
@ -730,6 +730,7 @@ void settings_apply(bool read_disk)
|
||||||
#if CONFIG_CODEC == SWCODEC
|
#if CONFIG_CODEC == SWCODEC
|
||||||
int i;
|
int i;
|
||||||
#endif
|
#endif
|
||||||
|
int screen;
|
||||||
|
|
||||||
sound_settings_apply();
|
sound_settings_apply();
|
||||||
|
|
||||||
|
@ -838,12 +839,7 @@ void settings_apply(bool read_disk)
|
||||||
else
|
else
|
||||||
load_kbd(NULL);
|
load_kbd(NULL);
|
||||||
#endif
|
#endif
|
||||||
#if LCD_DEPTH > 1
|
|
||||||
unload_wps_backdrop();
|
|
||||||
#endif
|
|
||||||
#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
|
|
||||||
unload_remote_wps_backdrop();
|
|
||||||
#endif
|
|
||||||
if ( global_settings.wps_file[0] &&
|
if ( global_settings.wps_file[0] &&
|
||||||
global_settings.wps_file[0] != 0xff ) {
|
global_settings.wps_file[0] != 0xff ) {
|
||||||
snprintf(buf, sizeof buf, WPS_DIR "/%s.wps",
|
snprintf(buf, sizeof buf, WPS_DIR "/%s.wps",
|
||||||
|
@ -861,16 +857,15 @@ void settings_apply(bool read_disk)
|
||||||
global_settings.backdrop_file[0] != 0xff ) {
|
global_settings.backdrop_file[0] != 0xff ) {
|
||||||
snprintf(buf, sizeof buf, BACKDROP_DIR "/%s.bmp",
|
snprintf(buf, sizeof buf, BACKDROP_DIR "/%s.bmp",
|
||||||
global_settings.backdrop_file);
|
global_settings.backdrop_file);
|
||||||
load_main_backdrop(buf);
|
backdrop_load(BACKDROP_MAIN, buf);
|
||||||
} else {
|
} else {
|
||||||
unload_main_backdrop();
|
backdrop_unload(BACKDROP_MAIN);
|
||||||
}
|
}
|
||||||
show_main_backdrop();
|
|
||||||
#endif
|
|
||||||
#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
|
|
||||||
show_remote_main_backdrop();
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
FOR_NB_SCREENS(screen)
|
||||||
|
screens[screen].backdrop_show(BACKDROP_MAIN);
|
||||||
|
|
||||||
#if defined(HAVE_REMOTE_LCD) && (NB_SCREENS > 1)
|
#if defined(HAVE_REMOTE_LCD) && (NB_SCREENS > 1)
|
||||||
if ( global_settings.rwps_file[0]) {
|
if ( global_settings.rwps_file[0]) {
|
||||||
snprintf(buf, sizeof buf, WPS_DIR "/%s.rwps",
|
snprintf(buf, sizeof buf, WPS_DIR "/%s.rwps",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue