📄 mapp_uimenu2.c
字号:
MainFB.width=NEWUI_MAIN_MENU_WIDTH;
SubFB2.width=NEWUI_MAIN_MENU_WIDTH;
msAPI_OSD_CopyRegion(&MainFB, &SubFB2);
//To generating a framebuffer to save the sub-mainmenu pic
u8SubFbID1=msAPI_GOP_GWIN_GetFreeFBID();
msAPI_GOP_GWIN_CreateFB(u8SubFbID1, NEWUI_MAIN_MENU_WIDTH, NEWUI_MAIN_MENU_HEIGHT, DEFAULT_FB_FMT);
msAPI_GOP_GWIN_Switch2FB(u8SubFbID1);
MApp_UiMenu_DrawMenuPage();
//Switch gwin to display animate
msAPI_GOP_GWIN_Switch2Gwin(msAPI_GOP_GWIN_GetCurrentWinId());
//To generating a dissapear effect of right pic
msAPI_GOP_GWIN_Enable(msAPI_GOP_GWIN_GetCurrentWinId(),TRUE);
//parameter settings of main-menu pic
draw_w = NEWUI_MAIN_MENU_WIDTH;
//parameter settings of sub-mainmenu pic
SubFB1.fbID=u8SubFbID1;
SubFB1.y=0;
SubFB1.height=NEWUI_MAIN_MENU_HEIGHT;
switch (menuAction)
{
case MIA_SLIDESHOW2NEXT:
//main page slides to the right, and sub-mainmenu slides from left to right
for (i=1;i<=(draw_w/interval);i++)
{
if(i<(draw_w/interval))
{
SubFB2.width=draw_w-i*interval;
MainFB.x=i*interval;
MainFB.width=draw_w-i*interval;
msAPI_OSD_CopyRegion(&SubFB2, &MainFB);
}
SubFB1.x=draw_w-i*interval;
SubFB1.width=i*interval;
MainFB.x=0;
MainFB.width=i*interval;
msAPI_OSD_CopyRegion(&SubFB1, &MainFB);
}
break;
case MIA_SLIDESHOW2PREV:
SubFB1.x=0;
for (i=1;i<=(draw_w)/interval-1;i++)
{
SubFB2.x=i*interval;
SubFB2.width=draw_w-i*interval;
MainFB.x=0;
MainFB.width=draw_w-i*interval;
msAPI_OSD_CopyRegion(&SubFB2, &MainFB);
if (i==(draw_w)/interval-1)
{
i=(draw_w)/interval;
}
SubFB1.width=i*interval;
MainFB.x=draw_w-i*interval;
MainFB.width=i*interval;
msAPI_OSD_CopyRegion(&SubFB1, &MainFB);
}
break;
}
msAPI_GOP_GWIN_DeleteFB(u8SubFbID1); //After displaying, free the framebuffer
msAPI_GOP_GWIN_DeleteFB(u8SubFbID2);
}
void MApp_UiMenu2_DisplayScalingDown(void)//(U8 inc,U16 Step)
{
U8 u8CurFbID,u8FbID1;
MSAPI_OSDRegion currentFB,tmpFB1;
U8 i=0;
U8 inc=2;
//U8 Step=30;
U16 u16HStart,u16VStart,u16HSize,u16VSize;
u8CurFbID=msAPI_GOP_GWIN_GetFBfromGWIN(msAPI_GOP_GWIN_GetCurrentWinId());
//msAPI_GOP_GWIN_GetFBInfo(u8CurFbID, &CurfbAttr);
//To get a free framebuffer to keep a original pic
u8FbID1=msAPI_GOP_GWIN_GetFreeFBID();
msAPI_GOP_GWIN_CreateFB(u8FbID1, NEWUI_MAIN_MENU_WIDTH, NEWUI_MAIN_MENU_HEIGHT, DEFAULT_FB_FMT);
msAPI_GOP_GWIN_Switch2FB(u8FbID1);
MApp_UiMenu_DrawMenuPage();
//if (g_u8MenuPageIndex==MENU_DVD1)
//MApp_UiMenu2_ClearOSD(DVD_PREVIEW_START_X,DVD_PREVIEW_START_Y,DVD_PREVIEW_WIDTH,DVD_PREVIEW_HEIGHT);
msAPI_GOP_GWIN_Switch2Gwin(msAPI_GOP_GWIN_GetCurrentWinId());
currentFB.fbID=u8CurFbID;
currentFB.x=0;
currentFB.y=0;
currentFB.height=NEWUI_MAIN_MENU_HEIGHT;
currentFB.width=NEWUI_MAIN_MENU_WIDTH;
tmpFB1.fbID=u8FbID1;
for(i=30;i>0;i-=inc)
{
tmpFB1.y=i;
tmpFB1.x=(tmpFB1.y*NEWUI_MAIN_MENU_WIDTH)/NEWUI_MAIN_MENU_HEIGHT;
tmpFB1.height=(NEWUI_MAIN_MENU_HEIGHT-tmpFB1.y*2);
tmpFB1.width=(NEWUI_MAIN_MENU_WIDTH-tmpFB1.x*2);
msAPI_OSD_CopyRegion(&tmpFB1, ¤tFB);
u16HSize=DVD_PREVIEW_WIDTH+4*i;
u16VSize=DVD_PREVIEW_HEIGHT+2*i;
u16HStart=(480-u16HSize)/2;
u16VStart=(234-u16VSize)/2;
//MApp_Scaler_SetCustomerWindow(ENABLE, VIDEOSCREEN_WIDE, u16HStart, u16VStart, u16HSize, u16VSize);
}
tmpFB1.y=i;
tmpFB1.x=(tmpFB1.y*NEWUI_MAIN_MENU_WIDTH)/NEWUI_MAIN_MENU_HEIGHT;
tmpFB1.height=(NEWUI_MAIN_MENU_HEIGHT-tmpFB1.y*2);
tmpFB1.width=(NEWUI_MAIN_MENU_WIDTH-tmpFB1.x*2);
msAPI_OSD_CopyRegion(&tmpFB1, ¤tFB);
u16HSize=DVD_PREVIEW_WIDTH+4*i;
u16VSize=DVD_PREVIEW_HEIGHT+2*i;
u16HStart=(480-u16HSize)/2;
u16VStart=(234-u16VSize)/2;
//MApp_Scaler_SetCustomerWindow(ENABLE, VIDEOSCREEN_WIDE, u16HStart, u16VStart, u16HSize, u16VSize);
//After displaying, free the framebuffer
msAPI_GOP_GWIN_DeleteFB(u8FbID1);
}
#define SCALINGWIN_START_X 132
#define SCALINGWIN_START_Y 25
#define SCALINGWIN_WIDTH 348
#define SCALINGWIN_HEIGHT 180
void MApp_UiMenu2_DisplayScalingAnimate(void)
{
U8 u8CurFbID,u8FbID1,u8FbID2,u8FbID3;
Gwin_FB_Attr CurfbAttr;//,fbAttr1;
MSAPI_OSDRegion currentFB,tmpFB1,tmpFB2,tmpFB3;
U8 i=0;
U8 j=0;
U16 draw_w, draw_h;
OSDClrBtn pclrBtn;
U16 increasement=4;
draw_w =SCALINGWIN_WIDTH;
draw_h =SCALINGWIN_HEIGHT;
u8CurFbID=msAPI_GOP_GWIN_GetFBfromGWIN(msAPI_GOP_GWIN_GetCurrentWinId());
msAPI_GOP_GWIN_GetFBInfo(u8CurFbID, &CurfbAttr);
//=================================================
// display scaling down
//To get a free framebuffer to keep a original pic
u8FbID1=msAPI_GOP_GWIN_GetFreeFBID();
msAPI_GOP_GWIN_CreateFB(u8FbID1, draw_w, draw_h, CurfbAttr.fbFmt);// width,high can be scale to a half to save spaces
//msAPI_GOP_GWIN_GetFBInfo(u8FbID1, &fbAttr1);
//Copy the original framebuffer 0 to framebuffer 1
currentFB.fbID=u8CurFbID;
currentFB.height=draw_h;
currentFB.width=draw_w;
currentFB.x=SCALINGWIN_START_X;
currentFB.y=SCALINGWIN_START_Y;
tmpFB1.x=0;
tmpFB1.y=0;
tmpFB1.fbID=u8FbID1;
pclrBtn.x=SCALINGWIN_START_X;
pclrBtn.width=draw_w;
pclrBtn.u8Gradient = CONSTANT_COLOR;
pclrBtn.fHighLight = FALSE;
pclrBtn.b_clr = COLOR_BLACK;
for(i=0;i<2;i++)
{
tmpFB1.height=currentFB.height;
tmpFB1.width=currentFB.width;
msAPI_OSD_CopyRegion(¤tFB, &tmpFB1);
for(j=0;j<=45;j+=increasement)
{
//Draw black rectangular as background
currentFB.height=(tmpFB1.height)*(100-j)/100;
currentFB.y=SCALINGWIN_START_Y+((draw_h-currentFB.height)/2+1);
pclrBtn.y=SCALINGWIN_START_Y;
pclrBtn.height=currentFB.y-SCALINGWIN_START_Y;
msAPI_OSD_DrawBlock(&pclrBtn);
pclrBtn.y=SCALINGWIN_START_Y+pclrBtn.height+currentFB.height+1;
msAPI_OSD_DrawBlock(&pclrBtn);
msAPI_OSD_CopyRegion(&tmpFB1, ¤tFB);
}
}
msAPI_GOP_GWIN_DeleteFB(u8FbID1);
//=================================================
//Draw Menu to framebuffer 2
u8FbID2=msAPI_GOP_GWIN_GetFreeFBID();
msAPI_GOP_GWIN_CreateFB(u8FbID2, NEWUI_MAIN_MENU_WIDTH, NEWUI_MAIN_MENU_HEIGHT, CurfbAttr.fbFmt);
msAPI_GOP_GWIN_Switch2FB(u8FbID2);
if(g_u8MenuPageIndex==MENU_SETTING_AUDIO_SOUNDFIELD)
{
MApp_UiMenu_DrawStaticPageItem();
MApp_UiMenu_DrawComponents(DrawAudioSettingBtn, EN_CPSTATE_SELECT);
}
else
MApp_UiMenu_DrawMenuPage();
//=================================================
// display scaling up
//To get a free framebuffer 1 to keep a 1/4 size of original pic
u8FbID1=msAPI_GOP_GWIN_GetFreeFBID();
msAPI_GOP_GWIN_CreateFB(u8FbID1, draw_w, (draw_h)/2+1, CurfbAttr.fbFmt);// width,high can be scale to a half to save spaces
//Copy the scaling window from framebuffer 2 to framebuffer 1
tmpFB2.fbID=u8FbID2;
tmpFB2.height=draw_h;
tmpFB2.width=draw_w;
tmpFB2.x=SCALINGWIN_START_X;
tmpFB2.y=SCALINGWIN_START_Y;
tmpFB1.x=0;
tmpFB1.y=0;
tmpFB1.fbID=u8FbID1;
tmpFB1.height=(draw_h)*51/100;// hardware limit
tmpFB1.width=draw_w; //hardware linit
msAPI_OSD_CopyRegion(&tmpFB2, &tmpFB1);
//To get a free framebuffer 3 to keep scaling window original pic
u8FbID3=msAPI_GOP_GWIN_GetFreeFBID();
msAPI_GOP_GWIN_CreateFB(u8FbID3, draw_w, draw_h, CurfbAttr.fbFmt);// width,high can be scale to a half to save spaces
//Copy the scaling window from framebuffer 2 to framebuffer 3
tmpFB3.fbID=u8FbID3;
tmpFB3.height=tmpFB2.height;
tmpFB3.width=tmpFB2.width;
tmpFB3.x=0;
tmpFB3.y=0;
msAPI_OSD_CopyRegion(&tmpFB2, &tmpFB3);
//Draw black rectangular as background
pclrBtn.x=SCALINGWIN_START_X;
pclrBtn.y=SCALINGWIN_START_Y;
pclrBtn.height=draw_h;
pclrBtn.width=draw_w;
pclrBtn.b_clr=COLOR_BLACK;
msAPI_OSD_DrawBlock(&pclrBtn);
//Paste 1/16 size scaling window to 1/4 size framebuffer 2
tmpFB2.height=(tmpFB1.height)*55/100;
tmpFB2.y=SCALINGWIN_START_Y+((draw_h-tmpFB2.height)/2+1);
msAPI_OSD_CopyRegion(&tmpFB1, &tmpFB2);
msAPI_GOP_GWIN_Switch2Gwin(msAPI_GOP_GWIN_GetCurrentWinId());
//Copy framebuffer 2 to current Gwin buffer
tmpFB2.height=NEWUI_MAIN_MENU_HEIGHT;
tmpFB2.width=NEWUI_MAIN_MENU_WIDTH;
tmpFB2.x=0;
tmpFB2.y=0;
currentFB.x=0;
currentFB.y=0;
currentFB.height=NEWUI_MAIN_MENU_HEIGHT;
currentFB.width=NEWUI_MAIN_MENU_WIDTH;
msAPI_OSD_CopyRegion(&tmpFB2, ¤tFB);
// Paste 1/16 size to full size
currentFB.x=SCALINGWIN_START_X;
currentFB.y=SCALINGWIN_START_Y;
currentFB.width=tmpFB1.width;
for(j=0;j<=144-increasement;j+=increasement)
{
currentFB.height=(tmpFB1.height)*(55+j)/100;
currentFB.y=SCALINGWIN_START_Y+((draw_h-currentFB.height)/2+1);
msAPI_OSD_CopyRegion(&tmpFB1, ¤tFB);
}
currentFB.y=SCALINGWIN_START_Y;
currentFB.height=tmpFB3.height;
msAPI_OSD_CopyRegion(&tmpFB3, ¤tFB);
//After displaying, free the framebuffer
msAPI_GOP_GWIN_DeleteFB(u8FbID1);
msAPI_GOP_GWIN_DeleteFB(u8FbID2);
msAPI_GOP_GWIN_DeleteFB(u8FbID3);
}
void MApp_UiMenu2_DisplayScalingSpread(void)//(U8 inc,U16 Step)
{
U8 u8CurFbID,u8FbID1;
MSAPI_OSDRegion currentFB,tmpFB1;
U8 i;
U8 inc=2;
U16 u16HStart,u16VStart,u16HSize,u16VSize;
u8CurFbID=msAPI_GOP_GWIN_GetFBfromGWIN(msAPI_GOP_GWIN_GetCurrentWinId());
//msAPI_GOP_GWIN_GetFBInfo(u8CurFbID, &CurfbAttr);
//To get a free framebuffer to keep a original pic
u8FbID1=msAPI_GOP_GWIN_GetFreeFBID();
msAPI_GOP_GWIN_CreateFB(u8FbID1, NEWUI_MAIN_MENU_WIDTH, NEWUI_MAIN_MENU_HEIGHT, DEFAULT_FB_FMT);
currentFB.fbID=u8CurFbID;
tmpFB1.x=0;
tmpFB1.y=0;
tmpFB1.fbID=u8FbID1;
tmpFB1.height=NEWUI_MAIN_MENU_HEIGHT;
tmpFB1.width=NEWUI_MAIN_MENU_WIDTH;
for(i=inc;i<=30;i+=inc)
{
currentFB.x=i;
currentFB.y=i;
currentFB.height=NEWUI_MAIN_MENU_HEIGHT-2*currentFB.y;
currentFB.width=NEWUI_MAIN_MENU_WIDTH-2*currentFB.x;
u16HSize=DVD_PREVIEW_WIDTH+4*i;
u16VSize=DVD_PREVIEW_HEIGHT+2*i;
u16HStart=(NEWUI_MAIN_MENU_WIDTH-u16HSize)/2;
u16VStart=(NEWUI_MAIN_MENU_HEIGHT-u16VSize)/2;
//MApp_Scaler_SetCustomerWindow(ENABLE, VIDEOSCREEN_WIDE, u16HStart, u16VStart, u16HSize, u16VSize);
msAPI_OSD_CopyRegion(¤tFB, &tmpFB1);
currentFB.x=0;
currentFB.y=0;
currentFB.height=NEWUI_MAIN_MENU_HEIGHT;
currentFB.width=NEWUI_MAIN_MENU_WIDTH;
msAPI_OSD_CopyRegion(&tmpFB1, ¤tFB);
}
//After displaying, free the framebuffer
msAPI_GOP_GWIN_DeleteFB(u8FbID1);
}
void MApp_UiMenu2_DisplayPopUpWindow(U16 winXstart, U16 winYstart, U16 winWidth, U16 winHeight)
{
U8 u8CurFbID,u8FbID1,u8FbID2,u8FbID3;
Gwin_FB_Attr CurfbAttr;//,fbAttr1;
MSAPI_OSDRegion currentFB,tmpFB1,tmpFB2,tmpFB3;
U8 j=0;
U16 draw_w, draw_h;
U16 increasement=2;
draw_w =winWidth;
draw_h =winHeight;
u8CurFbID=msAPI_GOP_GWIN_GetFBfromGWIN(msAPI_GOP_GWIN_GetCurrentWinId());
msAPI_GOP_GWIN_GetFBInfo(u8CurFbID, &CurfbAttr);
//=================================================
//Draw Menu to framebuffer 2
u8FbID2=msAPI_GOP_GWIN_GetFreeFBID();
msAPI_GOP_GWIN_CreateFB(u8FbID2, NEWUI_MAIN_MENU_WIDTH, NEWUI_MAIN_MENU_HEIGHT, CurfbAttr.fbFmt);
msAPI_GOP_GWIN_Switch2FB(u8FbID2);
MApp_UiMenu_DrawMenuPage();
//=================================================
// display scaling up
//To get a free framebuffer 1 to keep a 1/4 size of original pic
u8FbID1=msAPI_GOP_GWIN_GetFreeFBID();
msAPI_GOP_GWIN_CreateFB(u8FbID1, (draw_w)/2+1, (draw_h)/2+1, CurfbAttr.fbFmt);// width,high can be scale to a half to save spaces
//Copy the scaling window from framebuffer 2 to framebuffer 1
tmpFB2.fbID=u8FbID2;
tmpFB2.height=draw_h;
tmpFB2.width=draw_w;
tmpFB2.x=winXstart;
tmpFB2.y=winYstart;
tmpFB1.x=0;
tmpFB1.y=0;
tmpFB1.fbID=u8FbID1;
tmpFB1.height=(draw_h)*51/100;// hardware limit
tmpFB1.width=(draw_w)*51/100;; //hardware linit
msAPI_OSD_CopyRegion(&tmpFB2, &tmpFB1);
//To get a free framebuffer 3 to keep scaling window original pic
u8FbID3=msAPI_GOP_GWIN_GetFreeFBID();
msAPI_GOP_GWIN_CreateFB(u8FbID3, draw_w, draw_h, CurfbAttr.fbFmt);// width,high can be scale to a half to save spaces
//Copy the scaling window from framebuffer 2 to framebuffer 3
tmpFB3.fbID=u8FbID3;
tmpFB3.height=tmpFB2.height;
tmpFB3.width=tmpFB2.width;
tmpFB3.x=0;
tmpFB3.y=0;
msAPI_OSD_CopyRegion(&tmpFB2, &tmpFB3);
msAPI_GOP_GWIN_Switch2Gwin(msAPI_GOP_GWIN_GetCurrentWinId());
// Paste 1/16 size to full size
currentFB.fbID=u8CurFbID;
for(j=0;j<=144-increasement;j+=increasement)
{
currentFB.height=(tmpFB1.height)*(55+j)/100;
currentFB.width=(tmpFB1.width)*(55+j)/100;
currentFB.y = winYstart + ((winHeight - currentFB.height)/2 + 1);
currentFB.x = winXstart + ((winWidth -currentFB.width)/2 + 1);
msAPI_OSD_CopyRegion(&tmpFB1, ¤tFB);
}
currentFB.x=winXstart;
currentFB.y=winYstart;
currentFB.width=tmpFB3.width;
currentFB.height=tmpFB3.height;
msAPI_OSD_CopyRegion(&tmpFB3, ¤tFB);
msAPI_GOP_GWIN_DeleteFB(u8FbID1);
msAPI_GOP_GWIN_DeleteFB(u8FbID2);
msAPI_GOP_GWIN_DeleteFB(u8FbID3);
}
#undef MAPP_UI_MENU2_C
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -