INT32 UIFlowWndPlay_OnOpen(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray) { UINT32 uiSoundMask,uiStatus; g_bUIFlowWndPlayNoImgWndOpened = FALSE; Ux_SendEvent(&UIPlayObjCtrl,NVTEVT_PLAYINIT,0); //After playback ready, point to the last file // PB_OpenSpecFileBySeq(DCF_GetDBInfo(DCF_INFO_TOL_FILE_COUNT), TRUE); PB_OpenSpecFileBySeq(AppPlay_GetData(PLAY_FILENUM), TRUE); Ux_SendEvent(&UIPlayObjCtrl,NVTEVT_PLAYSINGLE, 2, PB_SINGLE_CURR, 1); uiStatus = AppPlay_GetData(PLAY_PBSTATUS); if (uiStatus & PB_STA_NOIMAGE) //if(DCF_GetDBInfo(DCF_INFO_TOL_FILE_COUNT)==0) { Ux_OpenWindow(&UIFlowWndWrnMsgCtrl,2,FLOWWRNMSG_ISSUE_NO_IMAGE,FLOWWRNMSG_TIMER_KEEP); g_bUIFlowWndPlayNoImgWndOpened = TRUE; } else { g_PlbData.VideoPBSpeed=PLB_FWD_MOV_1x; g_PlbData.State = PLB_ST_FULL; UIFlowWndPlay_CheckStatus(); FlowPB_UpdateIcons(1); } // enable shutter2 sound uiSoundMask = Input_GetKeySoundMask(KEY_PRESS); uiSoundMask |= FLGKEY_SHUTTER2; Input_SetKeySoundMask(KEY_PRESS, uiSoundMask); // Set mask key Ux_FlushEventByRange(NVTEVT_KEY_EVT_START,NVTEVT_KEY_EVT_END); Input_SetKeyMask(KEY_PRESS, PLAY_KEY_PRESS_MASK); Input_SetKeyMask(KEY_RELEASE, PLAY_KEY_RELEASE_MASK); Input_SetKeyMask(KEY_CONTINUE, PLAY_KEY_CONTINUE_MASK); Ux_DefaultEvent(pCtrl,NVTEVT_OPEN_WINDOW,paramNum,paramArray); return NVTEVT_CONSUME; }
INT32 UIFlowWndPlay_OnChildClose(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray) { UINT32 uiStatus; //#NT#2012/12/27#Hideo Lin -begin //#NT#Fix close child window hang up as card removed if(Ux_IsForceCloseWindow()) { return NVTEVT_CONSUME; } //#NT#2012/12/27#Hideo Lin -end if(paramNum > 0) { //Return from thumbnail, magnify or delete mode and play current image again. switch(paramArray[0]) { case NVTRET_THUMBNAIL: case NVTRET_MAGNIFY: Ux_SendEvent(&UIPlayObjCtrl,NVTEVT_PLAYSINGLE, 2, PB_SINGLE_CURR, 1); FlowPB_UpdateIcons(1); UIFlowWndPlay_CheckStatus(); break; case NVTRET_DELETE: case NVTRET_DELETEALL: uiStatus = AppPlay_GetData(PLAY_PBSTATUS); if (uiStatus & PB_STA_NOIMAGE) //if(DCF_GetDBInfo(DCF_INFO_TOL_FILE_COUNT)==0) { if(!g_bUIFlowWndPlayNoImgWndOpened) { Ux_OpenWindow(&UIFlowWndWrnMsgCtrl,2,FLOWWRNMSG_ISSUE_NO_IMAGE,FLOWWRNMSG_TIMER_KEEP); g_bUIFlowWndPlayNoImgWndOpened = TRUE; } } else { Ux_SendEvent(&UIPlayObjCtrl,NVTEVT_PLAYSINGLE, 2, PB_SINGLE_CURR, 1); FlowPB_UpdateIcons(1); UIFlowWndPlay_CheckStatus(); } break; case NVTRET_ENTER_MENU: // Reset specific menu items SysSetFlag(FL_PROTECT, PROTECT_ONE); // Set Tab menu to Playback menu TM_SetMenu(&gPlaybackMenu); // Open common item menu Ux_OpenWindow(&MenuCommonItemCtrl, 0); g_bUIFlowWndPlayNoImgWndOpened = FALSE; break; case NVTRET_WARNING: Ux_PostEvent(paramArray[1], 0); break; } } else { uiStatus = AppPlay_GetData(PLAY_PBSTATUS); if (uiStatus & PB_STA_NOIMAGE) //if(DCF_GetDBInfo(DCF_INFO_TOL_FILE_COUNT)==0) { if(!g_bUIFlowWndPlayNoImgWndOpened) { Ux_OpenWindow(&UIFlowWndWrnMsgCtrl,2,FLOWWRNMSG_ISSUE_NO_IMAGE,FLOWWRNMSG_TIMER_KEEP); g_bUIFlowWndPlayNoImgWndOpened = TRUE; } } else { Ux_SendEvent(&UIPlayObjCtrl,NVTEVT_PLAYSINGLE, 2, PB_SINGLE_CURR, 1); FlowPB_UpdateIcons(1); UIFlowWndPlay_CheckStatus(); } } g_PlbData.State = PLB_ST_FULL; //#NT#2012/10/23#Philex Lin - begin // enable auto power off/USB detect timer // enable sound key tone flag KeyScan_EnableMisc(TRUE); //#NT#2012/10/23#Philex Lin - end // set mask key //Ux_FlushEvent(); Input_SetKeyMask(KEY_PRESS, PLAY_KEY_PRESS_MASK); Input_SetKeyMask(KEY_RELEASE, PLAY_KEY_RELEASE_MASK); Input_SetKeyMask(KEY_CONTINUE, PLAY_KEY_CONTINUE_MASK); Ux_DefaultEvent(pCtrl,NVTEVT_CHILD_CLOSE,paramNum,paramArray); return NVTEVT_CONSUME; }
INT32 UIFlowWndPlay_OnKeyRight(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray) { switch(g_PlbData.State) { case PLB_ST_FULL: Input_SetKeyMask(KEY_PRESS, FLGKEY_KEY_MASK_NULL); Ux_SendEvent(&UIPlayObjCtrl,NVTEVT_PLAYSINGLE, 2, PB_SINGLE_NEXT, 1); FlowPB_UpdateIcons(1); UIFlowWndPlay_CheckStatus(); Input_SetKeyMask(KEY_PRESS, FLGKEY_KEY_MASK_DEFAULT); break; case PLB_ST_PLAY_MOV: case PLB_ST_FWD_MOV: case PLB_ST_BWD_MOV: #if(_MODEL_DSC_== _MODEL_DUAL_NAZHIDA_) //#NT#2012/08/31#Calvin Chang#Porting Media Flow -begin if(g_PlbData.VideoPBSpeed > PLB_BWD_MOV_8x) { g_PlbData.VideoPBSpeed --; Ux_FlushEventByRange(NVTEVT_KEY_EVT_START,NVTEVT_KEY_EVT_END); Input_SetKeyMask(KEY_PRESS, FLGKEY_KEY_MASK_NULL); if(g_PlbData.VideoPBSpeed > PLB_FWD_MOV_1x) { g_PlbData.State = PLB_ST_FWD_MOV; UIFlowMoviePlay_SetSpeed(g_PlbData.VideoPBSpeed); g_uiUIFlowWndPlayCurrenDirection = MEDIAPLAY_DIR_FORWARD; // Play Ux_SendEvent(&UIMoviePlayObjCtrl, NVTEVT_PLAY_PLAY_MOVIE, 2, g_uiUIFlowWndPlayCurrenSpeed, g_uiUIFlowWndPlayCurrenDirection); } else if(g_PlbData.VideoPBSpeed < PLB_FWD_MOV_1x) { g_PlbData.State = PLB_ST_BWD_MOV; UIFlowMoviePlay_SetSpeed(g_PlbData.VideoPBSpeed); g_uiUIFlowWndPlayCurrenDirection = MEDIAPLAY_DIR_BACKWARD; // Play Ux_SendEvent(&UIMoviePlayObjCtrl, NVTEVT_PLAY_PLAY_MOVIE, 2, g_uiUIFlowWndPlayCurrenSpeed, g_uiUIFlowWndPlayCurrenDirection); } else //uiCurrSpeedIndex == PLAYMOV_SPEED_FWD_1X { g_PlbData.State = PLB_ST_PLAY_MOV; UIFlowMoviePlay_SetSpeed(g_PlbData.VideoPBSpeed); g_uiUIFlowWndPlayCurrenDirection = MEDIAPLAY_DIR_FORWARD; // Play Ux_SendEvent(&UIMoviePlayObjCtrl, NVTEVT_PLAY_PLAY_MOVIE, 2, g_uiUIFlowWndPlayCurrenSpeed, g_uiUIFlowWndPlayCurrenDirection); } FlowPB_IconDrawMovSpeed(); Input_SetKeyMask(KEY_PRESS, FLGKEY_KEY_MASK_DEFAULT); } break; #else //#NT#2012/08/31#Calvin Chang#Porting Media Flow -begin if(g_PlbData.VideoPBSpeed < PLB_FWD_MOV_8x) { g_PlbData.VideoPBSpeed ++; Ux_FlushEventByRange(NVTEVT_KEY_EVT_START,NVTEVT_KEY_EVT_END); Input_SetKeyMask(KEY_PRESS, FLGKEY_KEY_MASK_NULL); if(g_PlbData.VideoPBSpeed > PLB_FWD_MOV_1x) { g_PlbData.State = PLB_ST_FWD_MOV; UIFlowMoviePlay_SetSpeed(g_PlbData.VideoPBSpeed); g_uiUIFlowWndPlayCurrenDirection = MEDIAPLAY_DIR_FORWARD; // Play Ux_SendEvent(&UIMoviePlayObjCtrl, NVTEVT_PLAY_PLAY_MOVIE, 2, g_uiUIFlowWndPlayCurrenSpeed, g_uiUIFlowWndPlayCurrenDirection); } else if(g_PlbData.VideoPBSpeed < PLB_FWD_MOV_1x) { g_PlbData.State = PLB_ST_BWD_MOV; UIFlowMoviePlay_SetSpeed(g_PlbData.VideoPBSpeed); g_uiUIFlowWndPlayCurrenDirection = MEDIAPLAY_DIR_BACKWARD; // Play Ux_SendEvent(&UIMoviePlayObjCtrl, NVTEVT_PLAY_PLAY_MOVIE, 2, g_uiUIFlowWndPlayCurrenSpeed, g_uiUIFlowWndPlayCurrenDirection); } else //uiCurrSpeedIndex == PLAYMOV_SPEED_FWD_1X { g_PlbData.State = PLB_ST_PLAY_MOV; UIFlowMoviePlay_SetSpeed(g_PlbData.VideoPBSpeed); g_uiUIFlowWndPlayCurrenDirection = MEDIAPLAY_DIR_FORWARD; // Play Ux_SendEvent(&UIMoviePlayObjCtrl, NVTEVT_PLAY_PLAY_MOVIE, 2, g_uiUIFlowWndPlayCurrenSpeed, g_uiUIFlowWndPlayCurrenDirection); } FlowPB_IconDrawMovSpeed(); Input_SetKeyMask(KEY_PRESS, FLGKEY_KEY_MASK_DEFAULT); } break; //#NT#2012/08/31#Calvin Chang -end #endif //#NT#2012/7/6#Philex mark temp #if 0 if (KeyScan_IsHDMIPlugIn()==FALSE) { if(g_PlbData.VideoPBSpeed < PLB_FWD_MOV_8x) { g_PlbData.VideoPBSpeed ++; Ux_FlushEvent(); KeyScan_SetKeyMask(KEYSCAN_KEYMODE_PRESS, FLGKEY_KEY_MASK_NULL); if(g_PlbData.VideoPBSpeed > PLB_FWD_MOV_1x) { Ux_SendEvent(&UIPlayObjCtrl,NVTEVT_MOVFWD,1,g_PlbData.VideoPBSpeed); g_PlbData.State = PLB_ST_FWD_MOV; // set mute in FWD playing hdmitx_setAudMute(TRUE); } else if(g_PlbData.VideoPBSpeed < PLB_FWD_MOV_1x) { Ux_SendEvent(&UIPlayObjCtrl,NVTEVT_MOVBWD,1,g_PlbData.VideoPBSpeed); g_PlbData.State = PLB_ST_BWD_MOV; // set mute in BWD playing hdmitx_setAudMute(TRUE); } else //uiCurrSpeedIndex == PLAYMOV_SPEED_FWD_1X { Ux_SendEvent(&UIPlayObjCtrl,NVTEVT_MOVFWDSTOP,0); g_PlbData.State = PLB_ST_PLAY_MOV; /* Since Media FWD/BWD will set volume mute, we should restore current volume. */ hdmitx_setAudMute(FALSE); Ux_SendEvent(&UIPlayObjCtrl,NVTEVT_AUD_VOLUME,1,g_uiUIFlowWndPlayCurrentVolume); } FlowPB_IconDrawMovSpeed(); KeyScan_SetKeyMask(KEYSCAN_KEYMODE_PRESS, FLGKEY_KEY_MASK_DEFAULT); } } break; #endif } return NVTEVT_CONSUME; }
INT32 UIFlowWndPlay_OnKeyLeft(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray) { switch(g_PlbData.State) { case PLB_ST_FULL: Input_SetKeyMask(KEY_PRESS, FLGKEY_KEY_MASK_NULL); Ux_SendEvent(&UIPlayObjCtrl,NVTEVT_PLAYSINGLE, 2, PB_SINGLE_PREV, 1); FlowPB_UpdateIcons(1); UIFlowWndPlay_CheckStatus(); Input_SetKeyMask(KEY_PRESS, FLGKEY_KEY_MASK_DEFAULT); break; case PLB_ST_PLAY_MOV: case PLB_ST_FWD_MOV: case PLB_ST_BWD_MOV: //#NT#2012/08/31#Calvin Chang#Porting Media Flow -begin //if(g_PlbData.VideoPBSpeed > PLB_BWD_MOV_8x) if(g_PlbData.VideoPBSpeed > PLB_BWD_MOV_4x) { g_PlbData.VideoPBSpeed --; Ux_FlushEventByRange(NVTEVT_KEY_EVT_START,NVTEVT_KEY_EVT_END); Input_SetKeyMask(KEY_PRESS, FLGKEY_KEY_MASK_NULL); if(g_PlbData.VideoPBSpeed > PLB_FWD_MOV_1x) { g_PlbData.State = PLB_ST_FWD_MOV; UIFlowMoviePlay_SetSpeed(g_PlbData.VideoPBSpeed); g_uiUIFlowWndPlayCurrenDirection = MEDIAPLAY_DIR_FORWARD; UxState_SetData(&UIFlowWndPlay_StatusICN_MovFwdCtrl,STATE_CURITEM,UIFlowWndPlay_StatusICN_MovFwd_ICON_FF_RIGHT_BLUE); UxCtrl_SetShow(&UIFlowWndPlay_StatusICN_MovFwdCtrl, TRUE); // Play Ux_SendEvent(&UIMoviePlayObjCtrl, NVTEVT_PLAY_PLAY_MOVIE, 2, g_uiUIFlowWndPlayCurrenSpeed, g_uiUIFlowWndPlayCurrenDirection); } else if(g_PlbData.VideoPBSpeed < PLB_FWD_MOV_1x) { g_PlbData.State = PLB_ST_BWD_MOV; UIFlowMoviePlay_SetSpeed(g_PlbData.VideoPBSpeed); g_uiUIFlowWndPlayCurrenDirection = MEDIAPLAY_DIR_BACKWARD; UxState_SetData(&UIFlowWndPlay_StatusICN_MovBwdCtrl,STATE_CURITEM,UIFlowWndPlay_StatusICN_MovBwd_ICON_FB_LEFT_BLUE); UxCtrl_SetShow(&UIFlowWndPlay_StatusICN_MovBwdCtrl, TRUE); // Play Ux_SendEvent(&UIMoviePlayObjCtrl, NVTEVT_PLAY_PLAY_MOVIE, 2, g_uiUIFlowWndPlayCurrenSpeed, g_uiUIFlowWndPlayCurrenDirection); } else //uiCurrSpeedIndex == PLAYMOV_SPEED_FWD_1X { g_PlbData.State = PLB_ST_PLAY_MOV; UIFlowMoviePlay_SetSpeed(g_PlbData.VideoPBSpeed); g_uiUIFlowWndPlayCurrenDirection = MEDIAPLAY_DIR_FORWARD; UxState_SetData(&UIFlowWndPlay_StatusICN_MovBwdCtrl,STATE_CURITEM,UIFlowWndPlay_StatusICN_MovBwd_ICON_FB_LEFT); UxCtrl_SetShow(&UIFlowWndPlay_StatusICN_MovBwdCtrl, TRUE); UxState_SetData(&UIFlowWndPlay_StatusICN_MovFwdCtrl,STATE_CURITEM,UIFlowWndPlay_StatusICN_MovFwd_ICON_FF_RIGHT); UxCtrl_SetShow(&UIFlowWndPlay_StatusICN_MovFwdCtrl, TRUE); // Play Ux_SendEvent(&UIMoviePlayObjCtrl, NVTEVT_PLAY_PLAY_MOVIE, 2, g_uiUIFlowWndPlayCurrenSpeed, g_uiUIFlowWndPlayCurrenDirection); } FlowPB_IconDrawMovSpeed(); Input_SetKeyMask(KEY_PRESS, FLGKEY_KEY_MASK_DEFAULT); } //#NT#2012/08/31#Calvin Chang -end #if 0 if (KeyScan_IsHDMIPlugIn()==FALSE) { if(g_PlbData.VideoPBSpeed < PLB_FWD_MOV_8x) { g_PlbData.VideoPBSpeed ++; Ux_FlushEvent(); Input_SetKeyMask(KEY_PRESS, FLGKEY_KEY_MASK_NULL); if(g_PlbData.VideoPBSpeed > PLB_FWD_MOV_1x) { Ux_SendEvent(&UIPlayObjCtrl,NVTEVT_MOVFWD,1,g_PlbData.VideoPBSpeed); g_PlbData.State = PLB_ST_FWD_MOV; // set mute in FWD playing hdmitx_setAudMute(TRUE); } else if(g_PlbData.VideoPBSpeed < PLB_FWD_MOV_1x) { Ux_SendEvent(&UIPlayObjCtrl,NVTEVT_MOVBWD,1,g_PlbData.VideoPBSpeed); g_PlbData.State = PLB_ST_BWD_MOV; // set mute in BWD playing hdmitx_setAudMute(TRUE); } else //uiCurrSpeedIndex == PLAYMOV_SPEED_FWD_1X { Ux_SendEvent(&UIPlayObjCtrl,NVTEVT_MOVFWDSTOP,0); g_PlbData.State = PLB_ST_PLAY_MOV; /* Since Media FWD/BWD will set volume mute, we should restore current volume. */ hdmitx_setAudMute(FALSE); Ux_SendEvent(&UIPlayObjCtrl,NVTEVT_AUD_VOLUME,1,g_uiUIFlowWndPlayCurrentVolume); } FlowPB_IconDrawMovSpeed(); Input_SetKeyMask(KEY_PRESS, FLGKEY_KEY_MASK_DEFAULT); } } #endif break; } return NVTEVT_CONSUME; }