Index: apps/lang/english.lang =================================================================== --- apps/lang/english.lang (revision 14221) +++ apps/lang/english.lang (working copy) @@ -11004,3 +11004,17 @@ *: "Demos" + + id: LANG_SHOW_SPLASH + desc: in settings_menu + user: + + *: "Configure Splash Screen" + + + *: "Configure Splash Screen" + + + *: "Configure Splash Screen" + + Index: apps/settings.h =================================================================== --- apps/settings.h (revision 14221) +++ apps/settings.h (working copy) @@ -416,6 +416,7 @@ instead of using the default cursor */ bool flip_display; /* turn display (and button layout) by 180 degrees */ int poweroff; /* power off timer */ int backlight_timeout; /* backlight off timeout: 0-18 0=never, 1=always, then according to timeout_values[] */ @@ -493,6 +494,14 @@ #ifdef HAVE_LCD_BITMAP bool offset_out_of_view; int screen_scroll_step; + +/* custom user splash screen */ +/* bool show_splash; */ /* 0=hide 1=show */ + int splash_timeout; /* splash screen off timeout: 0-9 0=never, + 1=always, + then according to timeout_values[] */ +/* custom user splash screen */ + #endif /* auto bookmark settings */ Index: apps/menus/display_menu.c =================================================================== --- apps/menus/display_menu.c (revision 14221) +++ apps/menus/display_menu.c (working copy) @@ -571,13 +571,20 @@ #endif MENUITEM_SETTING(show_icons, &global_settings.show_icons, NULL); +#ifdef HAVE_LCD_BITMAP +/* custom user splash screen */ +/* MENUITEM_SETTING(show_splash, &global_settings.show_splash, NULL); */ +MENUITEM_SETTING(splash_timeout, &global_settings.splash_timeout, NULL); +/* custom user splash screen */ +#endif MENUITEM_SETTING(codepage_setting, &global_settings.default_codepage, NULL); MAKE_MENU(display_menu, ID2P(LANG_DISPLAY), NULL, Icon_Display_menu, #ifdef HAVE_LCD_BITMAP - &browse_fonts, + /* &show_splash, */ + &splash_timeout, &browse_fonts, #endif &browse_wps, #ifdef HAVE_REMOTE_LCD @@ -589,6 +596,7 @@ #endif &show_icons, &scroll_settings_menu, #ifdef HAVE_LCD_BITMAP + &bars_menu, &peak_meter_menu, #endif &codepage_setting, Index: apps/settings_list.c =================================================================== --- apps/settings_list.c (revision 14221) +++ apps/settings_list.c (working copy) @@ -150,6 +150,7 @@ static const char off_number_spell[] = "off,number,spell"; #ifdef HAVE_LCD_BITMAP static const char graphic_numeric[] = "graphic,numeric"; + #endif #ifdef HAVE_RECORDING @@ -204,6 +205,40 @@ #endif /* HAVE_RECORDING */ +#ifdef HAVE_LCD_BITMAP +/* for custom user splash screen */ +static const char splash_times_conf [] = + "off,1,2,3,4,5,6,7,8,9"; +static const int splash_times[] = + {-1, 1, 2, 3, 4, 5, 6, 7, 8, 9}; +static void splash_formatter(char *buffer, int buffer_size, + int val, const char *unit) +{ + (void)unit; + if (val == 0) + strcpy(buffer, str(LANG_OFF)); + else if (val == 1) + strcpy(buffer, str(LANG_ON)); + else + snprintf(buffer, buffer_size, "%d s", splash_times[val]); +} +static long splash_getlang(int value) +{ + if (value == 0) + return LANG_OFF; + else if (value == 1) + return LANG_ON; + return TALK_ID(splash_times[value], UNIT_SEC); +} + +/*this function not needed */ +static void splash_set_timeout(int value) +{ + //splash_timeout=value; +} +/* for custom user splash screen */ +#endif + #ifdef HAVE_BACKLIGHT static const char backlight_times_conf [] = "off,on,1,2,3,4,5,6,7,8,9,10,15,20,25,30,45,60,90"; @@ -440,6 +475,7 @@ #endif #endif /* HAVE_BACKLIGHT */ #ifdef HAVE_LCD_BITMAP + #ifdef HAVE_LCD_INVERT BOOL_SETTING(0, invert, LANG_INVERT, false ,"invert", off_on, LANG_INVERT_LCD_INVERSE, LANG_NORMAL, lcd_set_invert_display), @@ -467,6 +503,14 @@ "time format", "24hour,12hour", NULL, 2, ID2P(LANG_24_HOUR_CLOCK), ID2P(LANG_12_HOUR_CLOCK)), #endif +/* custom user splash screen */ +/* OFFON_SETTING(0,show_splash, LANG_SHOW_SPLASH , true,"show splash screen", NULL), */ + + INT_SETTING_W_CFGVALS(F_FLIPLIST, splash_timeout, LANG_SHOW_SPLASH, 6, + "splash timeout", splash_times_conf, UNIT_SEC, + 0, 9, 1, splash_formatter, NULL, + splash_set_timeout), +/* custom user splash screen */ #endif /* HAVE_LCD_BITMAP */ OFFON_SETTING(0,show_icons, LANG_SHOW_ICONS ,true,"show icons", NULL), /* system */ Index: apps/main.c =================================================================== --- apps/main.c (revision 14221) +++ apps/main.c (working copy) @@ -264,7 +264,12 @@ lcd_remote_init(); #endif font_init(); + + +#ifndef HAVE_LCD_BITMAP show_logo(); +#endif + button_init(); backlight_init(); lang_init(); @@ -280,6 +285,28 @@ settings_apply(); init_dircache(true); init_dircache(false); + +#ifdef HAVE_LCD_BITMAP +/* just for the sim. This mimics the behaviour on target */ + if(global_settings.splash_timeout > 0){ + static fb_data save_buffer2[LCD_WIDTH*LCD_HEIGHT]; + struct bitmap bm2; + int ret2 =0; + bm2.data = (char*)save_buffer2; + ret2 = read_bmp_file( "/.rockbox/splash.bmp", &bm2, LCD_WIDTH*LCD_HEIGHT*sizeof(fb_data), FORMAT_NATIVE | FORMAT_DITHER); + if(ret2 <= 0){ + show_logo(); + }else{ + lcd_bitmap(save_buffer2, 0, 0, bm2.width, bm2.height); + lcd_update(); + sleep(HZ*global_settings.splash_timeout); + } + }else{ + show_logo(); + } +/* custom user splash screen */ +#endif + #ifdef HAVE_TAGCACHE init_tagcache(); #endif @@ -352,7 +379,11 @@ #endif font_init(); +#ifndef HAVE_LCD_BITMAP +/* like this for the custom splash screen */ show_logo(); +#endif + lang_init(); #ifdef DEBUG @@ -501,6 +532,29 @@ gui_sync_wps_init(); settings_apply(); + +#ifdef HAVE_LCD_BITMAP +/* custom user splash screen */ + if(global_settings.splash_timeout > 0){ + static fb_data save_buffer2[LCD_WIDTH*LCD_HEIGHT]; + struct bitmap bm2; + int ret2 =0; + bm2.data = (char*)save_buffer2; + ret2 = read_bmp_file( "/.rockbox/splash.bmp", &bm2, LCD_WIDTH*LCD_HEIGHT*sizeof(fb_data), FORMAT_NATIVE | FORMAT_DITHER); + if(ret2 <= 0){ + show_logo(); + }else{ + lcd_bitmap(save_buffer2, 0, 0, bm2.width, bm2.height); + lcd_update(); + sleep(HZ*global_settings.splash_timeout); + } + }else{ + show_logo(); + } +/* custom user splash screen */ +#endif + + init_dircache(false); #ifdef HAVE_TAGCACHE init_tagcache();