Example #1
0
void UI_OpenWifiWnd(void)
{
    if(System_GetState(SYS_STATE_CURRSUBMODE)!=System_GetState(SYS_STATE_PREVSUBMODE))
    {
        Ux_OpenWindow(&UIMenuWndWiFiModuleLinkCtrl,0);
    }
}
Example #2
0
void UI_CloseWifiWnd(void)
{
    if(System_GetState(SYS_STATE_CURRSUBMODE)!=System_GetState(SYS_STATE_NEXTSUBMODE))
    {
        Ux_CloseWindow(&UIMenuWndWiFiModuleLinkCtrl,0);
    }
}
INT32 UIFlowWndWiFiMovie_OnExeSetMovieLiveviewBitRate(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
{
    char *Data = 0;
    UINT32 uiTargetBitRate;

    if(paramNum)
    {
        Data = (char *)paramArray[0];

        if (System_GetState(SYS_STATE_CURRMODE) != PRIMARY_MODE_MOVIE)
        {
            UIFlowWndWiFiMovieErrMsg("not movie mode\r\n");
            WifiCmd_UnlockString(Data);
            return NVTEVT_CONSUME;
        }

        if (1 == sscanf(Data, "%d", &uiTargetBitRate))
        {
            if (UIFlowWndWiFiMovie_GetStatus() != WIFI_MOV_ST_RECORD)
            {
                debug_msg("Preview target bit rate:%d KBytes\r\n", uiTargetBitRate);
                SetMovieTargetBitrate(0, UI_GetData(FL_WIFI_MOVIE_APP_PREVIEW_SIZE), uiTargetBitRate * 1024);
            }
        }
        WifiCmd_UnlockString(Data);
    }

    return NVTEVT_CONSUME;
}
Example #4
0
void UI_DetDelayPowerOff(void)
{
    if ((GxCustom_GetControl(GXCUSTOM_CTRL_DELAYOFF_TIME) != KEYSCAN_DELAYOFF_DISABLED)
        && (g_bKeyScanDelayoffEn == TRUE))
    {
        debug_msg("Auto DelayPwrOff Cnt = %d\r\n", g_uiKeyScanDelayoffCnt);
        g_uiKeyScanDelayoffCnt++;

        if (g_uiKeyScanDelayoffCnt >= 5)//GxCustom_GetControl(GXCUSTOM_CTRL_DELAYOFF_TIME))
        {
             DBG_IND("Do AutoDelayPwrOff!\r\n");
	        if (System_GetState(SYS_STATE_CURRMODE)==PRIMARY_MODE_MOVIE)
	        {
	        	switch(gMovData.State)	
	        	{
	        	     case MOV_ST_REC:
			     case MOV_ST_REC|MOV_ST_ZOOM:
				//MediaRec_Stop(MEDIAREC_WAIT_END);  	
                		FlowMovie_StopRec();				
			     break;
	        	}
	        }			 
		Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 1, 0);
            
        }
    }
}
Example #5
0
INT32 System_OnUsbRemove(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
{
    //usb unplug

    DBG_IND("USB unplug - begin\r\n");

    if(m_bVendorConnected==FALSE)
    {
        #if (UI_STYLE==UI_STYLE_DRIVER)
        if (System_GetState(SYS_STATE_CURRMODE)==PRIMARY_MODE_MOVIE)
        {
            if (m_bACPlug == TRUE)
            {
               m_bACPlug = FALSE;
               Ux_PostEvent(NVTEVT_AC_UnPlug, 0, 0);
            }
        }
        #endif
        FlowMode_OnUsbUnplug();
    }
    else
    {
        MsdcNvtCb_Close();
        m_bVendorConnected=FALSE;
    }
    USB_UpdateSource();
    Ux_PostEvent(NVTEVT_BATTERY, 0, 0);
    DBG_IND("USB unplug - end\r\n");
    return NVTEVT_CONSUME;
}
INT32 UIFlowWndWiFiMovie_OnExeSetMovieRecSize(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
{
    UINT32 Data;

    Data = paramNum ? paramArray[0] : 0;

    if (System_GetState(SYS_STATE_CURRMODE) != PRIMARY_MODE_MOVIE)
    {
        UIFlowWndWiFiMovieErrMsg("not movie mode\r\n");
        return NVTEVT_CONSUME;
    }

    if (UIFlowWndWiFiMovie_GetStatus() != WIFI_MOV_ST_RECORD)
    {
#if ((MOVIE_LIVEVIEW==HTTP_LIVEVIEW) ||(MOVIE_LIVEVIEW==DUAL_REC_HTTP_LIVEVIEW))
        PhotoExe_CloseHttpLiveView();
#endif
        Ux_SendEvent(&CustomMovieObjCtrl,NVTEVT_EXE_MOVIESIZE, 1, Data);
        UI_SetData(FL_MOVIE_SIZE, Data); // Update FL_MOVIE_SIZE meanwhile.
        Ux_SendEvent(&CustomMovieObjCtrl,NVTEVT_EXE_IMAGE_RATIO, 1, Data);
#if ((MOVIE_LIVEVIEW==HTTP_LIVEVIEW) ||(MOVIE_LIVEVIEW==DUAL_REC_HTTP_LIVEVIEW))
        PhotoExe_OpenHttpLiveView();
#endif
    }

    return NVTEVT_CONSUME;
}
INT32 UIMenuWndWiFiModeLink_Tab_RefreshAndWiFiOff_OnKeyEnter(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
{
    UINT32  uiKeyAct;

    uiKeyAct = paramArray[0];
    switch(uiKeyAct)
    {
    case NVTEVT_KEY_PRESS:
        switch(UxTab_GetData(&UIMenuWndWiFiModeLink_Tab_RefreshAndWiFiOffCtrl, TAB_FOCUS))
        {
        case UIMenuWndWiFiModeLink_Tab_RefreshAndWiFiOff_Button_Refresh:
            break;
        case UIMenuWndWiFiModeLink_Tab_RefreshAndWiFiOff_Button_WiFiOff:
            if(UI_GetData(FL_WIFI_LINK)==WIFI_LINK_OK)
            {   //change to normal mode for close app
                Ux_PostEvent(NVTEVT_SYSTEM_MODE, 2, System_GetState(SYS_STATE_CURRMODE),SYS_SUBMODE_NORMAL);
                //should close network application,then stop wifi
                Ux_PostEvent(NVTEVT_EXE_WIFI_STOP, 0);
            }
            else
            {
                Ux_CloseWindow(&UIMenuWndWiFiModuleLinkCtrl,0);
            }
            break;
        }
        break;
    }

    return NVTEVT_CONSUME;
}
void ModePlay_Close(void)
{
    //#NT#2010/11/29#Ben Wang -begin
    //#NT#Close root win by function instead of by win name because FlowPlayCtrl may not always be the root win.
#if (UI_STYLE!=UI_STYLE_DRIVER)
    VControl *p2ndWndCtrl = 0;
#endif

    //Ux_CloseWindowClear((VControl *)(&FlowPlayCtrl), 0);
    //Ux_CloseWindow((VControl *)(&FlowPlayCtrl), 0);
    if(System_GetState(SYS_STATE_CURRSUBMODE)==SYS_SUBMODE_WIFI)
    {
         UI_CloseWifiWnd();
    }
    else
    {

#if (UI_STYLE==UI_STYLE_DRIVER)
        Ux_CloseWindow((VControl *)(&UIFlowWndPlayCtrl), 0);
#else

        Ux_GetRootWindow(&p2ndWndCtrl);
        Ux_CloseWindow(p2ndWndCtrl,0);
#endif
    }
    //set default play by name
    //if(PRIMARY_MODE_PLAYBACK != System_GetState(SYS_STATE_NEXTMODE))
    //    UI_SetData(FL_PlayIKeyModeIndex, PLAY_BY_NAME);
    //#NT#2010/11/29#Ben Wang -end
    Ux_SendEvent(0, NVTEVT_EXE_CLOSE, 0);

}
// ShutDown Start
void GxSystem_ShutDownStart(void)
{
    //PowerOff_CB(POWEROFF_CB_START);
    DBG_IND("POWEROFF_CB_START\r\n");
#if(WIFI_AP_FUNC==ENABLE)
    if(System_GetState(SYS_STATE_CURRSUBMODE)==SYS_SUBMODE_WIFI)
        WifiApp_SendCmd(WIFIAPP_CMD_NOTIFY_STATUS, WIFIAPP_RET_POWER_OFF);
#endif

}
void ModePlay_Open(void)
{

    Input_ResetMask();

//#NT#2010/04/15#Jeah Yen -FASTBOOT- -begin
    // Control CCD/LCD power on/off, lens, shutter...
    //TM_Begin(DEVCTRL_CCD);
    DevCtrl_ModePlayback();
    //TM_End(DEVCTRL_CCD);

    // Init playback app and open
    Ux_SetActiveApp(&CustomPlayObjCtrl);
    //TM_Begin(APP_OPEN);
    Ux_SendEvent(0, NVTEVT_EXE_OPEN, 0);
    //TM_End(APP_OPEN);

    //TM_Begin(UI_OPENWIN);
    //#NT#2009/12/29#Lincy Lin -begin
    UI_SetData(FL_ModeIndex, UI_GetData(FL_NextMode));
    //#NT#2009/12/29#Lincy Lin -end
    //#NT#2010/12/14#Ben Wang -begin
    //#NT#add i key playback mode
    #if (_IKEY_DATEVIEW_MODE_== ENABLE)
    //#NT#2011/01/11#Ben Wang -begin
    //add parameter to specify opening flow
    if(UI_GetData(FL_PlayIKeyModeIndex) == PLAY_BY_DATE)
        Ux_OpenWindow((VControl *)(&FlowPlayDateCtrl), 1, TRUE);
    //#NT#2011/01/11#Ben Wang -end
    else
    #endif
    if(System_GetState(SYS_STATE_CURRSUBMODE)==SYS_SUBMODE_WIFI)
    {
        UI_OpenWifiWnd();
    }
    else
    {
#if (UI_STYLE==UI_STYLE_DRIVER)
        Ux_OpenWindow((VControl *)(&UIFlowWndPlayCtrl), 0);
#else
        Ux_OpenWindow((VControl *)(&FlowPlayCtrl), 0);
#endif
    }
    //#NT#2010/12/14#Ben Wang -end
    //TM_End(UI_OPENWIN);

    GxVideo_SetDeviceCtrl(DOUT1, DISPLAY_DEVCTRL_BACKLIGHT, TRUE);

    //TM_End("OFF_TO_CAPTURE");
//#NT#2010/04/15#Jeah Yen -FASTBOOT- -end
}
UINT32 GetMovieDispAspectRatio_2p(UINT32 uiPath, UINT32 uiIndex)
{
    if(System_GetState(SYS_STATE_CURRSUBMODE)==SYS_SUBMODE_WIFI)
    {
        if(UI_GetData(FL_WIFI_MOVIE_FMT)==WIFI_RTSP_LIVEVIEW || uiPath == 1)
            return g_WiFiMovieAppPreviewSizeTable[UI_GetData(FL_WIFI_MOVIE_APP_PREVIEW_SIZE)].uiDispAspectRatio;
        else
            return g_MovieRecSizeTable[uiIndex].uiDispAspectRatio;
    }
    else
    {
        return g_MovieRecSizeTable[uiIndex].uiDispAspectRatio;
    }
}
Example #12
0
void UI_DetGsensor(void)
{
#if 1
    Gsensor_Data GS_Data;
    INT32 gsensor_trig;
    static UINT32 X,Y,Z;
    static UINT32 counter=0;
    if(counter<5)
    {
	GSensor_GetStatus(&GS_Data);
	counter++;
    }
    else
    {
        if (System_GetState(SYS_STATE_CURRMODE)==PRIMARY_MODE_MOVIE)
        {
        	switch(gMovData.State)	
        	{
        	     case MOV_ST_REC:
		     case MOV_ST_REC|MOV_ST_ZOOM:
		        if(UI_GetData(FL_MOVIE_GSENSOR)!=GSENSOR_OFF)
			  {
				if(GSensor_GetStatus(&GS_Data)==TRUE)
		            {
		            #if 1
                        		Ux_PostEvent(NVTEVT_GSENSOR_TRIG, 0);
				#else					
		            		gsensor_trig=Get_GSensorSensitivity();
		                   if((abs(GS_Data.Axis.Xacc-X)>gsensor_trig)||(abs(GS_Data.Axis.Yacc-Y)>gsensor_trig)
						||(abs(GS_Data.Axis.Zacc-Z)>gsensor_trig))
		                   	{
		            			debug_msg("gsensor trig TRUE ...%d,%d,%d, threshold:%d\r\n",GS_Data.Axis.Xacc,GS_Data.Axis.Yacc,GS_Data.Axis.Zacc,gsensor_trig);
						if(UIFlowWndMovie_IsGsensorTrig()==FALSE)
						{
							//UIFlowWndMovie_SetGsensorTrigFlag(TRUE);
                        				Ux_PostEvent(NVTEVT_GSENSOR_TRIG, 0);
						}	
		                   	}
					X=GS_Data.Axis.Xacc;
					Y=GS_Data.Axis.Yacc;
					Z=GS_Data.Axis.Zacc;		
                         #endif					
		            }		
			    }
			break;
        	}
        }
    }
#endif	
}
Example #13
0
void FlowMode_OnUsbPlug(void)
{
    UINT32 usbMode = UI_GetData(FL_USB_MODE);

    UIDebug_usb(("^BFlowMode_OnUsbPlug begin\r\n"));
    UIDebug_usb(("USB_CB:PlugIn,cur mode=%d,usb mode=%d\r\n",System_GetState(SYS_STATE_CURRMODE),usbMode));

    //#NT#2010/11/26#Jeah Yen -begin
    if (UI_GetData(FL_ModeIndex) == DSC_MODE_USB_FAST_CHARGE)
    {
        return;
    }
    //#NT#2010/11/26#Jeah Yen -end

    //#NT#2010/11/17#Lily Kao -begin
    if (usbMode == USB_MODE_PTP)
    {
#if (UI_STYLE!=UI_STYLE_DRIVER)
        UI_SetData(FL_NextMode, DSC_MODE_USB_APP_SIDC);
        Ux_SendEvent(0, NVTEVT_SYSTEM_MODE, 1, PRIMARY_MODE_USBSIDC);
#endif
    }
    else if (usbMode == USB_MODE_PICTBRIDGE)
    {
#if (UI_STYLE!=UI_STYLE_DRIVER)
        UI_SetData(FL_NextMode, DSC_MODE_USB_APP_PRINTER);
        Ux_SendEvent(0, NVTEVT_SYSTEM_MODE, 1, PRIMARY_MODE_PRINTER);
#endif
    }
    else if (usbMode == USB_MODE_PCC)
    {
        UI_SetData(FL_NextMode, DSC_MODE_USB_APP_PCC);
        Ux_SendEvent(0, NVTEVT_SYSTEM_MODE, 1, PRIMARY_MODE_USBPCC);
    }
#if _DEMO_TODO
    else if (usbMode == USB_MODE_YOUTUBE)
    {
        UI_SetData(FL_NextMode, DSC_MODE_USB_APP_MSDC);
        Ux_SendEvent(0, NVTEVT_SYSTEM_MODE, 1, PRIMARY_MODE_USBYOUTUBE);
    }

#endif
    else //if (usbMode == USB_MODE_MSDC)
    {
        UI_SetData(FL_NextMode, DSC_MODE_USB_APP_MSDC);
        Ux_SendEvent(0, NVTEVT_SYSTEM_MODE, 1, PRIMARY_MODE_USBMSDC);
    }
    //#NT#2010/11/17#Lily Kao -end
    UIDebug_usb(("^BFlowMode_OnUsbPlug end\r\n"));
}
INT32 UIFlowWndWiFiMovie_OnExeMovieLiveviewStart(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
{
    BOOL startLview =0;
    UINT32 result = WIFIAPP_RET_OK;
    UINT32 curStatus = 0;
    if(paramNum>0)
    {
        startLview = paramArray[0];
    }

    if (System_GetState(SYS_STATE_CURRMODE) != PRIMARY_MODE_MOVIE)
    {
        WifiCmd_Done(WIFIFLAG_PREVIEW_DONE, WIFIAPP_RET_STATE_ERR);
        UIFlowWndWiFiMovieErrMsg("not movie mode\r\n");
        return NVTEVT_CONSUME;
    }

    curStatus = UIFlowWndWiFiMovie_GetStatus();
    if(startLview)
    {
        if(curStatus==WIFI_MOV_ST_IDLE)
        {
            FlowWiFiMovie_StartRec(WIFI_RTSP_LIVEVIEW);
        }
        else if(curStatus==WIFI_MOV_ST_RECORD)
        {
            result = WIFIAPP_RET_FAIL;
            UIFlowWndWiFiMovieErrMsg("recording\r\n");
        }

    }
    else
    {
        if(curStatus==WIFI_MOV_ST_LVIEW)
        {
            FlowWiFiMovie_StopRec();
        }
        else if(curStatus==WIFI_MOV_ST_RECORD)
        {
            result = WIFIAPP_RET_FAIL;
            UIFlowWndWiFiMovieErrMsg("recording\r\n");
        }
    }

    WifiCmd_Done(WIFIFLAG_PREVIEW_DONE,result); // signal wi-fi app cmd is done.
    return NVTEVT_CONSUME;
}
INT32 UIFlowWndWiFiMovie_OnExeMovieTriggerRawEnc(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
{
    UINT32 result = WIFIAPP_RET_OK;
    UINT32 curStatus = 0;
    UINT32 uiJpegWidth, uiJpegHeight, uiDAR, uiMovieSize;
    UINT32 i;
    if (System_GetState(SYS_STATE_CURRMODE) != PRIMARY_MODE_MOVIE)
    {
        WifiCmd_Done(WIFIFLAG_PREVIEW_DONE, WIFIAPP_RET_STATE_ERR);
        UIFlowWndWiFiMovieErrMsg("not movie mode\r\n");
        return NVTEVT_CONSUME;
    }

    curStatus = UIFlowWndWiFiMovie_GetStatus();
    if(curStatus == WIFI_MOV_ST_RECORD)
    {
        GxLED_SetCtrl(KEYSCAN_LED_RED,SET_TOGGLE_LED,FALSE);
        for(i=0; i<5; i++)
        {
            GxLED_SetCtrl(KEYSCAN_LED_RED,TURNON_LED,FALSE);
            Delay_DelayMs(50);
            GxLED_SetCtrl(KEYSCAN_LED_RED,TURNON_LED,TRUE);
            Delay_DelayMs(50);
        }
        GxLED_SetCtrl(KEYSCAN_LED_RED,SET_TOGGLE_LED,TRUE);

        uiMovieSize = UI_GetData(FL_MOVIE_SIZE);
        uiJpegWidth = GetMovieSizeWidth(uiMovieSize);
        uiJpegHeight = GetMovieSizeHeight(uiMovieSize);
        uiDAR = GetMovieDispAspectRatio(uiMovieSize);
        if (uiDAR == VIDENC_DAR_16_9)
        {
            uiJpegWidth = (uiJpegHeight * 16) / 9;
        }

        Ux_SendEvent(&CustomMovieObjCtrl, NVTEVT_EXE_MOVIE_REC_RAWENC, 2, uiJpegWidth, uiJpegHeight);
    }
    else
    {
        result = WIFIAPP_RET_FAIL;
        UIFlowWndWiFiMovieErrMsg("Not in recording state\r\n");

        WifiCmd_Done(WIFIFLAG_MOVIE_REC_RAWENC_DONE, result); // signal wi-fi app cmd is done.
    }

    return NVTEVT_CONSUME;
}
void System_ChangeMode(UINT32 mode_id)
{
    //avoid event in queue,and execute at the same time
    UI_LockEvent();

    DBG_FUNC_BEGIN("\r\n");
    DBG_MSG("Mode Begin (id: 0x%02x) ...\r\n", mode_id);

    //close current
    System_ModeClose();
    /*
    //if(g_bIsInitSystemFinish)
    {
        GX_MODE* pCurrMode = GxSystem_GetCurrentMode();

        if(pCurrMode && pCurrMode->pfMode_OnPauseDMA)
            pCurrMode->pfMode_OnPauseDMA(); //call mode process
        GxSystem_ActivePause(); //pause DMA access of all standard modules
    }

    DxSys_ChangeDMASpeed(speed_id);

    //if(g_bIsInitSystemFinish)
    {
        GX_MODE* pCurrMode = GxSystem_GetCurrentMode();

        GxSystem_ActiveResume(); //resume DMA access of all standard modules
        if(pCurrMode && pCurrMode->pfMode_OnResumeDMA)
            pCurrMode->pfMode_OnResumeDMA(); //call mode process
    }
    */

    g_iSysPrevSubMode = g_iSysCurSubMode;
    g_iSysCurSubMode = g_iSysNextSubMode;
    //open new
   // mode_id = PRIMARY_MODE_PLAYBACK;
    System_ModeOpen(mode_id);

    DBG_MSG("Mode End (id: 0x%02x)\r\n", System_GetState(SYS_STATE_CURRMODE));
    DBG_FUNC_END("\r\n");

    //resume queue,event can be executed
    UI_UnlockEvent();
}
INT32 UIMenuWndWiFiMobileLink_OnKeyShutter2(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
{
	UINT32 uiKeyAct;
	INT32 curMode = System_GetState(SYS_STATE_CURRMODE);
	 uiKeyAct = paramNum ? paramArray[0] : 0;

    switch (uiKeyAct)
    {
    case NVTEVT_KEY_PRESS:
		if( curMode == PRIMARY_MODE_PHOTO)
			{
			debug_msg("###  key   press  start cap\r\n");
				return UIFlowWndWiFiPhoto_OnExePhotoCapture(pCtrl, paramNum, paramArray);
			}
		else if(curMode == PRIMARY_MODE_MOVIE)
			{
			
			 if (UIFlowWndWiFiMovie_GetStatus() == WIFI_MOV_ST_LVIEW)//if(!MediaRec_IsRecording())
				{
				debug_msg("###  key   press  start \r\n");
				paramNum = 1;
					paramArray[0]=1;
					return UIFlowWndWiFiMovie_OnExeMovieKeyRec(pCtrl, paramNum, paramArray);
				}
			else  if (UIFlowWndWiFiMovie_GetStatus() == WIFI_MOV_ST_RECORD)
				{
				debug_msg("###  key   press  stop\r\n");
				paramNum = 1;
					paramArray[0]=0;
				return UIFlowWndWiFiMovie_OnExeMovieKeyRec(pCtrl, paramNum, paramArray);
				}
				//return UIFlowWndWiFiMovie_OnExeMovieRec(pCtrl, paramNum, paramArray);
		
			}
		else if( curMode == PRIMARY_MODE_PLAYBACK)
				return NVTEVT_CONSUME;

		break;
    	}
				
			
    Ux_DefaultEvent(pCtrl,NVTEVT_KEY_SHUTTER2,paramNum,paramArray);
    return NVTEVT_CONSUME;
}
INT32 UIFlowWndWiFiMovie_OnExeSetMovieGSesnorSensitivity(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
{
    UINT32 Data;

    Data = paramNum ? paramArray[0] : 0;

    if (System_GetState(SYS_STATE_CURRMODE) != PRIMARY_MODE_MOVIE)
    {
        UIFlowWndWiFiMovieErrMsg("not movie mode\r\n");
        return NVTEVT_CONSUME;
    }

    if (UIFlowWndWiFiMovie_GetStatus() != WIFI_MOV_ST_RECORD)
    {
        Ux_SendEvent(&CustomMovieObjCtrl, NVTEVT_EXE_GSENSOR, 1, Data);
    }

    return NVTEVT_CONSUME;
}
INT32 UIFlowWndWiFiMovie_OnExeSetAutoRecording(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
{
    UINT32 Data;

    Data = paramNum ? paramArray[0] : 0;

    if (System_GetState(SYS_STATE_CURRMODE) != PRIMARY_MODE_MOVIE)
    {
        UIFlowWndWiFiMovieErrMsg("not movie mode\r\n");
        return NVTEVT_CONSUME;
    }

    if (UIFlowWndWiFiMovie_GetStatus() != WIFI_MOV_ST_RECORD)
    {
        UI_SetData(FL_WIFI_AUTO_RECORDING, Data);
    }

    return NVTEVT_CONSUME;
}
Example #20
0
INT32 SetupExe_OnPreviewMode(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
{
    int curMode = System_GetState(SYS_STATE_CURRMODE);
    //debug_msg("[SetupObj] do Back to Previous mode:%d\r\n",curMode);

    #if 0
    UI_Switch_DscMode(UI_GetData(FL_PreMode),DSCMODE_SWITCH_FORCE,DSCMODE_SWITCHDIR_DONT_CARE);
    #else
    if (curMode ==PRIMARY_MODE_PLAYBACK)
    {
        UI_Switch_DscMode(UI_GetData(FL_PreMode),DSCMODE_SWITCH_FORCE,DSCMODE_SWITCHDIR_DONT_CARE);
    }
    else
    {
        VControl *previewWnd;
        Ux_GetWindowByIndex(&previewWnd,1);
        //close wind untill root window
        Ux_CloseWindow(previewWnd, 0);
    }
    #endif
    return NVTEVT_CONSUME;
}
Example #21
0
void ModePhoto_Close(void)
{
    //--------------------------------------------------------------------------
    // The close flow should be: 1. UIClose 2. AppClose 3. DevCtrl
    //--------------------------------------------------------------------------
    if(System_GetState(SYS_STATE_CURRSUBMODE)==SYS_SUBMODE_WIFI)
    {
        UI_CloseWifiWnd();
    }
    else
    {
#if(_USR_WND_==ENABLE)
        Ux_CloseWindowClear((VControl *)(gWndID), 0);
#else
#if (UI_STYLE==UI_STYLE_DRIVER)
        Ux_CloseWindowClear((VControl *)(&UIFlowWndPhotoCtrl), 0);
#else
        Ux_CloseWindowClear((VControl *)(&FlowPhotoCtrl), 0);
#endif
#endif
    }
    Ux_SendEvent(0, NVTEVT_EXE_CLOSE, 0);
}
Example #22
0
INT32 System_OnUsbInsert(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
{
    //usb plug in
    DBG_IND("USB plug - begin\r\n");
    USB_UpdateSource();
    Ux_PostEvent(NVTEVT_BATTERY, 0, 0);
    if(!IS_USB_VENDOR())
    {
        #if (UI_STYLE==UI_STYLE_DRIVER)
        debug_msg("USBConnectType=%d\r\n",GxUSB_GetConnectType());
        if ((GxUSB_GetConnectType() == USB_CONNECT_PC) || (GxUSB_GetConnectType() == USB_CONNECT_CHARGING_PC))
        {
            Ux_SendEvent(0, NVTEVT_SYSTEM_MODE, 1, PRIMARY_MODE_USBMENU);
            USB_PlugInSetFunc();
        }
        else if (GxUSB_GetConnectType() == USB_CONNECT_CHARGER)
        {
            if (System_GetState(SYS_STATE_CURRMODE)==PRIMARY_MODE_MOVIE)
            {
                m_bACPlug = TRUE;
                Ux_PostEvent(NVTEVT_AC_Plug, 0, 0);
            }
        }
        #else
        if(USB_GetSource() == USB_SRC_UNKNOWN)
        {
            DBG_MSG("^B USB PlugOn unknown, update again\r\n");
            USB_UpdateSource();
        }
        if(USB_GetSource() == USB_SRC_USB_PC)
        {
#if (POWERON_TESTFLOW == ENABLE)
#else
            //#NT#2010/12/2#Jeah Yen -begin
            #if (USB_CHARGE_FUNCTION == ENABLE)
            if (!GxPower_GetControl(GXPWR_CTRL_IS_BATT_INSERT))
            {
                //USB PC plug, but No battry for charge, shutdown now!
                DBG_MSG("^B USB PlugOn,PwrOff 1\r\n");
                System_PowerOff(SYS_POWEROFF_NORMAL);
                return NVTEVT_CONSUME;
            }
            #endif
#endif
            //#NT#2010/12/2#Jeah Yen -end
            USB_PlugInSetFunc();
            FlowMode_OnUsbPlug();
            //NOT start USB charge here! Only wait until USB "configured" OK, then try to do USB charge!
            //Please refer to System_OnUsbChargeCurrent() to complete your charging control.
        }
        #endif
        m_bVendorConnected = FALSE;
    }
    else
    {
        MSDCNVTCB_OPEN Open={0};
        Open.fpUSBMakerInit = USBMakerInit_UMSD;
        MsdcNvtCb_Open(&Open);
        m_bVendorConnected = TRUE;
    }
    DBG_IND("USB plug - end\r\n");
    return NVTEVT_CONSUME;
}
Example #23
0
void FlowMode_OnUsbUnplug(void)
{
    UINT32 filesize ;
    char * uiBuffer ;
    //ER status ;
    UIDebug_usb(("^BFlowMode_OnUsbUnplug begin\r\n"));
    //#NT#2010/03/16#Lincy Lin -begin
    //#NT# For Calibration
    #if 1
    if(IS_USB_VENDOR())
    {
            FST_FILE filehdl = NULL;
            INT32 ret = FST_STA_ERROR;
#if _DEMO_TODO
            GxFile_GetStorageObj(PRIMARY_STGTYPE_CARD)->Close();
            //GxFile_ChangeStorage(PRIMARY_STGTYPE_CARD);
            GxFile_ChangeStorage(PRIMARY_STGTYPE_CARD);
#endif
            uiBuffer = (char *)OS_GetMempoolAddr(POOL_ID_GFX_IMAGE);
            debug_err(("\n[IMG] Pool size read %d \r\n", OS_GetMempoolSize(POOL_ID_GFX_IMAGE)));
            // Update English Language begin
            filesize = 0x4;
            // Disable IDE video1/video2 output
            //UI_Show(UI_SHOW_INFO, TRUE); //OSD2
            //UI_Show(UI_SHOW_WINDOW, TRUE);  //OSD1
            //UI_Show(UI_SHOW_BACKGND, TRUE); //VDO2
            //UI_Show(UI_SHOW_PREVIEW, TRUE); //VDO1
            GxVideo_SetDeviceCtrl(DOUT1, DISPLAY_DEVCTRL_BRIGHTLVL, 5);
            filehdl = FileSys_OpenFile("A:\\FO.txt",FST_OPEN_READ);
            ret = FileSys_ReadFile(filehdl,(UINT8*)uiBuffer,&filesize, 0, 0);
            FileSys_CloseFile(filehdl);
            if(ret==FST_STA_OK)
            {
                Ux_SendEvent(0, NVTEVT_SYSTEM_MODE, 1, PRIMARY_MODE_PHOTO);
                #if (_CALIBRATION_MODE_ == ENABLE)
                //g_IsautoMTF = TRUE;
                g_bCalbirationOpened = FALSE;
                #endif
                SwTimer_DelayMs(1500);
                Ux_PostEvent(NVTEVT_STORAGE_INIT, 0, 0);
                //FocusOffsetAdjust();
                //debug_err(("^R status = 0x%x 0x%x \r\n" , status , *(UINT32 *)uiBuffer));
            }
            else
            {
                UIDebug_usb(("^B USB PlugOff,PwrOff 1\r\n"));
                System_PowerOff(SYS_POWEROFF_NORMAL);
            }
    }
    else
    {
        UIDebug_usb(("^B USB PlugOff,PwrOff 2\r\n"));
        System_PowerOff(SYS_POWEROFF_NORMAL);
    }
    #else
    #if (MODEKEY_FUNCTION == ENABLE)
    Ux_SendEvent(0, NVTEVT_SYSTEM_MODE, 1, System_GetState(SYS_STATE_PREVMODE));
    //#NT#2009/12/24#Lily Kao - begin
    debug_msg("USB_CB:PlugOff,PrevMode=%d\r\n",System_GetState(SYS_STATE_PREVMODE));
    //System_PowerOff();
    //#NT#2010/01/14#Lincy Lin -begin
//#NT#2010/02/03#Brad Chen -begin
//#NT# add USB unplug then change to photo mode
    {
        UINT32 uiDscMode;
        //#NT#2010/01/20#JeahYen -begin
        uiDscMode = Input_Key2Mode(GxKey_GetData(GXKEY_STS_KEY1));
        //#NT#2010/01/20#JeahYen -end
        UI_SetData(FL_ModeIndex,uiDscMode);
        UI_Switch_DscMode(uiDscMode,DSCMODE_SWITCH_FORCE,DSCMODE_SWITCHDIR_DONT_CARE);
    }
//#NT#2010/02/03#Brad Chen -end
    #else
    {
        UINT32 uiDscMode;
        //#NT#2010/01/20#JeahYen -begin
        uiDscMode = Input_Key2Mode(GxKey_GetData(GXKEY_STS_KEY1));
        //#NT#2010/01/20#JeahYen -end
        UI_SetData(FL_ModeIndex,uiDscMode);
        UI_Switch_DscMode(uiDscMode,DSCMODE_SWITCH_FORCE,DSCMODE_SWITCHDIR_DONT_CARE);
    }
    #endif
    #endif
    //#NT#2010/03/16#Lincy Lin -end
    UIDebug_usb(("^BFlowMode_OnUsbUnplug end\r\n"));
}
INT32 Card_SingleRemove(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
{
    //if (bStorageInitsts == FALSE)
    char* pDxName=NULL;
    DX_HANDLE pStrgDevOld = GxStrg_GetDevice(0);
    DX_HANDLE pStrgDevNew = Dx_GetObject(DX_CLASS_STORAGE_EXT|DX_TYPE_NAND1);
    #if(STORAGE_HOT_PLUG==ENABLE)
    if(System_GetState(SYS_STATE_CURRMODE)==PRIMARY_MODE_MOVIE)
    {
		switch(gMovData.State)
		{
			 case MOV_ST_REC:
		        case MOV_ST_REC|MOV_ST_ZOOM:
				MediaRec_Stop(MEDIAREC_WAIT_END);  	
				GxLED_SetCtrl(KEYSCAN_LED_GREEN,SET_TOGGLE_LED,FALSE);
				GxLED_SetCtrl(KEYSCAN_LED_GREEN,TURNON_LED,FALSE);					 
			 break;		
		}
    }
    #endif
    UI_SetData(FL_CardStatus, CARD_REMOVED);

    if(Dx_GetInfo(pStrgDevOld, DX_INFO_NAME,&pDxName)!=DX_OK)
    {
        pDxName = NULL;
    }

    if((pStrgDevOld!=0) && pDxName!=NULL && strcmp(pDxName,"Storage_Card1")==0) //old is card
    {
    	 #if(STORAGE_HOT_PLUG==ENABLE)
	        // unmount file system
	        if (GxStrg_CloseDevice(0) != TRUE)
	        {
	            //DBG_ERR("Storage unmount %s fail\r\n", Dx_GetName(pStrgDevOld));
	            return NVTEVT_CONSUME;
	        }		 
	 #else	 
	        //#NT#2012/10/30#Lincy Lin -begin
	        //#NT#Card hot plug in, out, should power off
	        #if(RTSP_LIVEVIEW_FUNC==ENABLE)
	        //RTSP do not power off for easy to work on debug
	        #elif (1)
	        System_PowerOff(SYS_POWEROFF_NORMAL);
	        #else

	        DBG_IND("File change to NAND storage\r\n");
	        // unmount file system
	        if (GxStrg_CloseDevice(0) != TRUE)
	        {
	            DBG_ERR("Storage unmount %s fail\r\n", Dx_GetName(pStrgDevOld));
	            return NVTEVT_CONSUME;
	        }
	        #endif
	 #endif	
        //#NT#2012/10/30#Lincy Lin -end
    }
    pStrgDevOld = GxStrg_GetDevice(0);
    if(pStrgDevOld==0)
    {
        // mount file system
        if (GxStrg_OpenDevice(0, pStrgDevNew) != TRUE)
        {
            char* pDxName="unknown";
            Dx_GetInfo(pStrgDevNew, DX_INFO_NAME,&pDxName);
            DBG_ERR("Storage mount %s fail\r\n", pDxName);
            return NVTEVT_CONSUME;
        }
        //bStorageInitsts = TRUE;
    }
    #if(STORAGE_HOT_PLUG==ENABLE)	
    if(gbFirstPoweron==TRUE)
    {
	gbFirstPoweron=FALSE;
    }
    else
    {
    	Ux_SendEvent(&UISetupObjCtrl,NVTEVT_EXE_CHANGEDSCMODE,1,DSCMODE_CHGTO_CURR);	
    }
    #endif	
    return NVTEVT_CONSUME;
}
void DevCtrl_ModePlayback(void)
{
    UINT32 uiPrevMode = System_GetState(SYS_STATE_PREVMODE);
    debug_msg("^MMODE %d->%d\r\n", uiPrevMode, PRIMARY_MODE_PLAYBACK);
    DrvSensor_TurnOffPower();
}
Example #26
0
void Graphic_Process()
{

	eSystemState	currensSysState = System_GetState();
	char strOutBuf[8];
	
	HCMS_Clear();
	
	//switch(System_GetState())
	{
		if (currensSysState == SYS_TIME || currensSysState == SYS_SET_HOUR || currensSysState == SYS_SET_MIN || currensSysState == SYS_SET_SEC)
		{
			currentTime = System_GetRTCTime();
			if(currentTime->Seconds % 2)
				sprintf(strOutBuf, "%02d:%02d:%02d", currentTime->Hours,currentTime->Minutes,currentTime->Seconds);
			else
				sprintf(strOutBuf, "%02d %02d %02d", currentTime->Hours,currentTime->Minutes,currentTime->Seconds);
			HCMS_PutStr(strOutBuf);
		}
		
		if (currensSysState == SYS_DATE || currensSysState == SYS_SET_DAY || currensSysState == SYS_SET_MONTH || currensSysState == SYS_SET_YEAR)
		{
			currentDate = System_GetRTCDate();
			
			sprintf(strOutBuf, "%02d/%02d/%02d", currentDate->Date,currentDate->Month,currentDate->Year);
			HCMS_PutStr(strOutBuf);
		}
		
		if (currensSysState == SYS_SETTINGS )
		{	
			uSettingScrollCnt++;
			
			switch(System_GetSettingsState())
			{
				
				case SELECT_DEFAULT: 	HCMS_PutStr((char*)strSettingsText); break;
				case SELECT_BRIGHT: 	
				{
					sprintf(strOutBuf,"%s%3d%%",strBrightText,Settigns.uPWMBrightness);
					HCMS_PutStr((char*)strOutBuf);
				}break;
				case SELECT_TIME: 		HCMS_PutStr((char*)strTimeText); 		 break;
				case SELECT_DATE: 		HCMS_PutStr((char*)strDateText); 		 break;
				case SELECT_EXIT:			HCMS_PutStr((char*)strExitText);  		break;
			}

		}
		/*
		case SYS_SET_HOUR:
		{		
				sprintf(strOutBuf, "%02d:%02d:%02d", currentTime.Hours,currentTime.Minutes,currentTime.Seconds);
				HCMS_PutStr((char*)"хуй");
		}break;
		
		case SYS_SET_MIN:
		{				
				sprintf(strOutBuf, "%02d:%02d:%02d", currentTime.Hours,currentTime.Minutes,currentTime.Seconds);
				HCMS_PutStr((char*)"суй");
		}break;
		
		case SYS_SET_SEC:
		{			
				sprintf(strOutBuf, "%02d:%02d:%02d", currentTime.Hours,currentTime.Minutes,currentTime.Seconds);
				HCMS_PutStr((char*)"туда");
		}break;*/
		
		

	}
}
void _System_PowerOff(void)
{
    //register int i;
    DBG_FUNC_BEGIN("\r\n");

#if _MIPS_TODO
    //when flow is very slow after case POWERON_CB_END: g_bIsInitSystemFinish = TRUE;
    //press power off key will cause system hang
    //=> should wait for power on finish before power off
    if((pwrOffType == SYS_POWEROFF_NORMAL))
    {
        ID currTid = 0;
        get_tid(&currTid);
        if (INITTSK_ID != currTid)
        {
            InitMain_WaitFinish();
        }
    }
#endif


#if 0
    ///////////////////////////////////////////
    if(System_GetState(SYS_STATE_POWEROFF) == SYS_POWEROFF_NORMAL)
    {
        //"normal power-off sequence"
        DBG_MSG("Power Off Sequence = Normal\r\n");

        //shut down FW subsystems
            DevMan[SYS]->CmdAsync(DEVMAN_CMD_EXIT, 0, 0);
            DevMan[CARD]->CmdAsync(DEVMAN_CMD_EXIT, 0, 0);
            DevMan[SENSOR]->CmdAsync(DEVMAN_CMD_EXIT, 0, 0);
            DevMan[LENS]->CmdAsync(DEVMAN_CMD_EXIT, 0, 0);
            DevMan[CARD]->WaitSync(DEVMAN_SYNC_EXIT_POSTCLOSE);//wait until Card finish
            DevMan[NAND]->CmdAsync(DEVMAN_CMD_EXIT, 0, 0);

        //shut down HW devices
            DevMan[AUDIO]->Cmd(DEVMAN_CMD_EXIT, 0, 0);
            DevMan[USB]->Cmd(DEVMAN_CMD_EXIT, 0, 0);
            DevMan[DISP]->Cmd(DEVMAN_CMD_EXIT, 0, 0);
    }
    else if(System_GetState(SYS_STATE_POWEROFF) == SYS_POWEROFF_SAFE)
    {
        //"safe power-off sequence"
        DBG_MSG("Power Off Sequence = Safe\r\n");

        //shut down FW subsystems
            DevMan[SYS]->Cmd(DEVMAN_CMD_EXIT, 0, 0);
            DevMan[CARD]->Cmd(DEVMAN_CMD_EXIT, 0, 0);
            DevMan[NAND]->CmdAsync(DEVMAN_CMD_EXIT, 0, 0);

        //shut down HW devices
            DevMan[AUDIO]->Cmd(DEVMAN_CMD_EXIT, 0, 0);
            DevMan[USB]->Cmd(DEVMAN_CMD_EXIT, 0, 0);
            DevMan[SENSOR]->Cmd(DEVMAN_CMD_EXIT, 0, 0);
            DevMan[LENS]->Cmd(DEVMAN_CMD_EXIT, 0, 0);
            DevMan[DISP]->Cmd(DEVMAN_CMD_EXIT, 0, 0);
    }
    else if(System_GetState(SYS_STATE_POWEROFF) == SYS_POWEROFF_LOWPOWER)
    {
        //"lowpower power-off sequence"
        DBG_MSG("Power Off Sequence = LowPower\r\n");

        //shut down FW subsystems
            DevMan[SYS]->Cmd(DEVMAN_CMD_EXIT, 0, 0);
            //DevMan[CARD]->SetSync(DEVMAN_CMD_EXIT, 0, 0);

        //shut down HW devices
            DevMan[AUDIO]->Cmd(DEVMAN_CMD_EXIT, 0, 0);
            //DevMan[USB]->Cmd(DEVMAN_CMD_EXIT, 0, 0);
            //DevMan[SENSOR]->Cmd(DEVMAN_CMD_EXIT, 0, 0);
            //DevMan[LENS]->Cmd(DEVMAN_CMD_EXIT, 0, 0);
            DevMan[DISP]->Cmd(DEVMAN_CMD_EXIT, 0, 0);
    }
    else if(System_GetState(SYS_STATE_POWEROFF) == SYS_POWEROFF_CHARGE)
    {
        //"charge power-off sequence"
        DBG_MSG("Power Off Sequence = Charge\r\n");

        //shut down FW subsystems
            DevMan[SYS]->Cmd(DEVMAN_CMD_EXIT, 0, 0);
            //DevMan[CARD]->SetSync(DEVMAN_CMD_EXIT, 0, 0);

        //shut down HW devices
            DevMan[AUDIO]->Cmd(DEVMAN_CMD_EXIT, 0, 0);
            DevMan[USB]->Cmd(DEVMAN_CMD_EXIT, 0, 0);
            //DevMan[SENSOR]->Cmd(DEVMAN_CMD_EXIT, 0, 0);
            //DevMan[LENS]->Cmd(DEVMAN_CMD_EXIT, 0, 0);
            DevMan[DISP]->Cmd(DEVMAN_CMD_EXIT, 0, 0);
    }

    ///////////////////////////////////////////
    //wait until all device manager exit finish
    for(i=0;i<DEVICE_ID_MAX;i++)
        DevMan[i]->WaitFinish(DEVMAN_CMD_EXIT);

    ///////////////////////////////////////////
    //close all device manager
    for(i=0;i<DEVICE_ID_MAX;i++)
        DevMan[i]->Close();
#endif
    DBG_FUNC_END("\r\n");
}
Example #28
0
void ModePhoto_Open(void)
{
    //--------------------------------------------------------------------------
    // The open flow should be: 1. DevCtrl 2. AppOpen 3. UIOpen
    //--------------------------------------------------------------------------

    Input_ResetMask();

    // Init Flow Window config for different DSC modes
    Ux_SetActiveApp(&CustomPhotoObjCtrl);
//#NT#2010/04/15#Jeah Yen -FASTBOOT- -begin
    //#NT#2010/03/02#JeahYen -begin
    if(g_bPreviewFirstTime)
    {
        //skip
        //GxSystem_Mark("APP-SKIP\r\n");
    }
    else
    {
        //TM_Begin(DEVCTRL_CCD);
        // Control CCD/LCD power on/off, lens, shutter...
        DevCtrl_ModePhoto();
        //TM_End(DEVCTRL_CCD);
        //TM_Begin(APP_OPEN);
        // Init Photo app and open
        Ux_SendEvent(0, NVTEVT_EXE_OPEN, 0);
        //TM_End(APP_OPEN);

    }
    if(!g_bPreviewFirstTime)
    {
        DevCtrl_ModePhoto_WaitFinish();
    }

    //TM_Begin(UI_OPENWIN);
    UI_SetData(FL_ModeIndex, UI_GetData(FL_NextMode));
/*
    //disable video1
    UI_Show(UI_SHOW_PREVIEW, TRUE);
    //enable video2
    UI_Show(UI_SHOW_QUICKVIEW, FALSE);
*/
    if(System_GetState(SYS_STATE_CURRSUBMODE)==SYS_SUBMODE_WIFI)
    {
        UI_OpenWifiWnd();
        UIMenuWndWiFi_Photo_OnOpen();  // Init Photo mode related parameters.
    }
    else
    {
#if(_USR_WND_==ENABLE)
    switch(UI_GetData(FL_ModeIndex))
    {
        case DSC_MODE_PHOTO_PANORAMA:
            Ux_OpenWindow((VControl *)(&FlowPanInitCtrl), 0);   //Test ASPSCS
            gWndID = (UINT32)&FlowPanInitCtrl;
            break;
        //#NT#2010/10/12#Photon Lin -begin
        //#Add AS/PS/CS mode
        #if (ASPSCS_FUNCTION==ENABLE)
        case DSC_MODE_PHOTO_PORTRAIT:
            Ux_OpenWindow((VControl *)(&FlowASPSCSCtrl), 0);   //Test ASPSCS
            gWndID = (UINT32)&FlowASPSCSCtrl;
            break;
        #endif
        //#NT#2010/10/12#Photon Lin -begin
        default:
            Ux_OpenWindow((VControl *)(&FlowPhotoCtrl), 0);
            gWndID = (UINT32)&FlowPhotoCtrl;
            break;
    }
#else
#if (UI_STYLE==UI_STYLE_DRIVER)
      Ux_OpenWindow((VControl *)(&UIFlowWndPhotoCtrl), 0);
#else
    Ux_OpenWindow((VControl *)(&FlowPhotoCtrl), 0);
#endif
#endif
    //TM_End(UI_OPENWIN);
    }

    g_bPreviewFirstTime = FALSE; //turn off fast path
    //TM_End(OFF_TO_CAPTURE);
//#NT#2010/04/15#Jeah Yen -FASTBOOT- -end
}
Example #29
0
// --------------------------------------------------------------------------
// Menu Callback
// --------------------------------------------------------------------------
int Setup_MenuCallback(UINT32 uiMessage, UINT32 uiParam)
{
    UINT16  uwItemId;
    UINT16  uwOption;

    if (uiMessage == TMM_CONFIRM_OPTION)
    {
        uwItemId = LO_WORD(uiParam);
        uwOption = HI_WORD(uiParam);

        switch (uwItemId)
        {
        case IDM_AUTO_POWER_OFF:
            #if(_MODEL_DSC_==_MODEL_DUAL_AONI328_)//vincent@20150914-2
            SysSetFlag(FL_AUTO_POWER_OFF,uwOption);
            if ((SysGetFlag(FL_MOVIE_MOTION_DET) == MOVIE_MOTIONDET_OFF) && (PRIMARY_MODE_PLAYBACK != System_GetState(SYS_STATE_CURRMODE)))//vincent@20150914-3 
            {
                Ux_SendEvent(&UISetupObjCtrl, NVTEVT_EXE_POWEROFF, 1, uwOption);
            }
            #else
            Ux_SendEvent(&UISetupObjCtrl, NVTEVT_EXE_POWEROFF, 1, uwOption);
            #endif
            break;

        case IDM_BEEP:
            Ux_SendEvent(&UISetupObjCtrl, NVTEVT_EXE_BEEPKEY, 1, uwOption);
            break;

        case IDM_LANGUAGE:
            Ux_SendEvent(&UISetupObjCtrl, NVTEVT_EXE_LANGUAGE, 1, uwOption);
            break;

        case IDM_TV_MODE:
            Ux_SendEvent(&UISetupObjCtrl, NVTEVT_EXE_TVFORMAT, 1, uwOption);
            break;

        case IDM_FREQUENCY:
            Ux_SendEvent(&UISetupObjCtrl, NVTEVT_EXE_FREQ, 1, uwOption);
            break;

        case IDM_SENSOR_ROTATE:
            Ux_SendEvent(&UISetupObjCtrl, NVTEVT_EXE_SENSOR_ROTATE, 1, uwOption);
            break;
        case IDM_LCDOFF:
            #if(_MODEL_DSC_==_MODEL_DUAL_AONI328_)//vincent@20150914-5
            SysSetFlag(FL_LCDOffIndex,uwOption);
            if (PRIMARY_MODE_PLAYBACK != System_GetState(SYS_STATE_CURRMODE))
            {
                Ux_SendEvent(&UISetupObjCtrl, NVTEVT_EXE_LCDOFF, 1, uwOption);
            }
            #endif
            
            Ux_SendEvent(&UISetupObjCtrl, NVTEVT_EXE_LCDOFF, 1, uwOption);
            break;

        case IDM_LEDSET:
            Ux_SendEvent(&UISetupObjCtrl, NVTEVT_EXE_LED, 1, uwOption);
            break;			
        case IDM_DELAYOFF:
            Ux_SendEvent(&UISetupObjCtrl, NVTEVT_EXE_DELAYOFF, 1, uwOption);
            break;

        }

    }

    return TMF_PROCESSED;
}
Example #30
0
INT32 System_UserKeyFilter(NVTEVT evt, UINT32 paramNum, UINT32 *paramArray)
{
    UINT32 key = evt;
    if(IN_RANGE_EVENT(key, NVTEVT_KEY_STATUS_START, NVTEVT_KEY_STATUS_END)) //Status class
    {
        System_ResetDetCloseLenCount();
        System_ResetPowerSaveCount();
#if (STATUSKEY_FUNCTION == ENABLE)
        DBG_IND("^Bgroup key event=0x%x\r\n", key);

        if(g_bConsumeStatus)
        {
            g_bConsumeStatus = 0;
        }
        else
        {
            UINT32 uiDscMode = Input_Key2Mode(key);
            DBG_IND("^YDscMode=0x%x\r\n", uiDscMode);
            //FlowMode_OnKeyMode(uiDscMode);
            UI_Switch_DscMode(uiDscMode,DSCMODE_SWITCH_FORCE,DSCMODE_SWITCHDIR_DONT_CARE);
        }
#endif
        return NVTEVT_CONSUME;
    }
    else if(IN_RANGE_EVENT(key, NVTEVT_KEY_BUTTON_START, NVTEVT_KEY_BUTTON_END)) //Button class
    {
        if(IN_RANGE_EVENT(key, NVTEVT_KEY_PRESS_START, NVTEVT_KEY_PRESS_END)) //Press key
        {
#if (_MODEL_DSC_ == _MODEL_CARDV_)
#else
		if((GPIOMap_IsLCDBacklightOn()==FALSE)&&
		(KeyScan_GetPlugDev() != 1)&&(KeyScan_GetPlugDev() != 2))
		{
			GPIOMap_TurnOnLCDBacklight();
			System_ResetPowerSaveCount();	
                   return NVTEVT_CONSUME;			
		}        
#endif		
            if(key == NVTEVT_KEY_POWER)
            {
                return NVTEVT_CONSUME;
            }

            System_ResetDetCloseLenCount();
            if(GxPower_GetControl(GXPWR_CTRL_SLEEP_LEVEL) > 1)  // drop key if sleep level > 1
            {
                //NOTE! do not set GXPWR_CTRL_SLEEP_RESET before get GXPWR_CTRL_SLEEP_LEVEL,
                //  because GXPWR_CTRL_SLEEP_LEVEL status maybe alter by sleep wakeup flow~
                System_ResetPowerSaveCount();
                return NVTEVT_CONSUME;
            }
            else
            {
                System_ResetPowerSaveCount();
                if (m_uiAnyKeyUnlockEn)
                {
                    Ux_PostEvent(NVTEVT_KEY_PRESS_START, 1, key);
                    return NVTEVT_CONSUME;
                }
                return NVTEVT_PASS;
            }
        }
        else if(IN_RANGE_EVENT(key, NVTEVT_KEY_CONTINUE_START, NVTEVT_KEY_CONTINUE_END)) //Contine key
        {
            if(key == NVTEVT_KEY_POWER_CONT)
            {
                return NVTEVT_CONSUME;
            }

            System_ResetDetCloseLenCount();
            System_ResetPowerSaveCount();
            return NVTEVT_PASS;
        }
        else if(IN_RANGE_EVENT(key, NVTEVT_KEY_RELEASE_START, NVTEVT_KEY_RELEASE_END)) //Release key
        {
            if(key == NVTEVT_KEY_POWER_REL)
            {
                System_ResetDetCloseLenCount();
                if(GxPower_GetControl(GXPWR_CTRL_SLEEP_LEVEL) > 1)  // drop key if sleep level > 1
                {
                    //NOTE! do not set GXPWR_CTRL_SLEEP_RESET before get GXPWR_CTRL_SLEEP_LEVEL,
                    //  because GXPWR_CTRL_SLEEP_LEVEL status maybe alter by sleep wakeup flow~
                    System_ResetPowerSaveCount();
                }
                else
                {
                    //g_bIsExitSystemWithPowerKey = TRUE;
		        if (System_GetState(SYS_STATE_CURRMODE)==PRIMARY_MODE_MOVIE)
		        {
		        	switch(gMovData.State)	
		        	{
		        	     case MOV_ST_REC:
				     case MOV_ST_REC|MOV_ST_ZOOM:
					//MediaRec_Stop(MEDIAREC_WAIT_END);  	
	                		FlowMovie_StopRec();				
				     break;
		        	}
		        }                       
                    System_PowerOff(SYS_POWEROFF_NORMAL);
                }
                return NVTEVT_CONSUME;
            }

            System_ResetDetCloseLenCount();
            System_ResetPowerSaveCount();
            return NVTEVT_PASS;
        }
    }
    return NVTEVT_PASS;
}