mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 10:37:38 -04:00
Reworked backdrop handling. Fixes a bug that wasn't in the tracker yet ;)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9970 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
6ddb5f2429
commit
93b899d0fe
11 changed files with 147 additions and 112 deletions
|
@ -53,6 +53,11 @@
|
||||||
static int boot_size = 0;
|
static int boot_size = 0;
|
||||||
static int boot_cluster;
|
static int boot_cluster;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_LCD_COLOR
|
||||||
|
#include "backdrop.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
extern bool boot_changed;
|
extern bool boot_changed;
|
||||||
|
|
||||||
int ft_build_playlist(struct tree_context* c, int start_index)
|
int ft_build_playlist(struct tree_context* c, int start_index)
|
||||||
|
@ -461,6 +466,9 @@ int ft_enter(struct tree_context* c)
|
||||||
/* wps config file */
|
/* wps config file */
|
||||||
case TREE_ATTR_WPS:
|
case TREE_ATTR_WPS:
|
||||||
gui_syncsplash(0, true, str(LANG_WAIT));
|
gui_syncsplash(0, true, str(LANG_WAIT));
|
||||||
|
#ifdef HAVE_LCD_COLOR
|
||||||
|
unload_wps_backdrop();
|
||||||
|
#endif
|
||||||
wps_data_load(gui_wps[0].data, buf, true);
|
wps_data_load(gui_wps[0].data, buf, true);
|
||||||
set_file(buf, (char *)global_settings.wps_file,
|
set_file(buf, (char *)global_settings.wps_file,
|
||||||
MAX_FILENAME);
|
MAX_FILENAME);
|
||||||
|
|
|
@ -146,14 +146,12 @@ bool wps_data_preload_tags(struct wps_data *data, char *buf,
|
||||||
case 'X':
|
case 'X':
|
||||||
/* Backdrop image - must be the same size as the LCD */
|
/* Backdrop image - must be the same size as the LCD */
|
||||||
{
|
{
|
||||||
int ret = 0;
|
|
||||||
struct bitmap bm;
|
|
||||||
char *ptr = buf+2;
|
char *ptr = buf+2;
|
||||||
char *pos = NULL;
|
char *pos = NULL;
|
||||||
char imgname[MAX_PATH];
|
char imgname[MAX_PATH];
|
||||||
|
|
||||||
/* format: %X|filename.bmp| */
|
/* format: %X|filename.bmp| */
|
||||||
{
|
|
||||||
/* get filename */
|
/* get filename */
|
||||||
pos = strchr(ptr, '|');
|
pos = strchr(ptr, '|');
|
||||||
if ((pos - ptr) <
|
if ((pos - ptr) <
|
||||||
|
@ -166,24 +164,13 @@ bool wps_data_preload_tags(struct wps_data *data, char *buf,
|
||||||
imgname[bmpdirlen+1+pos-ptr] = 0;
|
imgname[bmpdirlen+1+pos-ptr] = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
/* filename too long */
|
/* filename too long */
|
||||||
imgname[0] = 0;
|
imgname[0] = 0;
|
||||||
|
}
|
||||||
ptr = pos+1;
|
|
||||||
|
|
||||||
/* load the image */
|
/* load the image */
|
||||||
bm.data=(char*)&wps_backdrop[0][0];
|
return load_wps_backdrop(imgname);
|
||||||
ret = read_bmp_file(imgname, &bm,
|
|
||||||
sizeof(wps_backdrop), FORMAT_NATIVE);
|
|
||||||
|
|
||||||
if ((ret > 0) && (bm.width == LCD_WIDTH)
|
|
||||||
&& (bm.height == LCD_HEIGHT)) {
|
|
||||||
data->has_backdrop=true;
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -2460,6 +2447,9 @@ bool gui_wps_display(void)
|
||||||
if(i == 0)
|
if(i == 0)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
|
#ifdef HAVE_LCD_COLOR
|
||||||
|
unload_wps_backdrop();
|
||||||
|
#endif
|
||||||
wps_data_load(gui_wps[i].data,
|
wps_data_load(gui_wps[i].data,
|
||||||
"%s%?it<%?in<%in. |>%it|%fn>\n"
|
"%s%?it<%?in<%in. |>%it|%fn>\n"
|
||||||
"%s%?ia<%ia|%?d2<%d2|(root)>>\n"
|
"%s%?ia<%ia|%?d2<%d2|(root)>>\n"
|
||||||
|
|
|
@ -105,18 +105,8 @@ long gui_wps_show(void)
|
||||||
gui_wps_set_margin(&gui_wps[i]);
|
gui_wps_set_margin(&gui_wps[i]);
|
||||||
}
|
}
|
||||||
#ifdef HAVE_LCD_COLOR
|
#ifdef HAVE_LCD_COLOR
|
||||||
gui_wps[SCREEN_MAIN].data->old_backdrop = lcd_get_backdrop();
|
show_wps_backdrop();
|
||||||
if (gui_wps[SCREEN_MAIN].data->has_backdrop)
|
#endif /* HAVE_LCD_COLOR */
|
||||||
{
|
|
||||||
lcd_set_backdrop(&wps_backdrop[0][0]);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* wps has no backdrop, so clear it in case we're switching wps */
|
|
||||||
lcd_set_backdrop(gui_wps[SCREEN_MAIN].data->old_backdrop);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef AB_REPEAT_ENABLE
|
#ifdef AB_REPEAT_ENABLE
|
||||||
|
@ -241,12 +231,11 @@ long gui_wps_show(void)
|
||||||
case WPS_RC_CONTEXT:
|
case WPS_RC_CONTEXT:
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_LCD_COLOR
|
#ifdef HAVE_LCD_COLOR
|
||||||
lcd_set_backdrop(gui_wps[SCREEN_MAIN].data->old_backdrop);
|
show_main_backdrop();
|
||||||
#endif
|
#endif
|
||||||
onplay(wps_state.id3->path, TREE_ATTR_MPA, CONTEXT_WPS);
|
onplay(wps_state.id3->path, TREE_ATTR_MPA, CONTEXT_WPS);
|
||||||
#ifdef HAVE_LCD_COLOR
|
#ifdef HAVE_LCD_COLOR
|
||||||
if (gui_wps[SCREEN_MAIN].data->has_backdrop)
|
show_wps_backdrop();
|
||||||
lcd_set_backdrop(&wps_backdrop[0][0]);
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
FOR_NB_SCREENS(i)
|
FOR_NB_SCREENS(i)
|
||||||
|
@ -557,16 +546,12 @@ long gui_wps_show(void)
|
||||||
gui_wps[i].display->stop_scroll();
|
gui_wps[i].display->stop_scroll();
|
||||||
|
|
||||||
#ifdef HAVE_LCD_COLOR
|
#ifdef HAVE_LCD_COLOR
|
||||||
lcd_set_backdrop(gui_wps[SCREEN_MAIN].data->old_backdrop);
|
show_main_backdrop();
|
||||||
#endif
|
#endif
|
||||||
if (main_menu())
|
if (main_menu())
|
||||||
return true;
|
return true;
|
||||||
#ifdef HAVE_LCD_COLOR
|
#ifdef HAVE_LCD_COLOR
|
||||||
if(global_settings.backdrop_file[0] == 0)
|
show_wps_backdrop();
|
||||||
gui_wps[SCREEN_MAIN].data->old_backdrop = NULL;
|
|
||||||
|
|
||||||
if (gui_wps[SCREEN_MAIN].data->has_backdrop)
|
|
||||||
lcd_set_backdrop(&wps_backdrop[0][0]);
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
FOR_NB_SCREENS(i)
|
FOR_NB_SCREENS(i)
|
||||||
|
@ -596,13 +581,12 @@ long gui_wps_show(void)
|
||||||
case WPS_RC_QUICK:
|
case WPS_RC_QUICK:
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_LCD_COLOR
|
#ifdef HAVE_LCD_COLOR
|
||||||
lcd_set_backdrop(gui_wps[SCREEN_MAIN].data->old_backdrop);
|
show_main_backdrop();
|
||||||
#endif
|
#endif
|
||||||
if (quick_screen_quick(button))
|
if (quick_screen_quick(button))
|
||||||
return SYS_USB_CONNECTED;
|
return SYS_USB_CONNECTED;
|
||||||
#ifdef HAVE_LCD_COLOR
|
#ifdef HAVE_LCD_COLOR
|
||||||
if (gui_wps[SCREEN_MAIN].data->has_backdrop)
|
show_wps_backdrop();
|
||||||
lcd_set_backdrop(&wps_backdrop[0][0]);
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
FOR_NB_SCREENS(i)
|
FOR_NB_SCREENS(i)
|
||||||
|
@ -629,13 +613,12 @@ long gui_wps_show(void)
|
||||||
case BUTTON_ON | BUTTON_UP:
|
case BUTTON_ON | BUTTON_UP:
|
||||||
case BUTTON_ON | BUTTON_DOWN:
|
case BUTTON_ON | BUTTON_DOWN:
|
||||||
#ifdef HAVE_LCD_COLOR
|
#ifdef HAVE_LCD_COLOR
|
||||||
lcd_set_backdrop(gui_wps[SCREEN_MAIN].data->old_backdrop);
|
show_main_backdrop();
|
||||||
#endif
|
#endif
|
||||||
if (1 == pitch_screen())
|
if (1 == pitch_screen())
|
||||||
return SYS_USB_CONNECTED;
|
return SYS_USB_CONNECTED;
|
||||||
#ifdef HAVE_LCD_COLOR
|
#ifdef HAVE_LCD_COLOR
|
||||||
if (gui_wps[SCREEN_MAIN].data->has_backdrop)
|
show_wps_backdrop();
|
||||||
lcd_set_backdrop(&wps_backdrop[0][0]);
|
|
||||||
#endif
|
#endif
|
||||||
restore = true;
|
restore = true;
|
||||||
break;
|
break;
|
||||||
|
@ -730,12 +713,11 @@ long gui_wps_show(void)
|
||||||
#ifdef WPS_ID3
|
#ifdef WPS_ID3
|
||||||
case WPS_ID3:
|
case WPS_ID3:
|
||||||
#ifdef HAVE_LCD_COLOR
|
#ifdef HAVE_LCD_COLOR
|
||||||
lcd_set_backdrop(gui_wps[SCREEN_MAIN].data->old_backdrop);
|
show_main_backdrop();
|
||||||
#endif
|
#endif
|
||||||
browse_id3();
|
browse_id3();
|
||||||
#ifdef HAVE_LCD_COLOR
|
#ifdef HAVE_LCD_COLOR
|
||||||
if (gui_wps[SCREEN_MAIN].data->has_backdrop)
|
show_wps_backdrop();
|
||||||
lcd_set_backdrop(&wps_backdrop[0][0]);
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
FOR_NB_SCREENS(i)
|
FOR_NB_SCREENS(i)
|
||||||
|
@ -754,19 +736,14 @@ long gui_wps_show(void)
|
||||||
case SYS_POWEROFF:
|
case SYS_POWEROFF:
|
||||||
bookmark_autobookmark();
|
bookmark_autobookmark();
|
||||||
#ifdef HAVE_LCD_COLOR
|
#ifdef HAVE_LCD_COLOR
|
||||||
lcd_set_backdrop(gui_wps[SCREEN_MAIN].data->old_backdrop);
|
show_main_backdrop();
|
||||||
#endif
|
#endif
|
||||||
default_event_handler(SYS_POWEROFF);
|
default_event_handler(SYS_POWEROFF);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if(default_event_handler(button) == SYS_USB_CONNECTED)
|
if(default_event_handler(button) == SYS_USB_CONNECTED)
|
||||||
{
|
|
||||||
#ifdef HAVE_LCD_COLOR
|
|
||||||
lcd_set_backdrop(gui_wps[SCREEN_MAIN].data->old_backdrop);
|
|
||||||
#endif
|
|
||||||
return SYS_USB_CONNECTED;
|
return SYS_USB_CONNECTED;
|
||||||
}
|
|
||||||
update_track = true;
|
update_track = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -887,9 +864,6 @@ void wps_data_init(struct wps_data *wps_data)
|
||||||
wps_data->format_buffer[0] = '\0';
|
wps_data->format_buffer[0] = '\0';
|
||||||
wps_data->wps_loaded = false;
|
wps_data->wps_loaded = false;
|
||||||
wps_data->peak_meter_enabled = false;
|
wps_data->peak_meter_enabled = false;
|
||||||
#ifdef HAVE_LCD_COLOR
|
|
||||||
wps_data->has_backdrop = false;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void wps_reset(struct wps_data *data)
|
static void wps_reset(struct wps_data *data)
|
||||||
|
@ -1075,4 +1049,7 @@ void gui_sync_wps_init(void)
|
||||||
gui_wps_set_data(&gui_wps[i], &wps_datas[i]);
|
gui_wps_set_data(&gui_wps[i], &wps_datas[i]);
|
||||||
gui_wps_set_statusbar(&gui_wps[i], &statusbars.statusbars[i]);
|
gui_wps_set_statusbar(&gui_wps[i], &statusbars.statusbars[i]);
|
||||||
}
|
}
|
||||||
|
#ifdef HAVE_LCD_COLOR
|
||||||
|
unload_wps_backdrop();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -367,10 +367,6 @@ struct wps_data
|
||||||
int progress_end;
|
int progress_end;
|
||||||
bool wps_loaded;
|
bool wps_loaded;
|
||||||
bool peak_meter_enabled;
|
bool peak_meter_enabled;
|
||||||
#ifdef HAVE_LCD_COLOR
|
|
||||||
bool has_backdrop;
|
|
||||||
fb_data* old_backdrop;
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* initial setup of wps_data */
|
/* initial setup of wps_data */
|
||||||
|
|
|
@ -433,22 +433,13 @@ static bool delete_dir(void)
|
||||||
#ifdef HAVE_LCD_COLOR
|
#ifdef HAVE_LCD_COLOR
|
||||||
static bool set_backdrop(void)
|
static bool set_backdrop(void)
|
||||||
{
|
{
|
||||||
struct bitmap bm;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
/* load the image */
|
/* load the image */
|
||||||
bm.data=(char*)&main_backdrop[0][0];
|
if(load_main_backdrop(selected_file)) {
|
||||||
ret = read_bmp_file(selected_file, &bm,
|
|
||||||
sizeof(main_backdrop), FORMAT_NATIVE);
|
|
||||||
|
|
||||||
if ((ret > 0) && (bm.width == LCD_WIDTH)
|
|
||||||
&& (bm.height == LCD_HEIGHT)) {
|
|
||||||
lcd_set_backdrop(&main_backdrop[0][0]);
|
|
||||||
gui_syncsplash(HZ, true, str(LANG_BACKDROP_LOADED));
|
gui_syncsplash(HZ, true, str(LANG_BACKDROP_LOADED));
|
||||||
set_file(selected_file, (char *)global_settings.backdrop_file, MAX_FILENAME);
|
set_file(selected_file, (char *)global_settings.backdrop_file, MAX_FILENAME);
|
||||||
|
show_main_backdrop();
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
lcd_set_backdrop(NULL);
|
|
||||||
gui_syncsplash(HZ, true, str(LANG_BACKDROP_FAILED));
|
gui_syncsplash(HZ, true, str(LANG_BACKDROP_FAILED));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,25 +21,74 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "lcd.h"
|
#include "lcd.h"
|
||||||
#include "backdrop.h"
|
#include "backdrop.h"
|
||||||
|
#include "splash.h" /* debugging */
|
||||||
|
|
||||||
fb_data main_backdrop[LCD_HEIGHT][LCD_WIDTH];
|
fb_data main_backdrop[LCD_HEIGHT][LCD_WIDTH];
|
||||||
fb_data wps_backdrop[LCD_HEIGHT][LCD_WIDTH];
|
fb_data wps_backdrop[LCD_HEIGHT][LCD_WIDTH];
|
||||||
|
bool main_backdrop_valid = false;
|
||||||
|
bool wps_backdrop_valid = false;
|
||||||
|
|
||||||
bool load_main_backdrop(char* filename)
|
/* load a backdrop into a buffer */
|
||||||
|
bool load_backdrop(char* filename, fb_data* backdrop_buffer)
|
||||||
{
|
{
|
||||||
struct bitmap bm;
|
struct bitmap bm;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* load the image */
|
/* load the image */
|
||||||
bm.data=(char*)&main_backdrop[0][0];
|
bm.data=(char*)backdrop_buffer;
|
||||||
ret = read_bmp_file(filename, &bm, sizeof(main_backdrop), FORMAT_NATIVE);
|
ret = read_bmp_file(filename, &bm, sizeof(main_backdrop), FORMAT_NATIVE);
|
||||||
|
|
||||||
if ((ret > 0) && (bm.width == LCD_WIDTH)
|
if ((ret > 0) && (bm.width == LCD_WIDTH) && (bm.height == LCD_HEIGHT))
|
||||||
&& (bm.height == LCD_HEIGHT)) {
|
{
|
||||||
lcd_set_backdrop(&main_backdrop[0][0]);
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
}
|
||||||
lcd_set_backdrop(NULL);
|
else
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool load_main_backdrop(char* filename)
|
||||||
|
{
|
||||||
|
main_backdrop_valid = load_backdrop(filename, &main_backdrop[0][0]);
|
||||||
|
/* gui_syncsplash(100, true, "MAIN backdrop load: %s", main_backdrop_valid ? "OK" : "FAIL");*/
|
||||||
|
return main_backdrop_valid;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool load_wps_backdrop(char* filename)
|
||||||
|
{
|
||||||
|
wps_backdrop_valid = load_backdrop(filename, &wps_backdrop[0][0]);
|
||||||
|
/* gui_syncsplash(100, true, "WPS backdrop load: %s", main_backdrop_valid ? "OK" : "FAIL");*/
|
||||||
|
return wps_backdrop_valid;
|
||||||
|
}
|
||||||
|
|
||||||
|
void unload_main_backdrop(void)
|
||||||
|
{
|
||||||
|
main_backdrop_valid = false;
|
||||||
|
/* gui_syncsplash(100, true, "MAIN backdrop unload");*/
|
||||||
|
}
|
||||||
|
|
||||||
|
void unload_wps_backdrop(void)
|
||||||
|
{
|
||||||
|
wps_backdrop_valid = false;
|
||||||
|
/* gui_syncsplash(100, true, "WPS backdrop unload");*/
|
||||||
|
}
|
||||||
|
|
||||||
|
void show_main_backdrop(void)
|
||||||
|
{
|
||||||
|
lcd_set_backdrop(main_backdrop_valid ? &main_backdrop[0][0] : NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void show_wps_backdrop(void)
|
||||||
|
{
|
||||||
|
/* if no wps backdrop, fall back to main backdrop */
|
||||||
|
if(wps_backdrop_valid)
|
||||||
|
{
|
||||||
|
lcd_set_backdrop(&wps_backdrop[0][0]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* gui_syncsplash(100, true, "WPS backdrop show: fallback to MAIN");*/
|
||||||
|
show_main_backdrop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -25,14 +25,20 @@
|
||||||
#include "lcd.h"
|
#include "lcd.h"
|
||||||
#include "bmp.h"
|
#include "bmp.h"
|
||||||
#include "backdrop.h"
|
#include "backdrop.h"
|
||||||
|
/*
|
||||||
#ifdef HAVE_LCD_COLOR
|
|
||||||
extern fb_data main_backdrop[LCD_HEIGHT][LCD_WIDTH];
|
extern fb_data main_backdrop[LCD_HEIGHT][LCD_WIDTH];
|
||||||
extern fb_data wps_backdrop[LCD_HEIGHT][LCD_WIDTH];
|
extern fb_data wps_backdrop[LCD_HEIGHT][LCD_WIDTH];
|
||||||
#endif
|
*/
|
||||||
|
|
||||||
bool load_main_backdrop(char* filename);
|
bool load_main_backdrop(char* filename);
|
||||||
|
bool load_wps_backdrop(char* filename);
|
||||||
|
|
||||||
#endif
|
void unload_main_backdrop(void);
|
||||||
|
void unload_wps_backdrop(void);
|
||||||
|
|
||||||
#endif
|
void show_main_backdrop(void);
|
||||||
|
void show_wps_backdrop(void);
|
||||||
|
|
||||||
|
#endif /* HAVE_LCD_COLOR */
|
||||||
|
|
||||||
|
#endif /* _BACKDROP_H */
|
||||||
|
|
|
@ -64,6 +64,10 @@
|
||||||
#include "dsp.h"
|
#include "dsp.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_LCD_COLOR
|
||||||
|
#include "backdrop.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
#define SCROLLBAR_WIDTH 6
|
#define SCROLLBAR_WIDTH 6
|
||||||
#endif
|
#endif
|
||||||
|
@ -74,6 +78,9 @@ void usb_screen(void)
|
||||||
/* nothing here! */
|
/* nothing here! */
|
||||||
#else
|
#else
|
||||||
int i;
|
int i;
|
||||||
|
#ifdef HAVE_LCD_COLOR
|
||||||
|
show_main_backdrop();
|
||||||
|
#endif
|
||||||
FOR_NB_SCREENS(i) {
|
FOR_NB_SCREENS(i) {
|
||||||
screens[i].backlight_on();
|
screens[i].backlight_on();
|
||||||
gui_logo_draw(&usb_logos[i], &screens[i]);
|
gui_logo_draw(&usb_logos[i], &screens[i]);
|
||||||
|
|
|
@ -1055,6 +1055,9 @@ void settings_apply(void)
|
||||||
global_settings.peak_meter_clip_hold);
|
global_settings.peak_meter_clip_hold);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_LCD_COLOR
|
||||||
|
unload_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",
|
||||||
|
@ -1062,18 +1065,21 @@ void settings_apply(void)
|
||||||
wps_data_load(gui_wps[0].data, buf, true);
|
wps_data_load(gui_wps[0].data, buf, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
wps_data_init(gui_wps[0].data);
|
wps_data_init(gui_wps[0].data);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef HAVE_LCD_COLOR
|
#ifdef HAVE_LCD_COLOR
|
||||||
if ( global_settings.backdrop_file[0] &&
|
if ( global_settings.backdrop_file[0] &&
|
||||||
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);
|
load_main_backdrop(buf);
|
||||||
} else {
|
} else {
|
||||||
lcd_set_backdrop(NULL);
|
unload_main_backdrop();
|
||||||
}
|
}
|
||||||
|
show_main_backdrop();
|
||||||
|
|
||||||
screens[SCREEN_MAIN].set_foreground(global_settings.fg_color);
|
screens[SCREEN_MAIN].set_foreground(global_settings.fg_color);
|
||||||
screens[SCREEN_MAIN].set_background(global_settings.bg_color);
|
screens[SCREEN_MAIN].set_background(global_settings.bg_color);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1415,6 +1421,9 @@ bool settings_load_config(const char* file)
|
||||||
|
|
||||||
/* check for the string values */
|
/* check for the string values */
|
||||||
if (!strcasecmp(name, "wps")) {
|
if (!strcasecmp(name, "wps")) {
|
||||||
|
#ifdef HAVE_LCD_COLOR
|
||||||
|
unload_wps_backdrop();
|
||||||
|
#endif
|
||||||
if (wps_data_load(gui_wps[0].data, value, true))
|
if (wps_data_load(gui_wps[0].data, value, true))
|
||||||
set_file(value, (char *)global_settings.wps_file, MAX_FILENAME);
|
set_file(value, (char *)global_settings.wps_file, MAX_FILENAME);
|
||||||
}
|
}
|
||||||
|
@ -1444,8 +1453,10 @@ bool settings_load_config(const char* file)
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_LCD_COLOR
|
#ifdef HAVE_LCD_COLOR
|
||||||
else if (!strcasecmp(name, "backdrop")) {
|
else if (!strcasecmp(name, "backdrop")) {
|
||||||
if (load_main_backdrop(value))
|
if (load_main_backdrop(value)) {
|
||||||
set_file(value, (char *)global_settings.backdrop_file, MAX_FILENAME);
|
set_file(value, (char *)global_settings.backdrop_file, MAX_FILENAME);
|
||||||
|
show_main_backdrop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
|
|
|
@ -78,6 +78,10 @@ void dac_line_in(bool enable);
|
||||||
#include "dsp.h"
|
#include "dsp.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_LCD_COLOR
|
||||||
|
#include "backdrop.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_CHARGING
|
#ifdef HAVE_CHARGING
|
||||||
static bool car_adapter_mode(void)
|
static bool car_adapter_mode(void)
|
||||||
{
|
{
|
||||||
|
@ -323,7 +327,8 @@ static bool invert_cursor(void)
|
||||||
static bool clear_main_backdrop(void)
|
static bool clear_main_backdrop(void)
|
||||||
{
|
{
|
||||||
global_settings.backdrop_file[0]=0;
|
global_settings.backdrop_file[0]=0;
|
||||||
lcd_set_backdrop(NULL);
|
unload_main_backdrop();
|
||||||
|
show_main_backdrop();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
17
apps/tree.c
17
apps/tree.c
|
@ -75,6 +75,10 @@
|
||||||
#include "widgets.h"
|
#include "widgets.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_LCD_COLOR
|
||||||
|
#include "backdrop.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* a table for the know file types */
|
/* a table for the know file types */
|
||||||
const struct filetype filetypes[] = {
|
const struct filetype filetypes[] = {
|
||||||
{ "mp3", TREE_ATTR_MPA, Icon_Audio, VOICE_EXT_MPA },
|
{ "mp3", TREE_ATTR_MPA, Icon_Audio, VOICE_EXT_MPA },
|
||||||
|
@ -877,23 +881,14 @@ static bool dirbrowse(void)
|
||||||
if (start_wps && audio_status() )
|
if (start_wps && audio_status() )
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
#ifdef HAVE_LCD_COLOR
|
|
||||||
fb_data* old_backdrop;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
FOR_NB_SCREENS(i)
|
FOR_NB_SCREENS(i)
|
||||||
screens[i].stop_scroll();
|
screens[i].stop_scroll();
|
||||||
#ifdef HAVE_LCD_COLOR
|
|
||||||
old_backdrop = lcd_get_backdrop();
|
|
||||||
#endif
|
|
||||||
if (gui_wps_show() == SYS_USB_CONNECTED)
|
if (gui_wps_show() == SYS_USB_CONNECTED)
|
||||||
reload_dir = true;
|
reload_dir = true;
|
||||||
#ifdef HAVE_LCD_COLOR
|
#ifdef HAVE_LCD_COLOR
|
||||||
/* check if the backdrop hasn't been cleared */
|
show_main_backdrop();
|
||||||
if(global_settings.backdrop_file[0])
|
|
||||||
lcd_set_backdrop(old_backdrop);
|
|
||||||
else
|
|
||||||
lcd_set_backdrop(NULL);
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_HOTSWAP
|
#ifdef HAVE_HOTSWAP
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue