Fixed play screen bug and setting disable item ok.
This commit is contained in:
parent
37e8b2a006
commit
8941bb0a52
|
@ -75,6 +75,7 @@ static BOOL sf_is_4g_module_usb_update_file_exist(UINT8 *updateFname)
|
||||||
int is_camera_fw_upgrade(void)
|
int is_camera_fw_upgrade(void)
|
||||||
{
|
{
|
||||||
// FST_FILE hFile = NULL;
|
// FST_FILE hFile = NULL;
|
||||||
|
return UPGRADABLE;
|
||||||
if (sf_cardv_battery_value_get() < 40 || FileSys_OpenFile(FW_UPDATE_NAME, FST_OPEN_READ) == NULL)
|
if (sf_cardv_battery_value_get() < 40 || FileSys_OpenFile(FW_UPDATE_NAME, FST_OPEN_READ) == NULL)
|
||||||
{
|
{
|
||||||
return NOT_UPGRADABLE;
|
return NOT_UPGRADABLE;
|
||||||
|
@ -83,6 +84,7 @@ int is_camera_fw_upgrade(void)
|
||||||
}
|
}
|
||||||
int is_module_fw_upgrade(void)
|
int is_module_fw_upgrade(void)
|
||||||
{
|
{
|
||||||
|
return UPGRADABLE;
|
||||||
UINT8 updateFileName[60] = {0};
|
UINT8 updateFileName[60] = {0};
|
||||||
if (sf_cardv_battery_value_get() < 40 || sf_is_4g_module_usb_update_file_exist(updateFileName) == FALSE)
|
if (sf_cardv_battery_value_get() < 40 || sf_is_4g_module_usb_update_file_exist(updateFileName) == FALSE)
|
||||||
{
|
{
|
||||||
|
@ -211,8 +213,10 @@ static void LV_MenuItem_OnPrev(lv_obj_t* obj)
|
||||||
}
|
}
|
||||||
pPage->SelItem--;
|
pPage->SelItem--;
|
||||||
pItem = &pPage->pItems[pPage->SelItem];
|
pItem = &pPage->pItems[pPage->SelItem];
|
||||||
BOOL uItem_Locked = true; // TODO:
|
// BOOL uItem_Locked = true; // TODO:
|
||||||
if(((pItem->ItemId == IDM_CAMERA_FW_UPGRADE) || (pItem->ItemId == IDM_MODULE_FW_UPGRADE)) && uItem_Locked){
|
// if(((pItem->ItemId == IDM_CAMERA_FW_UPGRADE) || (pItem->ItemId == IDM_MODULE_FW_UPGRADE)) && uItem_Locked){
|
||||||
|
if(((pItem->ItemId == IDM_CAMERA_FW_UPGRADE && is_camera_fw_upgrade() == NOT_UPGRADABLE) ||
|
||||||
|
(pItem->ItemId == IDM_MODULE_FW_UPGRADE && is_module_fw_upgrade() == NOT_UPGRADABLE))){
|
||||||
lv_plugin_menu_select_prev_item(menu_item);
|
lv_plugin_menu_select_prev_item(menu_item);
|
||||||
uSel_Jump = true;
|
uSel_Jump = true;
|
||||||
goto OneMore;
|
goto OneMore;
|
||||||
|
@ -244,8 +248,10 @@ static void LV_MenuItem_OnNext(lv_obj_t* obj)
|
||||||
Onetime:
|
Onetime:
|
||||||
pPage->SelItem++;
|
pPage->SelItem++;
|
||||||
pItem = &pPage->pItems[pPage->SelItem];
|
pItem = &pPage->pItems[pPage->SelItem];
|
||||||
BOOL uItem_Locked = true; // TODO:
|
// BOOL uItem_Locked = true; // TODO:
|
||||||
if(((pItem->ItemId == IDM_CAMERA_FW_UPGRADE) || (pItem->ItemId == IDM_MODULE_FW_UPGRADE))&& uItem_Locked){
|
// if(((pItem->ItemId == IDM_CAMERA_FW_UPGRADE) || (pItem->ItemId == IDM_MODULE_FW_UPGRADE)) && uItem_Locked){
|
||||||
|
if(((pItem->ItemId == IDM_CAMERA_FW_UPGRADE && is_camera_fw_upgrade() == NOT_UPGRADABLE) ||
|
||||||
|
(pItem->ItemId == IDM_MODULE_FW_UPGRADE && is_module_fw_upgrade() == NOT_UPGRADABLE))){
|
||||||
lv_plugin_menu_select_next_item(menu_item);
|
lv_plugin_menu_select_next_item(menu_item);
|
||||||
uSel_Jump = true;
|
uSel_Jump = true;
|
||||||
goto Onetime;
|
goto Onetime;
|
||||||
|
@ -661,11 +667,17 @@ static void LV_MenuCommonItem_UpdateContent(TM_MENU *pMenu)
|
||||||
lv_plugin_menu_set_item_hidden(menu_item, i, false);
|
lv_plugin_menu_set_item_hidden(menu_item, i, false);
|
||||||
//#NT#2023/11/21#Eric - begin
|
//#NT#2023/11/21#Eric - begin
|
||||||
//#NT#Support IVOT_N12144_CO-148_1120_5
|
//#NT#Support IVOT_N12144_CO-148_1120_5
|
||||||
BOOL uItem_Locked = true; // TODO:
|
// BOOL uItem_Locked = true; // TODO:
|
||||||
if(((pItem->ItemId == IDM_CAMERA_FW_UPGRADE) || (pItem->ItemId == IDM_MODULE_FW_UPGRADE))&& uItem_Locked){
|
// if(((pItem->ItemId == IDM_CAMERA_FW_UPGRADE) || (pItem->ItemId == IDM_MODULE_FW_UPGRADE))&& uItem_Locked){
|
||||||
|
if((pItem->ItemId == IDM_CAMERA_FW_UPGRADE) && is_camera_fw_upgrade() == NOT_UPGRADABLE){
|
||||||
lv_plugin_menu_set_item_state(menu_item, i, LV_PLUGIN_MENU_ITEM_STATE_DISABLED);
|
lv_plugin_menu_set_item_state(menu_item, i, LV_PLUGIN_MENU_ITEM_STATE_DISABLED);
|
||||||
lv_plugin_menu_set_item_img_id(menu_item, i, LV_PLUGIN_MENU_ITEM_VISIBLE_STATE_NUM, LV_PLUGIN_IMG_ID_SF_CAMERA_NETWORK_SELECTION);
|
lv_plugin_menu_set_item_img_id(menu_item, i, LV_PLUGIN_MENU_ITEM_VISIBLE_STATE_NUM, LV_PLUGIN_IMG_ID_SF_CAMERA_NETWORK_SELECTION);
|
||||||
} else {
|
} else if (pItem->ItemId == IDM_MODULE_FW_UPGRADE && is_module_fw_upgrade() == NOT_UPGRADABLE)
|
||||||
|
{
|
||||||
|
lv_plugin_menu_set_item_state(menu_item, i, LV_PLUGIN_MENU_ITEM_STATE_DISABLED);
|
||||||
|
lv_plugin_menu_set_item_img_id(menu_item, i, LV_PLUGIN_MENU_ITEM_VISIBLE_STATE_NUM, LV_PLUGIN_IMG_ID_SF_CAMERA_NETWORK_SELECTION);
|
||||||
|
}
|
||||||
|
else {
|
||||||
lv_plugin_menu_set_item_img_id(menu_item, i, LV_PLUGIN_MENU_ITEM_VISIBLE_STATE_NUM, pItem->IconId);
|
lv_plugin_menu_set_item_img_id(menu_item, i, LV_PLUGIN_MENU_ITEM_VISIBLE_STATE_NUM, pItem->IconId);
|
||||||
}
|
}
|
||||||
//#NT#2023/11/21#Eric - end
|
//#NT#2023/11/21#Eric - end
|
||||||
|
@ -721,7 +733,11 @@ static void LV_MenuCommonItem_UpdateContent(TM_MENU *pMenu)
|
||||||
if(((pPage->SelItem%PER_PAGE_NUM) == 2)&&(pMenu->Status == TMS_ON_ITEM)){
|
if(((pPage->SelItem%PER_PAGE_NUM) == 2)&&(pMenu->Status == TMS_ON_ITEM)){
|
||||||
lv_plugin_img_set_src(image_option_3_scr_uiflowmenucommonitem, LV_PLUGIN_IMG_ID_SF_NEXT2);
|
lv_plugin_img_set_src(image_option_3_scr_uiflowmenucommonitem, LV_PLUGIN_IMG_ID_SF_NEXT2);
|
||||||
}else{
|
}else{
|
||||||
lv_plugin_img_set_src(image_option_3_scr_uiflowmenucommonitem, LV_PLUGIN_IMG_ID_SF_NEXT1);
|
if((pItem->ItemId == IDM_CAMERA_FW_UPGRADE) && is_camera_fw_upgrade() == NOT_UPGRADABLE){
|
||||||
|
lv_plugin_img_set_src(image_option_3_scr_uiflowmenucommonitem, LV_PLUGIN_IMG_ID_SF_NEXT2);
|
||||||
|
} else {
|
||||||
|
lv_plugin_img_set_src(image_option_3_scr_uiflowmenucommonitem, LV_PLUGIN_IMG_ID_SF_NEXT1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//#NT#2023/11/03#Eric - end
|
//#NT#2023/11/03#Eric - end
|
||||||
lv_plugin_label_set_text(label_option_3_scr_uiflowmenucommonitem, pOption->TextId);
|
lv_plugin_label_set_text(label_option_3_scr_uiflowmenucommonitem, pOption->TextId);
|
||||||
|
@ -734,7 +750,11 @@ static void LV_MenuCommonItem_UpdateContent(TM_MENU *pMenu)
|
||||||
if(((pPage->SelItem%PER_PAGE_NUM) == 3)&&(pMenu->Status == TMS_ON_ITEM)){
|
if(((pPage->SelItem%PER_PAGE_NUM) == 3)&&(pMenu->Status == TMS_ON_ITEM)){
|
||||||
lv_plugin_img_set_src(image_option_4_scr_uiflowmenucommonitem, LV_PLUGIN_IMG_ID_SF_NEXT2);
|
lv_plugin_img_set_src(image_option_4_scr_uiflowmenucommonitem, LV_PLUGIN_IMG_ID_SF_NEXT2);
|
||||||
}else{
|
}else{
|
||||||
lv_plugin_img_set_src(image_option_4_scr_uiflowmenucommonitem, LV_PLUGIN_IMG_ID_SF_NEXT1);
|
if(pItem->ItemId == IDM_MODULE_FW_UPGRADE && is_module_fw_upgrade() == NOT_UPGRADABLE){
|
||||||
|
lv_plugin_img_set_src(image_option_4_scr_uiflowmenucommonitem, LV_PLUGIN_IMG_ID_SF_NEXT2);
|
||||||
|
} else {
|
||||||
|
lv_plugin_img_set_src(image_option_4_scr_uiflowmenucommonitem, LV_PLUGIN_IMG_ID_SF_NEXT1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//#NT#2023/11/03#Eric - end
|
//#NT#2023/11/03#Eric - end
|
||||||
lv_plugin_label_set_text(label_option_4_scr_uiflowmenucommonitem, pOption->TextId);
|
lv_plugin_label_set_text(label_option_4_scr_uiflowmenucommonitem, pOption->TextId);
|
||||||
|
|
|
@ -1233,28 +1233,42 @@ static void play_video(lv_obj_t *obj)
|
||||||
if(PLB_ST_PLAY_MOV == g_PlbData.State)
|
if(PLB_ST_PLAY_MOV == g_PlbData.State)
|
||||||
{
|
{
|
||||||
printf("now stop play the video.\n");
|
printf("now stop play the video.\n");
|
||||||
g_PlbData.State = PLB_ST_FULL;
|
// g_PlbData.State = PLB_ST_FULL;
|
||||||
|
// lv_plugin_img_set_src(image_play_scr_uiflowplay, LV_PLUGIN_IMG_ID_SF_STOP);
|
||||||
|
// lv_label_set_text_fmt(label_playtime_scr_uiflowplay, "%02d:%02d", 0, 0);
|
||||||
|
// g_PlbData.VideoPBSpeed = PLB_FWD_MOV_1x;
|
||||||
|
|
||||||
|
// // Close MoviePlay module.
|
||||||
|
// Ux_SendEvent(0, NVTEVT_EXE_CLOSEPLAY, 0);
|
||||||
|
// Ux_SetActiveApp(&CustomPlayObjCtrl);
|
||||||
|
|
||||||
|
// // Wakeup playback task and ImageApp_Play module.
|
||||||
|
// Ux_SendEvent(0, NVTEVT_EXE_OPEN, 0);
|
||||||
|
// KeyScan_EnableMisc(TRUE);
|
||||||
|
// if (gphUIFlowMovPlay_Filehdl)
|
||||||
|
// {
|
||||||
|
// FileSys_CloseFile(gphUIFlowMovPlay_Filehdl);
|
||||||
|
// gphUIFlowMovPlay_Filehdl = NULL;
|
||||||
|
// }
|
||||||
|
// PBView_DrawErrorView();
|
||||||
|
|
||||||
|
// // Play 1st video frame image
|
||||||
|
// UIPlay_PlaySingle(PB_SINGLE_CURR);
|
||||||
|
// update_playicons(g_PlbData.State);
|
||||||
|
// return;
|
||||||
lv_plugin_img_set_src(image_play_scr_uiflowplay, LV_PLUGIN_IMG_ID_SF_STOP);
|
lv_plugin_img_set_src(image_play_scr_uiflowplay, LV_PLUGIN_IMG_ID_SF_STOP);
|
||||||
lv_label_set_text_fmt(label_playtime_scr_uiflowplay, "%02d:%02d", 0, 0);
|
Ux_SendEvent(0, NVTEVT_EXE_PAUSEPLAY, 0);
|
||||||
g_PlbData.VideoPBSpeed = PLB_FWD_MOV_1x;
|
g_PlbData.State = PLB_ST_PAUSE_MOV;
|
||||||
|
|
||||||
// Close MoviePlay module.
|
|
||||||
Ux_SendEvent(0, NVTEVT_EXE_CLOSEPLAY, 0);
|
|
||||||
Ux_SetActiveApp(&CustomPlayObjCtrl);
|
|
||||||
|
|
||||||
// Wakeup playback task and ImageApp_Play module.
|
|
||||||
Ux_SendEvent(0, NVTEVT_EXE_OPEN, 0);
|
|
||||||
KeyScan_EnableMisc(TRUE);
|
KeyScan_EnableMisc(TRUE);
|
||||||
if (gphUIFlowMovPlay_Filehdl)
|
return;
|
||||||
{
|
}
|
||||||
FileSys_CloseFile(gphUIFlowMovPlay_Filehdl);
|
if(PLB_ST_PAUSE_MOV == g_PlbData.State)
|
||||||
gphUIFlowMovPlay_Filehdl = NULL;
|
{
|
||||||
}
|
lv_plugin_img_set_src(image_play_scr_uiflowplay, LV_PLUGIN_IMG_ID_SF_PLAY);
|
||||||
PBView_DrawErrorView();
|
KeyScan_EnableMisc(TRUE);
|
||||||
|
Ux_SendEvent(&CustomMoviePlayObjCtrl, NVTEVT_EXE_MOVIEAUDPLAYVOLUME, 2, UI_GetData(FL_MovieAudioPlayIndex), 1);
|
||||||
// Play 1st video frame image
|
Ux_SendEvent(0, NVTEVT_EXE_RESUMEPLAY, 0);
|
||||||
UIPlay_PlaySingle(PB_SINGLE_CURR);
|
g_PlbData.State = PLB_ST_PLAY_MOV;
|
||||||
update_playicons(g_PlbData.State);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1462,36 +1476,40 @@ static void UIFlowPlay_OnKeySelect(lv_obj_t* obj)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
static void stop_play(void)
|
||||||
|
{
|
||||||
|
if(PLB_ST_PLAY_MOV == g_PlbData.State || PLB_ST_PAUSE_MOV == g_PlbData.State)
|
||||||
|
{
|
||||||
|
printf("now stop play the video.\n");
|
||||||
|
g_PlbData.State = PLB_ST_FULL;
|
||||||
|
lv_plugin_img_set_src(image_play_scr_uiflowplay, LV_PLUGIN_IMG_ID_SF_STOP);
|
||||||
|
lv_label_set_text_fmt(label_playtime_scr_uiflowplay, "%02d:%02d", 0, 0);
|
||||||
|
g_PlbData.VideoPBSpeed = PLB_FWD_MOV_1x;
|
||||||
|
|
||||||
|
// Close MoviePlay module.
|
||||||
|
Ux_SendEvent(0, NVTEVT_EXE_CLOSEPLAY, 0);
|
||||||
|
Ux_SetActiveApp(&CustomPlayObjCtrl);
|
||||||
|
|
||||||
|
// Wakeup playback task and ImageApp_Play module.
|
||||||
|
Ux_SendEvent(0, NVTEVT_EXE_OPEN, 0);
|
||||||
|
KeyScan_EnableMisc(TRUE);
|
||||||
|
if (gphUIFlowMovPlay_Filehdl)
|
||||||
|
{
|
||||||
|
FileSys_CloseFile(gphUIFlowMovPlay_Filehdl);
|
||||||
|
gphUIFlowMovPlay_Filehdl = NULL;
|
||||||
|
}
|
||||||
|
PBView_DrawErrorView();
|
||||||
|
|
||||||
|
// Play 1st video frame image
|
||||||
|
UIPlay_PlaySingle(PB_SINGLE_CURR);
|
||||||
|
update_playicons(g_PlbData.State);
|
||||||
|
// return;
|
||||||
|
}
|
||||||
|
}
|
||||||
static void UIFlowPlay_Exit(lv_obj_t* obj)
|
static void UIFlowPlay_Exit(lv_obj_t* obj)
|
||||||
{
|
{
|
||||||
// Ux_SendEvent(&UISetupObjCtrl, NVTEVT_PREVIEWMODE, 0);
|
// Ux_SendEvent(&UISetupObjCtrl, NVTEVT_PREVIEWMODE, 0);
|
||||||
if(PLB_ST_PLAY_MOV == g_PlbData.State)
|
stop_play();
|
||||||
{
|
|
||||||
printf("now stop play the video.\n");
|
|
||||||
g_PlbData.State = PLB_ST_FULL;
|
|
||||||
lv_plugin_img_set_src(image_play_scr_uiflowplay, LV_PLUGIN_IMG_ID_SF_STOP);
|
|
||||||
lv_label_set_text_fmt(label_playtime_scr_uiflowplay, "%02d:%02d", 0, 0);
|
|
||||||
g_PlbData.VideoPBSpeed = PLB_FWD_MOV_1x;
|
|
||||||
|
|
||||||
// Close MoviePlay module.
|
|
||||||
Ux_SendEvent(0, NVTEVT_EXE_CLOSEPLAY, 0);
|
|
||||||
Ux_SetActiveApp(&CustomPlayObjCtrl);
|
|
||||||
|
|
||||||
// Wakeup playback task and ImageApp_Play module.
|
|
||||||
Ux_SendEvent(0, NVTEVT_EXE_OPEN, 0);
|
|
||||||
KeyScan_EnableMisc(TRUE);
|
|
||||||
if (gphUIFlowMovPlay_Filehdl)
|
|
||||||
{
|
|
||||||
FileSys_CloseFile(gphUIFlowMovPlay_Filehdl);
|
|
||||||
gphUIFlowMovPlay_Filehdl = NULL;
|
|
||||||
}
|
|
||||||
PBView_DrawErrorView();
|
|
||||||
|
|
||||||
// Play 1st video frame image
|
|
||||||
UIPlay_PlaySingle(PB_SINGLE_CURR);
|
|
||||||
update_playicons(g_PlbData.State);
|
|
||||||
// return;
|
|
||||||
}
|
|
||||||
UINT32 uiChangeTo;
|
UINT32 uiChangeTo;
|
||||||
uiChangeTo = System_GetBootFirstMode();
|
uiChangeTo = System_GetBootFirstMode();
|
||||||
UINT32 uiCurrMode;
|
UINT32 uiCurrMode;
|
||||||
|
@ -1968,11 +1986,13 @@ static void UIFlowPlay_Key(lv_obj_t* obj, uint32_t key)
|
||||||
}
|
}
|
||||||
case LV_USER_KEY_LEFT:
|
case LV_USER_KEY_LEFT:
|
||||||
{
|
{
|
||||||
|
stop_play();
|
||||||
UIFlowPlay_OnKeyUp(obj);
|
UIFlowPlay_OnKeyUp(obj);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case LV_USER_KEY_RIGHT:
|
case LV_USER_KEY_RIGHT:
|
||||||
{
|
{
|
||||||
|
stop_play();
|
||||||
UIFlowPlay_OnKeyDown(obj);
|
UIFlowPlay_OnKeyDown(obj);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1987,6 +2007,7 @@ static void UIFlowPlay_Key(lv_obj_t* obj, uint32_t key)
|
||||||
case LV_USER_KEY_DOWN:
|
case LV_USER_KEY_DOWN:
|
||||||
case LV_USER_KEY_NEXT:
|
case LV_USER_KEY_NEXT:
|
||||||
{
|
{
|
||||||
|
stop_play();
|
||||||
UIFlowMenuCommonConfirmAPI_Open(IDM_DELETE_THIS);
|
UIFlowMenuCommonConfirmAPI_Open(IDM_DELETE_THIS);
|
||||||
break;
|
break;
|
||||||
UIFlowPlay_OnKeyNext(obj);
|
UIFlowPlay_OnKeyNext(obj);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user