Hide OSD after timeout if background picture is present.

This commit is contained in:
sorgelig
2019-05-30 00:47:38 +08:00
parent 5e0f6e92b4
commit d637e11ee5
3 changed files with 42 additions and 0 deletions

View File

@@ -806,6 +806,39 @@ void HandleUI(void)
cfg.bootcore[0] = '\0';
}
if (is_menu_core())
{
static int menu_visible = 1;
static unsigned long timeout = 0;
if (!video_fb_state() && video_bg_has_picture())
{
if (timeout && menu_visible && CheckTimer(timeout))
{
menu_visible = 0;
spi_osd_cmd(MM1_OSDCMDDISABLE);
}
if (c || menustate != MENU_FILE_SELECT2)
{
timeout = 0;
if (!menu_visible)
{
c = 0;
menu_visible = 1;
spi_osd_cmd(MM1_OSDCMDWRITE | 8);
spi_osd_cmd(MM1_OSDCMDENABLE);
}
}
if (!timeout) timeout = GetTimer(120000);
}
else
{
timeout = 0;
menu_visible = 1;
}
}
//prevent OSD control while script is executing on framebuffer
if (!video_fb_state() || video_chvt(0) != 2)
{

View File

@@ -854,9 +854,11 @@ static void vs_wait()
printf("vs_wait(us): %llu\n", t2 - t1);
}
static int bg_has_picture = 0;
extern uint8_t _binary_logo_png_start[], _binary_logo_png_end[];
void video_menu_bg(int n)
{
bg_has_picture = 0;
menu_bg = n;
if (n)
{
@@ -952,6 +954,7 @@ void video_menu_bg(int n)
0, 0, //int destination_x, int destination_y,
fb_width, fb_height //int destination_width, int destination_height
);
bg_has_picture = 1;
break;
}
else
@@ -1018,6 +1021,11 @@ void video_menu_bg(int n)
video_fb_enable(0);
}
int video_bg_has_picture()
{
return bg_has_picture;
}
int video_chvt(int num)
{
static int cur_vt = 0;

View File

@@ -14,6 +14,7 @@ int hasAPI1_5();
void video_fb_enable(int enable, int n = 0);
int video_fb_state();
void video_menu_bg(int n);
int video_bg_has_picture();
int video_chvt(int num);
void video_cmd(char *cmd);