Example #1
0
INT32 UIFlowWndPhoto_OnOpen(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
{


    UIFlowWndPhoto_InitCfgSetting();
    FlowPhoto_InitStartupFuncs();

    /* Init window key mask variables & set key press/release/continue mask */
    gPhotoData.State = PHOTO_ST_VIEW;
    g_uiMaskKeyPress = PHOTO_KEY_PRESS_MASK;
    g_uiMaskKeyRelease = PHOTO_KEY_RELEASE_MASK;
    g_uiMaskKeyContinue = PHOTO_KEY_CONTINUE_MASK;
    Ux_FlushEventByRange(NVTEVT_KEY_EVT_START,NVTEVT_KEY_EVT_END);

    Input_SetKeyMask(KEY_PRESS, g_uiMaskKeyPress);
    Input_SetKeyMask(KEY_RELEASE, g_uiMaskKeyRelease);
    Input_SetKeyMask(KEY_CONTINUE, g_uiMaskKeyContinue);

    gPhotoData.SysTimeCount = 0;
    /* Update window info */
    FlowPhoto_UpdateIcons(TRUE);
    /* set FD/SD feature */
    FlowPhoto_SetFdSdProc(TRUE);

    Ux_DefaultEvent(pCtrl,NVTEVT_OPEN_WINDOW,paramNum,paramArray);
    return NVTEVT_CONSUME;
}
EVENT_END

static void FlowPB_SetKeyMask(UINT32 press, UINT32 release)
{
    Input_SetKeyMask(KEY_PRESS, press);
    Input_SetKeyMask(KEY_RELEASE, release);
}
INT32 UIFlowWndPlay_OnKeyMode(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
{
    //if (KeyScan_IsHDMIPlugIn()==TRUE)
    //    return NVTEVT_CONSUME;

    switch(g_PlbData.State)
    {
    case PLB_ST_PLAY_MOV:
    case PLB_ST_PAUSE_MOV:
    case PLB_ST_FWD_MOV:
    case PLB_ST_BWD_MOV:
        // stop movie play
        return UIFlowWndPlay_OnMovieFinish(pCtrl, paramNum, paramArray);

    default:
        Ux_FlushEventByRange(NVTEVT_KEY_EVT_START,NVTEVT_KEY_EVT_END);
        Input_SetKeyMask(KEY_PRESS, FLGKEY_KEY_MASK_NULL);
        Input_SetKeyMask(KEY_RELEASE, FLGKEY_KEY_MASK_NULL);
        Input_SetKeyMask(KEY_CONTINUE, FLGKEY_KEY_MASK_NULL);
        Ux_SendEvent(&UISetupObjCtrl,NVTEVT_EXE_CHANGEDSCMODE,1,DSCMODE_CHGTO_NEXT);
        break;
    }

    return NVTEVT_CONSUME;
}
Example #4
0
INT32 UIFlowWndPhoto_OnKeyMode(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
{
 UINT32 uiKeyAct=NVTEVT_KEY_PRESS;

    if (paramNum==1)
    {
        uiKeyAct = paramArray[0];
    } else {
        return NVTEVT_CONSUME;
    }

    switch(uiKeyAct)
    {
     case NVTEVT_KEY_PRESS:
        Ux_FlushEventByRange(NVTEVT_KEY_EVT_START,NVTEVT_KEY_EVT_END);
        Input_SetKeyMask(KEY_PRESS, FLGKEY_KEY_MASK_NULL);
        Input_SetKeyMask(KEY_RELEASE, FLGKEY_KEY_MASK_NULL);
        Input_SetKeyMask(KEY_CONTINUE, FLGKEY_KEY_MASK_NULL);

        Ux_SendEvent(&UISetupObjCtrl,NVTEVT_EXE_CHANGEDSCMODE,1,DSCMODE_CHGTO_NEXT);
        break;
    }

    return NVTEVT_CONSUME;
}
Example #5
0
static int MenuCustom_SwchToMenu(UINT32 uiMessage, UINT32 uiParam)
{
    // mask key while changing primary mode
    Ux_FlushEventByRange(NVTEVT_KEY_EVT_START,NVTEVT_KEY_EVT_END);
    Input_SetKeyMask(KEY_PRESS, FLGKEY_KEY_MASK_NULL);
    Input_SetKeyMask(KEY_RELEASE, FLGKEY_KEY_MASK_NULL);
    Input_SetKeyMask(KEY_CONTINUE, FLGKEY_KEY_MASK_NULL);
    // changing primary mode
    Ux_SendEvent(&UISetupObjCtrl,NVTEVT_EXE_CHANGEDSCMODE,1,DSCMODE_CHGTO_MOVIE);

    return 1;
}
Example #6
0
static INT32 UIFlowWndPhoto_OnExeZoomIn(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
{
    UINT32 uiEvtKeyAct = 0;

    if(paramNum > 0)
        uiEvtKeyAct = paramArray[0];

    switch(uiEvtKeyAct)
    {
        case NVTEVT_KEY_PRESS:
        case NVTEVT_KEY_CONTINUE:
            if (DZOOM_IDX_GET() > DZOOM_IDX_MAX())
              {
                Ux_SendEvent(&CustomPhotoObjCtrl,NVTEVT_EXE_ZOOM,2, UI_ZOOM_CTRL_STOP, UI_GetData(FL_Dzoom));
                gPhotoData.State &= ~PHOTO_ST_ZOOM;
                return NVTEVT_CONSUME;
              }
            switch(gPhotoData.State)
            {
              case PHOTO_ST_VIEW:
              case PHOTO_ST_VIEW|PHOTO_ST_ZOOM:
                   /* set Digital Zoom interface */
                   UI_SetData(FL_ZoomIFIndex,ZOOM_IF_DIGITAL);
                   /*
                    * Suspend all keys while keep ZoomIn pressed.
                    * Gotta resume them after ZoomIn key released.
                    */
                   Input_SetKeyMask(KEY_PRESS, FLGKEY_KEY_MASK_NULL);
                   FlowPhoto_ForceLockFdSd();
                   gPhotoData.State |= PHOTO_ST_ZOOM;
                   Ux_SendEvent(&CustomPhotoObjCtrl,NVTEVT_EXE_ZOOM,2, UI_ZOOM_CTRL_IN,UI_GetData(FL_Dzoom));
                break;
            }
            break;

        case NVTEVT_KEY_RELEASE:
             Ux_SendEvent(&CustomPhotoObjCtrl,NVTEVT_EXE_ZOOM,2, UI_ZOOM_CTRL_STOP,UI_GetData(FL_Dzoom));
             gPhotoData.State &= ~PHOTO_ST_ZOOM;
             FlowPhoto_SetFdSdProc(FlowPhoto_GetSDStatus());
             /* Resume keys after ZoomIn released */
             Input_SetKeyMask(KEY_PRESS, g_uiMaskKeyPress);
            break;

        default:
            debug_err(("UIFlowWndPhoto_OnKeyZoomin: Unknown evt 0x%x\r\n", uiEvtKeyAct));
            break;
    }

    return NVTEVT_CONSUME;
}
Example #7
0
INT32 UIFlowWndPhoto_OnKeyShutter2(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
{
    #if(_MODEL_DSC_ == _MODEL_DUAL_AONI328_)
        // mask key while changing primary mode
        Ux_FlushEventByRange(NVTEVT_KEY_EVT_START,NVTEVT_KEY_EVT_END);
        Input_SetKeyMask(KEY_PRESS, FLGKEY_KEY_MASK_NULL);
        Input_SetKeyMask(KEY_RELEASE, FLGKEY_KEY_MASK_NULL);
        Input_SetKeyMask(KEY_CONTINUE, FLGKEY_KEY_MASK_NULL);
        // changing primary mode
        Ux_SendEvent(&UISetupObjCtrl,NVTEVT_EXE_CHANGEDSCMODE,1,DSCMODE_CHGTO_MOVIE);
    #else
        return UIFlowWndPhoto_OnExeCapture(pCtrl,paramNum,paramArray);
    #endif
}
Example #8
0
INT32 UIFlowWndPhoto_OnKeyMenu(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
{
    UINT32  uiKeyAct;
    UINT32  uiSoundMask;

    uiKeyAct = paramArray[0];

    switch(uiKeyAct)
    {
    case NVTEVT_KEY_PRESS:
        switch(gPhotoData.State)
        {
        case PHOTO_ST_VIEW:
            // enable shutter2 sound (shutter2 as OK key in menu)
            uiSoundMask = Input_GetKeySoundMask(KEY_PRESS);
            uiSoundMask |= FLGKEY_SHUTTER2;
            Input_SetKeySoundMask(KEY_PRESS, uiSoundMask);

            /* Force to lock FD/SD functions before opening Menu */
            FlowPhoto_ForceLockFdSd();
            Input_SetKeyMask(KEY_RELEASE, FLGKEY_KEY_MASK_NULL);

            // Set Tab menu to Photo menu
            TM_SetMenu(&gPhotoMenu);
            // Open common mix (Item + Option) menu
            Ux_OpenWindow((VControl *)(&MenuCommonItemCtrl), 0);
            gPhotoData.State = PHOTO_ST_MENU;
            break;
        }
        break;
    }
    return NVTEVT_CONSUME;
}
Example #9
0
static void UIFlowWndPhoto_OnQVStart(void)
{

    /* Set to quick review mode */
    #if(_MODEL_DSC_!=_MODEL_DUAL_AONI328_)//vincent@20150914-6
    if (PhotoExe_CheckExtSensor() == FALSE) // don't do quick view for dual capture
    #endif
    {
    UI_Show(UI_SHOW_QUICKVIEW, TRUE);
    }

    switch(SysGetFlag(FL_QUICK_REVIEW))
        {
           case QUICK_REVIEW_2SEC:
             gPhotoData.QuickViewCount = 15;
            break;
           case QUICK_REVIEW_5SEC:
             gPhotoData.QuickViewCount = 45;
            break;
           case QUICK_REVIEW_0SEC:
             gPhotoData.QuickViewCount = 1;
            break;
        }

    if (g_uiQviewTimerID == NULL_TIMER)
    {
        /* Resume only S2 key while quick view timer started */
        Input_SetKeyMask(KEY_PRESS, FLGKEY_SHUTTER2);
        g_uiQviewTimerID = GxTimer_StartTimer(100, NVTEVT_01SEC_TIMER, CONTINUE);
    }
}
Example #10
0
INT32 UIFlowWndPhoto_OnKeyPlayback(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
{
    switch (gPhotoData.State)
    {
      case PHOTO_ST_VIEW:
      case (PHOTO_ST_VIEW|PHOTO_ST_ZOOM):
        Ux_FlushEventByRange(NVTEVT_KEY_EVT_START,NVTEVT_KEY_EVT_END);
        Input_SetKeyMask(KEY_PRESS, FLGKEY_KEY_MASK_NULL);
        Input_SetKeyMask(KEY_RELEASE, FLGKEY_KEY_MASK_NULL);
        Input_SetKeyMask(KEY_CONTINUE, FLGKEY_KEY_MASK_NULL);

        Ux_SendEvent(&UISetupObjCtrl,NVTEVT_FORCETO_PLAYBACK_MODE,0);
        break;
    }

    return NVTEVT_CONSUME;
}
Example #11
0
EVENT_END

INT32 UIMenuWndUSB_OnOpen(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
{
    Input_SetKeyMask(KEY_RELEASE, FLGKEY_KEY_MASK_NULL);
    Ux_DefaultEvent(pCtrl,NVTEVT_OPEN_WINDOW,paramNum,paramArray);
    return NVTEVT_CONSUME;
}
Example #12
0
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;
}
Example #13
0
INT32 UIFlowWndPlay_OnKeyPlayback(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
{
    switch(g_PlbData.State)
    {
        case PLB_ST_FULL:
            // 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_SendEvent(&UISetupObjCtrl,NVTEVT_EXE_CHANGEDSCMODE,1,DSCMODE_CHGTO_NEXT);
            break;

        case PLB_ST_PLAY_MOV:
        case PLB_ST_PAUSE_MOV:
        case PLB_ST_FWD_MOV:
        case PLB_ST_BWD_MOV:
            g_PlbData.State        = PLB_ST_FULL;
            g_PlbData.VideoPBSpeed = PLB_FWD_MOV_1x;
            UIFlowMoviePlay_SetSpeed(g_PlbData.VideoPBSpeed);
            g_uiUIFlowWndPlayCurrenDirection = MEDIAPLAY_DIR_FORWARD;

            Ux_SendEvent(&UIMoviePlayObjCtrl, NVTEVT_PAUSE_PLAY_MOVIE, 0);
            Ux_SendEvent(&UIMoviePlayObjCtrl, NVTEVT_CLOSE_PLAY_MOVIE, 0);

            //#NT#2012/10/23#Philex Lin - begin
            // enable auto power off/USB detect timer
            // enable key tone flag
            KeyScan_EnableMisc(TRUE);
            //#NT#2012/10/23#Philex Lin - end

            if (gphUIFlowMovPlay_Filehdl)
            {
                FileSys_CloseFile(gphUIFlowMovPlay_Filehdl);
                gphUIFlowMovPlay_Filehdl = NULL;
            }
            FlowPB_UpdateIcons(1);
            break;

    }

    return NVTEVT_CONSUME;
}
Example #14
0
INT32 UIFlowWndPhoto_OnOpen(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
{
    UIFlowWndPhoto_InitCfgSetting();
    FlowPhoto_InitStartupFuncs();

    /* Init window key mask variables & set key press/release/continue mask */
    gPhotoData.State = PHOTO_ST_VIEW;
    g_uiMaskKeyPress = PHOTO_KEY_PRESS_MASK;
    g_uiMaskKeyRelease = PHOTO_KEY_RELEASE_MASK;
    g_uiMaskKeyContinue = PHOTO_KEY_CONTINUE_MASK;
    Ux_FlushEventByRange(NVTEVT_KEY_EVT_START,NVTEVT_KEY_EVT_END);

    Input_SetKeyMask(KEY_PRESS, g_uiMaskKeyPress);
    Input_SetKeyMask(KEY_RELEASE, g_uiMaskKeyRelease);
    Input_SetKeyMask(KEY_CONTINUE, g_uiMaskKeyContinue);

    gPhotoData.SysTimeCount = 0;
    /* Update window info */
    FlowPhoto_UpdateIcons(TRUE);
    /* set FD/SD feature */
    FlowPhoto_SetFdSdProc(TRUE);
#if(LOW_POWER_TIMELAPSE_REC == ENABLE)

    debug_err(("rtc_isPWRAlarm() = %d =====\r\n",rtc_isPWRAlarm()));

    if(UI_GetData(FL_LOW_POWER_TIMELAPSE_REC)&& rtc_isPWRAlarm())
    {

        //UIFlowDCF_TimelapseRecUpdateName();
        //NH_FileDB_SetRootFolder("TMLPS");
        // Wait until AE/AWB are stable.
        IPC_WaitVD(FALSE,IPL_ID_1);
        IPC_WaitVD(FALSE,IPL_ID_1);
        IPC_WaitVD(FALSE,IPL_ID_1);
        // press enter key to capture
        Ux_PostEvent(NVTEVT_KEY_SHUTTER2, 1, NVTEVT_KEY_PRESS);
    }
#endif
    Ux_DefaultEvent(pCtrl,NVTEVT_OPEN_WINDOW,paramNum,paramArray);
    return NVTEVT_CONSUME;
}
Example #15
0
//#NT#2014/9/3#Philex Lin - end
INT32 UIMenuWndUSB_OnOpen(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
{
    Input_SetKeyMask(KEY_RELEASE, FLGKEY_KEY_MASK_NULL);
    //#NT#2014/9/3#Philex Lin - begin
    // add time out mechanism to back to movei mode if nothing does in usb mode
    // start timeout timer in usb mode
    if (g_uiTimeOutTimerID==NULL_TIMER)
    {
        g_uiTimeOutTimerID = GxTimer_StartTimer(TIMER_ONE_SEC, NVTEVT_1SEC_TIMER, CONTINUE);
    }
    //#NT#2014/9/3#Philex Lin - end
    Ux_DefaultEvent(pCtrl,NVTEVT_OPEN_WINDOW,paramNum,paramArray);
    return NVTEVT_CONSUME;
}
Example #16
0
INT32 UIFlowWndPhoto_OnUpdateInfo(VControl * pCtrl, UINT32 paramNum, UINT32 * paramArray)
{
    switch (pPhotoExeInfo->CallBackEvent)
    {
    case UIAPPPHOTO_CB_QVSTART:
        UIFlowWndPhoto_OnQVStart();
        break;

    case UIAPPPHOTO_CB_JPGOK:
        break;

    case UIAPPPHOTO_CB_FSTOK:
        /* Update window info */
        FlowPhoto_UpdateIcons(TRUE);

        #if(LOW_POWER_TIMELAPSE_REC == ENABLE)
        if(UI_GetData(FL_LOW_POWER_TIMELAPSE_REC)&& rtc_isPWRAlarm())
            Ux_SendEvent(&CustomPhotoObjCtrl, NVTEVT_EXE_LOWPOWER_TIMELAPSE_REC, 1, UI_GetData(FL_LOW_POWER_TIMELAPSE_REC));
        #else
        // unlock FD/SD if necessary
        FlowPhoto_SetFdSdProc(FALSE);
        #endif
        break;

    case UIAPPPHOTO_CB_CAPTUREEND:
        // unloce AE/AWB
        FlowPhoto_InitStartupFuncs();
        break;

    case UIAPPPHOTO_CB_FDEND:
        UIFlowWndPhoto_OnFdEnd();
        break;

    case UIAPPPHOTO_CB_SDEND:
        if (SysGetFlag(FL_FD) == FD_SMILE)
        {
           if ((gPhotoData.State!=PHOTO_ST_CAPTURE)&&(gPhotoData.QuickViewCount==0))
            {
                /* Enable FD frame show */
                UxCtrl_SetShow(&UIFlowWndPhoto_PNL_FDFrameCtrl,TRUE);
                UI_Show(UI_SHOW_INFO, FALSE); //FD layer
                Input_SetKeyMask(KEY_PRESS,NULL);
            }
        }
        break;
    }

    return NVTEVT_CONSUME;
}
Example #17
0
INT32 UIFlowWndPlay_OnKeyMenu(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
{
    switch(g_PlbData.State)
    {
    case PLB_ST_FULL:
        g_PlbData.State = PLB_ST_MENU;
        Input_SetKeyMask(KEY_RELEASE, FLGKEY_KEY_MASK_NULL);
        // 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);
        break;
    }
    return NVTEVT_CONSUME;
}
INT32 UIFlowWndPhoto_ReverseGear(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
{
    static UINT32 uiLastPipViewStyle = 0;
    UINT32  uiReverseGear;
    uiReverseGear = paramNum ? paramArray[0] : 0;
	
    if((uiReverseGear==TRUE)&&(bCarGuideLineMode == FALSE))
    {
        uiLastPipViewStyle = PipView_GetStyle();
        //sensor change to sensor2 TV out
        debug_msg("-----------sensoer tv out-------\r\n");
        PipView_SetStyle(PIP_STYLE_2T2F);
        GPIOMap_TurnOnLCDBacklight();
        GxCustom_SetControl(GXCUSTOM_CTRL_AUTOLCDOFF_RESET,0);
        bCarGuideLineMode  = TRUE;
        FlowPhoto_UpdateIcons(FALSE);			
        FlowPhoto_IconDrawGuideLine();
		
	if(GPIOMap_IsLCDBacklightOn()==FALSE)
	{
		GPIOMap_TurnOnLCDBacklight();
		GxCustom_SetControl(GXCUSTOM_CTRL_AUTOLCDOFF_RESET,0);
	}			
      Ux_FlushEventByRange(NVTEVT_KEY_EVT_START,NVTEVT_KEY_EVT_END);
      /* Init window key mask variables & set key and key released mask */

      Input_SetKeyMask(KEY_PRESS, FLGKEY_KEY_MASK_NULL);
      Input_SetKeyMask(KEY_RELEASE, FLGKEY_KEY_MASK_NULL);
      Input_SetKeyMask(KEY_CONTINUE, FLGKEY_KEY_MASK_NULL);			
    }
    else if((uiReverseGear==FALSE)&&(bCarGuideLineMode  == TRUE))
    {
        //PipView_SetStyle(PIP_STYLE_2T1B2S);
        PipView_SetStyle(uiLastPipViewStyle);
        bCarGuideLineMode  = FALSE; 
        FlowPhoto_UpdateIcons(TRUE);			
		
	Ux_FlushEventByRange(NVTEVT_KEY_EVT_START,NVTEVT_KEY_EVT_END);
	/* Init window key mask variables & set key and key released mask */

	Input_SetKeyMask(KEY_PRESS, FLGKEY_KEY_MASK_DEFAULT);
	Input_SetKeyMask(KEY_RELEASE, FLGKEY_KEY_MASK_DEFAULT);
	Input_SetKeyMask(KEY_CONTINUE, FLGKEY_KEY_MASK_NULL);			
    } 
}
Example #19
0
INT32 UIFlowWndPhoto_OnUpdateInfo(VControl * pCtrl, UINT32 paramNum, UINT32 * paramArray)
{

    switch (pPhotoExeInfo->CallBackEvent)
    {
       case UIAPPPHOTO_CB_QVSTART:
            UIFlowWndPhoto_OnQVStart();
        break;
       case UIAPPPHOTO_CB_JPGOK:
        break;
       case UIAPPPHOTO_CB_FSTOK:
            /* Update window info */
            FlowPhoto_UpdateIcons(TRUE);
        break;
       case UIAPPPHOTO_CB_CAPTUREEND:
            // unloce AE/AWB
            FlowPhoto_InitStartupFuncs();
        break;
       case UIAPPPHOTO_CB_FDEND:
        UIFlowWndPhoto_OnFdEnd();
        break;
       case UIAPPPHOTO_CB_SDEND:
        if (SysGetFlag(FL_FD) == FD_SMILE)
        {
           if ((gPhotoData.State!=PHOTO_ST_CAPTURE)&&(gPhotoData.QuickViewCount==0))
            {
                /* Enable FD frame show */
                UxCtrl_SetShow(&UIFlowWndPhoto_PNL_FDFrameCtrl,TRUE);
                UI_Show(UI_SHOW_INFO, FALSE); //FD layer
                Input_SetKeyMask(KEY_PRESS, FLGKEY_KEY_MASK_NULL);
            }
        }
        break;
    }

    return NVTEVT_CONSUME;
}
Example #20
0
static void UIFlowWndPhoto_OnQVStart(void)
{

    /* Set to quick review mode */
    UI_Show(UI_SHOW_QUICKVIEW, TRUE);
    switch(SysGetFlag(FL_QUICK_REVIEW))
        {
           case QUICK_REVIEW_2SEC:
             gPhotoData.QuickViewCount = 15;
            break;
           case QUICK_REVIEW_5SEC:
             gPhotoData.QuickViewCount = 45;
            break;
           case QUICK_REVIEW_0SEC:
             gPhotoData.QuickViewCount = 1;
            break;
        }
    if (g_uiQviewTimerID == NULL_TIMER)
    {
        /* Resume only S2 key while quick view timer started */
        Input_SetKeyMask(KEY_PRESS, FLGKEY_SHUTTER2);
        g_uiQviewTimerID = GxTimer_StartTimer(100, NVTEVT_01SEC_TIMER, CONTINUE);
    }
}
Example #21
0
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;
}
Example #22
0
UINT8 CalLens_FarFocusCalibration(void)
{
    INT16 maxIdx = 0;
    INT16 StartIdx,EndIdx;
    UINT  AF_Step;
    char str1[32];
    UINT32 maxVA;
    BOOL bFocusNG = FALSE;
    UINT32 StopFunc=0,StartFunc=0;
    UINT32 tempFrequency=0;
    UINT32 zoomSection;

    /************************************************************/
    debug_err(("\n\nPlease let camera facing ISO chart. Then press shutter key\r\n\n"));
    Cal_ClearOSD(_OSD_INDEX_TRANSPART);
    Cal_ShowStringWithColor("1. Face ISO chart (far(3m))",0,0,_OSD_INDEX_BLACK);
    Cal_ShowStringWithColor("2. Press shutter key",0,30,_OSD_INDEX_BLACK);
#if 0
    clr_flg(FLG_ID_KEY, FLGKEY_SHUTTER2);
    wai_flg(&uiFlag, FLG_ID_KEY, FLGKEY_SHUTTER2, TWF_ORW|TWF_CLR);
#else
    do {
        Delay_DelayMs(10);
    } while(DrvKey_DetNormalKey()!=FLGKEY_SHUTTER1);
#endif
    Cal_ClearOSD(_OSD_INDEX_TRANSPART);
    /*************************************************************/

    //tempFrequency = IPL_AlgGetUIInfo(IPL_SEL_FREQUENCY);
    //IPL_AlgSetUIInfo(IPL_SEL_FREQUENCY,SEL_FREQUENCY_50HZ);
#if 1
    StartFunc=0;
    StartFunc |=UIAPP_PHOTO_AE;
    Ux_SendEvent(&CustomPhotoObjCtrl,NVTEVT_EXE_START_FUNC,2,StartFunc ,UIAPP_PHOTO_NOWAITIDLE);

    AE_reset();
    IPC_WaitVD(TRUE,IPL_ID_1);
    IPC_WaitVD(TRUE,IPL_ID_1);
    IPC_WaitVD(TRUE,IPL_ID_1);
    IPC_WaitVD(TRUE,IPL_ID_1);
    IPC_WaitVD(TRUE,IPL_ID_1);
    AE_Wait_Stable(3,60);

    StopFunc |=UIAPP_PHOTO_AE;
    Ux_SendEvent(&CustomPhotoObjCtrl,NVTEVT_EXE_STOP_FUNC,2,StopFunc ,UIAPP_PHOTO_WAITIDLE);
#endif

    StopFunc |=UIAPP_PHOTO_AE;
    StopFunc |=UIAPP_PHOTO_AWB;
    StopFunc |=UIAPP_PHOTO_FD;
    StopFunc |=UIAPP_PHOTO_CAF;
    Ux_SendEvent(&CustomPhotoObjCtrl,NVTEVT_EXE_STOP_FUNC,2,StopFunc ,UIAPP_PHOTO_WAITIDLE);

    Input_SetKeyMask(KEY_PRESS, FLGKEY_KEY_MASK_NULL);
    Input_SetKeyMask(KEY_RELEASE, FLGKEY_KEY_MASK_NULL);
    Input_SetKeyMask(KEY_CONTINUE, FLGKEY_KEY_MASK_NULL);

    Lens_Zoom_SetPPS(300);
    Lens_Focus_SetPPS(500);

    Lens_Init(LENS_INIT_ZOOM_PART1);
    Lens_Init(LENS_INIT_ZOOM_PART2);

    if (gCalLens_Info.bFocusBLCal == FALSE)
    {
        gCalLens_Info.uiLensFocusBL = CalLens_FocusBLCalibration();
    }

    UILens_AFPrepare(TRUE);

    AF_Step=4;
    for(zoomSection=Lens_Zoom_GetSection(ZOOM_MIN_SECTION); zoomSection<=Lens_Zoom_GetSection(ZOOM_MAX_SECTION); zoomSection++)
    {
        //Lens_Focus_GotoHome();
        Lens_Zoom_GoSection(zoomSection);

#if 0
        StartFunc=0;
        StartFunc |=UIAPP_PHOTO_AE;
        Ux_SendEvent(&CustomPhotoObjCtrl,NVTEVT_EXE_START_FUNC,2,StartFunc ,UIAPP_PHOTO_NOWAITIDLE);
        AE_reset();
        IPC_WaitVD(TRUE,IPL_ID_1);
        IPC_WaitVD(TRUE,IPL_ID_1);
        IPC_WaitVD(TRUE,IPL_ID_1);
        IPC_WaitVD(TRUE,IPL_ID_1);
        IPC_WaitVD(TRUE,IPL_ID_1);
        AE_Wait_Stable(3,60);
        StopFunc |=UIAPP_PHOTO_AE;
        Ux_SendEvent(&CustomPhotoObjCtrl,NVTEVT_EXE_STOP_FUNC,2,StopFunc ,UIAPP_PHOTO_WAITIDLE);
#endif

        StartIdx = gCalLens_FocusRangeTable[zoomSection-1][0];
        if(StartIdx > Lens_Focus_GetPosition(FOCUS_MAX_POSITION))
        {
            StartIdx = Lens_Focus_GetPosition(FOCUS_MAX_POSITION);
        }
        Lens_Focus_Goto(StartIdx);

        if(CalLens_IsNearAdjust())
        {
            EndIdx = CalLens_GetNearCalCompensation(zoomSection, FALSE);
        }
        else
        {
            EndIdx = gCalLens_FocusRangeTable[zoomSection-1][1];
        }

        if(EndIdx < Lens_Focus_GetPosition(FOCUS_MIN_POSITION))
        {
            EndIdx = Lens_Focus_GetPosition(FOCUS_MIN_POSITION);
        }

        if(AF_Step > 4)
        {
            maxIdx = AF_SearchFullRange(StartIdx, EndIdx, AF_Step, &maxVA, AF_VA_THRESHOLD_70PERCENTAGE);
            maxIdx = AF_SearchFullRange(maxIdx+AF_Step-4, maxIdx-AF_Step+4, 4, &maxVA, AF_VA_THRESHOLD_70PERCENTAGE);
            maxIdx = AF_SearchFullRange(maxIdx+3, maxIdx-3, 1, &maxVA, AF_VA_THRESHOLD_70PERCENTAGE);
        }
        else
        {
            maxIdx = AF_SearchFullRange(StartIdx, EndIdx, 4, &maxVA, AF_VA_THRESHOLD_70PERCENTAGE);
            maxIdx = AF_SearchFullRange(maxIdx+8, maxIdx-8, 1, &maxVA, AF_VA_THRESHOLD_70PERCENTAGE);
        }
        debug_msg("^G%s: Section = %d, maxIdx = %d\r\n", __func__, Lens_Zoom_GetSection(ZOOM_CUR_SECTION), maxIdx);
        gCalLens_Info.Far_Focus[zoomSection-1] = maxIdx;

        if(zoomSection==1) {
            snprintf(str1, 32, "S  Step VA  ");
            Cal_ShowStringWithColor(str1,0,16*(zoomSection/2),_OSD_INDEX_GREEN);
            Cal_ShowStringWithColor(str1,100,16*(zoomSection/2),_OSD_INDEX_GREEN);
            Cal_ShowStringWithColor(str1,200,16*(zoomSection/2),_OSD_INDEX_GREEN);
            snprintf(str1, 32, "%02d %03d %d", zoomSection, gCalLens_Info.Far_Focus[zoomSection-1], maxVA);
        }
        else
            snprintf(str1, 32, "%02d %03d %d", zoomSection, gCalLens_Info.Far_Focus[zoomSection-1], maxVA);

        if(maxVA > CALLENS_VA_WARNING)
        {
            if(zoomSection % 3 == 1)
                Cal_ShowStringWithColor(str1,0,16+16*((zoomSection-1)/3),_OSD_INDEX_BLACK);
            else if(zoomSection % 3 == 2)
                Cal_ShowStringWithColor(str1,100,16+16*((zoomSection-1)/3),_OSD_INDEX_RED);
            else
                Cal_ShowStringWithColor(str1,200,16+16*((zoomSection-1)/3),_OSD_INDEX_BLACK);
        }
        else
        {
            if(zoomSection % 3 == 1)
                Cal_ShowStringWithColor(str1,0,16+16*((zoomSection-1)/3),_OSD_INDEX_DARKGRAY);
            else if(zoomSection % 3 == 2)
                Cal_ShowStringWithColor(str1,100,16+16*((zoomSection-1)/3),_OSD_INDEX_DARKGRAY);
            else
                Cal_ShowStringWithColor(str1,200,16+16*((zoomSection-1)/3),_OSD_INDEX_DARKGRAY);

            if(maxVA < CALLENS_VA_NG)
            {
                bFocusNG =TRUE;
                Delay_DelayMs(2000);
                break;
            }
        }
    }

    for(zoomSection=Lens_Zoom_GetSection(ZOOM_MIN_SECTION); zoomSection<=Lens_Zoom_GetSection(ZOOM_MAX_SECTION); zoomSection++)
    {
        debug_msg("^G%s: gCalLens_Info.Far_Focus[%d] = %d\r\n", __func__,zoomSection-1 , gCalLens_Info.Far_Focus[zoomSection-1]);
    }

    gCalLens_Info.bFarAdjust = TRUE;
    if(CalLens_IsNearAdjust()) {
        for(zoomSection=1; zoomSection<=Lens_Zoom_GetSection(ZOOM_MAX_SECTION); zoomSection++)
        {
            if(CalLens_GetFarFocusCalStep(zoomSection) < CalLens_GetNearFocusCalStep(zoomSection))
                bFocusNG = TRUE;

            if(bFocusNG)
                debug_msg("^RZoom=%2d FarFocusStep=%3d < NearFocusStep=%3d\r\n",zoomSection,CalLens_GetFarFocusCalStep(zoomSection),CalLens_GetNearFocusCalStep(zoomSection));
            else
                debug_msg("^GZoom=%2d FarFocusStep=%3d > NearFocusStep=%3d\r\n",zoomSection,CalLens_GetFarFocusCalStep(zoomSection),CalLens_GetNearFocusCalStep(zoomSection));
        }
    }
    if(bFocusNG)
        gCalLens_Info.bFarAdjust = FALSE;

    UILens_AFPrepare(FALSE);

    CalLens_WriteCalData();
    Input_SetKeyMask(KEY_PRESS, FLGKEY_KEY_MASK_DEFAULT);
    Input_SetKeyMask(KEY_RELEASE, FLGKEY_KEY_MASK_DEFAULT);
    Input_SetKeyMask(KEY_CONTINUE, FLGKEY_KEY_MASK_DEFAULT);

    IPL_AlgSetUIInfo(IPL_SEL_FREQUENCY,tempFrequency);

    StartFunc = 0;
    StartFunc |=UIAPP_PHOTO_AE;
    StartFunc |=UIAPP_PHOTO_AWB;
    Ux_SendEvent(&CustomPhotoObjCtrl,NVTEVT_EXE_START_FUNC,2,StartFunc ,UIAPP_PHOTO_NOWAITIDLE);

    Lens_Retract(0);
    Delay_DelayMs(1000);

    /************************************************************/
    Cal_ClearOSD(_OSD_INDEX_TRANSPART);
    if(bFocusNG)
        Cal_ShowStringWithColor("1. Adjust NG (far(3m))",0,0,_OSD_INDEX_DARKGRAY);
    else
        Cal_ShowStringWithColor("1. Adjust done (far(3m))",0,0,_OSD_INDEX_BLACK);
    Cal_ShowStringWithColor("2. Press menu key to leave",0,30,_OSD_INDEX_BLACK);
#if 0
    clr_flg(FLG_ID_KEY, FLGKEY_ENTER);
    wai_flg(&uiFlag, FLG_ID_KEY, FLGKEY_ENTER, TWF_ORW|TWF_CLR);
#else
    do {
        Delay_DelayMs(10);
    } while(DrvKey_DetNormalKey()!=FLGKEY_MENU);
    do {
        Delay_DelayMs(10);
    } while(DrvKey_DetNormalKey()==FLGKEY_MENU);
    Ux_FlushEvent();
#endif
    /*************************************************************/
    return CALLENS_STA_OK;
}
Example #23
0
INT32 UIFlowWndPhoto_OnTimer(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
{
 NVTEVT event;


    if(paramNum > 0)
    {
       event = paramArray[0];
    } else {
       return NVTEVT_CONSUME;
    }
    switch(event)
    {
      case NVTEVT_01SEC_TIMER:
        if (gPhotoData.QuickViewCount !=0)
        {
            gPhotoData.QuickViewCount--;
            if (gPhotoData.QuickViewCount == 0)
            {
                if (g_uiQviewTimerID != NULL_TIMER)
                {
                    GxTimer_StopTimer(&g_uiQviewTimerID);
                }

                /* reset state to PHOTO_ST_VIEW */
                gPhotoData.State = PHOTO_ST_VIEW;

                /* set FD/SD feature */
                FlowPhoto_SetFdSdProc(FALSE);

                /* Set to preview mode */
                UI_Show(UI_SHOW_PREVIEW, TRUE);

                /* close quick view image */
                UI_Show(UI_SHOW_QUICKVIEW, FALSE);

                /* Update window info */
                //FlowPhoto_UpdateIcons(TRUE);

                /* Resume key after normal capture completed */
                Input_SetKeyMask(KEY_PRESS, g_uiMaskKeyPress);

                Ux_FlushEventByRange(NVTEVT_KEY_EVT_START,NVTEVT_KEY_EVT_END);

                /* set DirID/FileID */
                {
                 UINT32 uhFilesysDirNum, uhFilesysFileNum;

                    DCF_GetNextID(&uhFilesysDirNum, &uhFilesysFileNum);
                    SysSetFlag(FL_DCF_DIR_ID, uhFilesysDirNum);
                    SysSetFlag(FL_DCF_FILE_ID, uhFilesysFileNum);
                }
            }
        }

        if (gPhotoData.SelfTimerCount != 0)
        {
            gPhotoData.SelfTimerCount--;
            if (gPhotoData.SelfTimerCount == 0)
            {
                if (g_uiSelfTimerID != NULL_TIMER)
                {
                    GxTimer_StopTimer(&g_uiSelfTimerID);
                }

                // stopping LED toggle
                //KeyScan_EnableLEDToggle(KEYSCAN_LED_GREEN, FALSE);
            }
            FlowPhoto_OnTimer01SecIndex();
        }
        break;
    }
    return NVTEVT_CONSUME;
}
Example #24
0
INT32 UIFlowWndPhoto_OnChildClose(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
{
    UINT32  uiSoundMask;

    /* Set key mask to self-original state */
    Ux_FlushEventByRange(NVTEVT_KEY_EVT_START,NVTEVT_KEY_EVT_END);
    Input_SetKeyMask(KEY_PRESS, g_uiMaskKeyPress);
    Input_SetKeyMask(KEY_RELEASE, g_uiMaskKeyRelease);
    Input_SetKeyMask(KEY_CONTINUE, g_uiMaskKeyContinue);

    switch (gPhotoData.State)
    {
      case PHOTO_ST_WARNING_MENU:
            if(paramNum > 0)
            {
                if(paramArray[0] == NVTRET_ENTER_MENU)
                {
                    /* Force to lock FD/SD functions before opening Menu */
                    FlowPhoto_ForceLockFdSd();
                    /* Create Menu window */
                    gPhotoData.State = PHOTO_ST_MENU;
                    TM_SetMenu(&gPhotoMenu);
                    Ux_OpenWindow(&MenuCommonItemCtrl, 0);
                    return NVTEVT_CONSUME;
                }
            }
            gPhotoData.State = PHOTO_ST_VIEW;
        break;

      case PHOTO_ST_MENU:
            // disable shutter2 sound
            uiSoundMask = Input_GetKeySoundMask(KEY_PRESS);
            uiSoundMask &= ~FLGKEY_SHUTTER2;
            Input_SetKeySoundMask(KEY_PRESS, uiSoundMask);

            gPhotoData.State = PHOTO_ST_VIEW;
            // set image ratio here
            UIFlowWndPhoto_OnExeSetImageRatio();

            // unloce AE/AWB
            FlowPhoto_InitStartupFuncs();

            /* Set to preview mode */
            UI_Show(UI_SHOW_PREVIEW, TRUE);

            /* close quick view image */
            UI_Show(UI_SHOW_QUICKVIEW, FALSE);

            /* Resume key after normal capture completed */
            Input_SetKeyMask(KEY_PRESS, g_uiMaskKeyPress);

            /* Set FD/SD functions againg after exiting Menu */
            FlowPhoto_SetFdSdProc(TRUE);
            /* Update window info */
            FlowPhoto_UpdateIcons(TRUE);
        break;
    }

    Ux_DefaultEvent(pCtrl,NVTEVT_CHILD_CLOSE,paramNum,paramArray);
    return NVTEVT_CONSUME;
}
Example #25
0
UINT32 CalLens_FocusStepMissTest(void)
{
    UINT32 i;
    CHAR str[32];
    extern UINT32 focusHomeDiff;
    extern UINT32 zoomHomeDiff;
    UINT32 StopFunc=0,StartFunc=0;

    /************************************************************/
    debug_err(("\n\nRunning FocusMiss Test,Please wait..\r\n\n"));
    Cal_ClearOSD(_OSD_INDEX_TRANSPART);
    Cal_ShowStringWithColor("1. Run Focus Miss Test...",0,0,_OSD_INDEX_BLACK);
    Cal_ShowStringWithColor("2. Press shutter key",0,30,_OSD_INDEX_BLACK);
#if 0
    clr_flg(FLG_ID_KEY, FLGKEY_SHUTTER2);
    wai_flg(&uiFlag, FLG_ID_KEY, FLGKEY_SHUTTER2, TWF_ORW|TWF_CLR);
#else
    do {
        Delay_DelayMs(10);
    } while(DrvKey_DetNormalKey()!=FLGKEY_SHUTTER1);
#endif
    Cal_ClearOSD(_OSD_INDEX_TRANSPART);
    /*************************************************************/

    StopFunc |=UIAPP_PHOTO_AE;
    StopFunc |=UIAPP_PHOTO_AWB;
    StopFunc |=UIAPP_PHOTO_FD;
    StopFunc |=UIAPP_PHOTO_CAF;
    Ux_SendEvent(&CustomPhotoObjCtrl,NVTEVT_EXE_STOP_FUNC,2,StopFunc ,UIAPP_PHOTO_WAITIDLE);

    Input_SetKeyMask(KEY_PRESS, FLGKEY_KEY_MASK_NULL);
    Input_SetKeyMask(KEY_RELEASE, FLGKEY_KEY_MASK_NULL);
    Input_SetKeyMask(KEY_CONTINUE, FLGKEY_KEY_MASK_NULL);

    Cal_ClearOSD(_OSD_INDEX_TRANSPART);
    Cal_ShowStringWithColor("1.Running Focus Miss Test...",0,0,_OSD_INDEX_BLACK);

    Lens_Zoom_SetPPS(300);
    Lens_Focus_SetPPS(500);

    Lens_Retract(0);
    Delay_DelayMs(500);
    Lens_Init(LENS_INIT_ZOOM_PART1);
    Lens_Init(LENS_INIT_ZOOM_PART2);

    for(i=0; i<2; i++)
    {
        lensDY5001A_test();

        UILens_WaitZoomFinish();

        Delay_DelayMs(500);
    }

    Lens_Retract(1);
    Delay_DelayMs(500);
    Lens_Init(LENS_INIT_ZOOM_PART1);
    Lens_Init(LENS_INIT_ZOOM_PART2);

    StartFunc = 0;
    StartFunc |=UIAPP_PHOTO_AE;
    StartFunc |=UIAPP_PHOTO_AWB;
    Ux_SendEvent(&CustomPhotoObjCtrl,NVTEVT_EXE_START_FUNC,2,StartFunc ,UIAPP_PHOTO_NOWAITIDLE);

    snprintf(str, 32, "2. Diff Zoom(%d),Focus(%d)", zoomHomeDiff, focusHomeDiff);
    Cal_ShowStringWithColor(str,0,30,_OSD_INDEX_BLACK);
    Cal_ShowStringWithColor("3. Press menu key to leave",0,60,_OSD_INDEX_BLACK);

    //CalLens_WaitKey(FLGKEY_MENU);
    do {
        Delay_DelayMs(10);
    } while(DrvKey_DetNormalKey()!=FLGKEY_MENU);
    do {
        Delay_DelayMs(10);
    } while(DrvKey_DetNormalKey()==FLGKEY_MENU);
    Delay_DelayMs(100);
    Ux_FlushEvent();
    Input_SetKeyMask(KEY_PRESS, FLGKEY_KEY_MASK_DEFAULT);
    Input_SetKeyMask(KEY_RELEASE, FLGKEY_KEY_MASK_DEFAULT);
    Input_SetKeyMask(KEY_CONTINUE, FLGKEY_KEY_MASK_DEFAULT);

    return 0;
}
Example #26
0
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;
}
Example #27
0
INT32 UIFlowWndPlay_OnKeyMenu(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
{
    switch(g_PlbData.State)
    {
    case PLB_ST_FULL:
        g_PlbData.State = PLB_ST_MENU;
        Input_SetKeyMask(KEY_RELEASE, FLGKEY_KEY_MASK_NULL);
        // 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);
        break;
#if(_MODEL_DSC_== _MODEL_DUAL_NAZHIDA_)
    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
	g_PlbData.State        = PLB_ST_FULL;
	g_PlbData.VideoPBSpeed = PLB_FWD_MOV_1x;
	UIFlowMoviePlay_SetSpeed(g_PlbData.VideoPBSpeed);
	g_uiUIFlowWndPlayCurrenDirection = MEDIAPLAY_DIR_FORWARD;

	Ux_SendEvent(&UIMoviePlayObjCtrl, NVTEVT_PAUSE_PLAY_MOVIE, 0);
	Ux_SendEvent(&UIMoviePlayObjCtrl, NVTEVT_CLOSE_PLAY_MOVIE, 0);

	//#NT#2012/10/23#Philex Lin - begin
	// enable auto power off/USB detect timer
	// enable key tone flag
	KeyScan_EnableMisc(TRUE);
	//#NT#2012/10/23#Philex Lin - end

	// stop scan
	//if (SxTimer_GetFuncActive(SX_TIMER_DET_STRG_ID)==0)
	//        SxTimer_SetFuncActive(SX_TIMER_DET_STRG_ID, TRUE);

	if (SxTimer_GetFuncActive(SX_TIMER_DET_SYSTEM_BUSY_ID)==0)
	SxTimer_SetFuncActive(SX_TIMER_DET_SYSTEM_BUSY_ID, TRUE);


	if (gphUIFlowMovPlay_Filehdl)
	{
	FileSys_CloseFile(gphUIFlowMovPlay_Filehdl);
	gphUIFlowMovPlay_Filehdl = NULL;
	}

	// Play 1st video frame image
	Ux_SendEvent(&UIPlayObjCtrl,NVTEVT_PLAYSINGLE, 1, PB_SINGLE_CURR);
	//#NT#2012/08/31#Calvin Chang -end
	g_PlbData.State = PLB_ST_MENU;
	Input_SetKeyMask(KEY_RELEASE, FLGKEY_KEY_MASK_NULL);
	// 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);			
       break;		
#endif		
    }
    return NVTEVT_CONSUME;
}
Example #28
0
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;
}
Example #29
0
INT32 UIFlowWndPhoto_OnKeyUp(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
{
#if(_MODEL_DSC_== _MODEL_DUAL_NAZHIDA_)
#elif(_MODEL_DSC_ == _MODEL_DUAL_AONI328_)//vincent@20150909-3
    UINT32  uiKeyAct;
    uiKeyAct = paramArray[0];
    static BOOL zoom_IN_or_OUT = TRUE;
    switch(uiKeyAct)
    {
        //case KEYSCAN_KEYMODE_CONTINUE:
        case NVTEVT_KEY_PRESS:
        //case FLGKEY_HOLD:
            Input_SetKeyMask(KEY_PRESS, FLGKEY_KEY_MASK_NULL);
            if(zoom_IN_or_OUT == TRUE)
            {
               /* set Digital Zoom interface */
               UI_SetData(FL_ZoomIFIndex,ZOOM_IF_DIGITAL);
               /*
                            * Suspend all keys while keep ZoomIn pressed.
                            * Gotta resume them after ZoomIn key released.
                            */
               //Input_SetKeyMask(KEY_PRESS, FLGKEY_KEY_MASK_NULL);
               FlowPhoto_ForceLockFdSd();
               gPhotoData.State |= PHOTO_ST_ZOOM;
               Ux_SendEvent(&CustomPhotoObjCtrl,NVTEVT_EXE_ZOOM,2, UI_ZOOM_CTRL_IN,UI_GetData(FL_Dzoom));
            }

            if(zoom_IN_or_OUT == FALSE)
            { 
               /* set Digital Zoom interface */
               UI_SetData(FL_ZoomIFIndex,ZOOM_IF_DIGITAL);
               /*
                            * Suspend all keys while keep ZoomIn pressed.
                            * Gotta resume them after ZoomIn key released.
                            */
               //Input_SetKeyMask(KEY_PRESS, FLGKEY_KEY_MASK_NULL);
               FlowPhoto_ForceLockFdSd();
               gPhotoData.State |= PHOTO_ST_ZOOM;
               Ux_SendEvent(&CustomPhotoObjCtrl,NVTEVT_EXE_ZOOM,2, UI_ZOOM_CTRL_OUT,UI_GetData(FL_Dzoom)); 
            }
            break;

        case NVTEVT_KEY_RELEASE:
            Ux_SendEvent(&CustomPhotoObjCtrl,NVTEVT_EXE_ZOOM,2, UI_ZOOM_CTRL_STOP, UI_GetData(FL_Dzoom));
             gPhotoData.State &= ~PHOTO_ST_ZOOM;
             FlowPhoto_SetFdSdProc(FlowPhoto_GetSDStatus());
             /* Resume keys after ZoomIn released */
             Input_SetKeyMask(KEY_PRESS, g_uiMaskKeyPress);

            if (DZOOM_IDX_GET() >= DZOOM_IDX_MAX())
            {
                zoom_IN_or_OUT = FALSE;
            }

            if (DZOOM_IDX_GET() <= DZOOM_IDX_MIN())
            {
                zoom_IN_or_OUT = TRUE;
            }
        break;

    }
#else
    return UIFlowWndPhoto_OnExeZoomIn(pCtrl, paramNum, paramArray);
#endif
}
Example #30
0
static INT32 UIFlowWndPhoto_OnExeCapture(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
{
    UINT32 uiEvtKeyAct = 0;

    if(paramNum > 0)
        uiEvtKeyAct = paramArray[0];

    switch(uiEvtKeyAct)
    {
        case NVTEVT_KEY_PRESS:
        {
            switch (gPhotoData.State)
            {
              case PHOTO_ST_VIEW:
                /* Check if in quick review process */
                if(SysGetFlag(FL_QUICK_REVIEW) != QUICK_REVIEW_0SEC)
                {
                    if(g_uiQviewTimerID != NULL_TIMER)
                    {
                        GxTimer_StopTimer(&g_uiQviewTimerID);
                        //g_bQviewTimerStart = FALSE;

                        // unloce AE/AWB
                        FlowPhoto_InitStartupFuncs();

                        /* Set to preview mode */
                        UI_Show(UI_SHOW_PREVIEW, TRUE);

                        /* close quick view image */
                        UI_Show(UI_SHOW_QUICKVIEW, FALSE);

                        /* Resume key after quick view completed */
                        Input_SetKeyMask(KEY_PRESS, g_uiMaskKeyPress);
                        Ux_FlushEventByRange(NVTEVT_KEY_EVT_START,NVTEVT_KEY_EVT_END);

                        /* Update window info */
                        FlowPhoto_UpdateIcons(TRUE);
                        return NVTEVT_CONSUME;
                    }
                }

                /* Check capture prerequisite */
                if(FlowPhoto_IsStorageErr() == TRUE)
                {
                    debug_err(("UIFlowWndPhoto_OnKeyShutter2: Card or memory full!\r\n"));
                    gPhotoData.State= PHOTO_ST_WARNING_MENU;
                    return NVTEVT_CONSUME;
                }
                if (GetBatteryLevel() == BATTERY_EXHAUSTED)
                {
                    debug_err(("UIFlowWndPhoto_OnKeyShutter2: Battery is too low!\r\n"));
                    return NVTEVT_CONSUME;
                }

                // check free pic number
                if (SysGetFlag(FL_CONTINUE_SHOT) == CONTINUE_SHOT_ON) {
                    if(FlowPhoto_GetFreePicNum() < 2)
                    {
                        UINT32 uiMsg = 0;

                        #if (_DUAL_CARD_FUNC_ == ENABLE)
                        uiMsg = ((UI_GetData(FL_CardStatus) == CARD_REMOVED) && (UI_GetData(FL_Card2Status) == CARD_REMOVED))? UIFlowWndWrnMsg_StatusTXT_Msg_STRID_PLEASE_INSERT_SD : UIFlowWndWrnMsg_StatusTXT_Msg_STRID_CARD_FULL;
                        #else
                        uiMsg = (UI_GetData(FL_CardStatus) == CARD_REMOVED)? UIFlowWndWrnMsg_StatusTXT_Msg_STRID_PLEASE_INSERT_SD : UIFlowWndWrnMsg_StatusTXT_Msg_STRID_CARD_FULL;
                        #endif
                        gPhotoData.State= PHOTO_ST_WARNING_MENU;
                        Ux_OpenWindow(&UIFlowWndWrnMsgCtrl,2,uiMsg,FLOWWRNMSG_TIMER_2SEC);
                        return NVTEVT_CONSUME;
                    }
                }

                switch (SysGetFlag(FL_SELFTIMER))          // set capture mode by system flag
                {
                case SELFTIMER_2SEC:
                    /* Suspend all keys, except S2 key while selftimer started */
                    Input_SetKeyMask(KEY_PRESS, FLGKEY_ENTER);
                    FlowPhoto_IconDrawSelftimerTime(&UIFlowWndPhoto_StaticTXT_SelftimerCntCtrl,2);
                    gPhotoData.SelfTimerCount = 20;              // set time counter
                    gPhotoData.State = PHOTO_ST_SELFTIMER;  // set working state to self-timer state
                    //KeyScan_EnableLEDToggle(KEYSCAN_LED_GREEN, TRUE);
                    UISound_Play(DEMOSOUND_SOUND_KEY_TONE);
                    if (g_uiSelfTimerID == NULL_TIMER)
                    {
                        g_uiSelfTimerID = GxTimer_StartTimer(100, NVTEVT_01SEC_TIMER, CONTINUE);
                    }
                    break;
                case SELFTIMER_5SEC:
                    /* Suspend all keys, except S2 key while selftimer started */
                    Input_SetKeyMask(KEY_PRESS, FLGKEY_ENTER);
                    FlowPhoto_IconDrawSelftimerTime(&UIFlowWndPhoto_StaticTXT_SelftimerCntCtrl,5);
                    gPhotoData.SelfTimerCount = 50;         // set time counter
                    gPhotoData.State = PHOTO_ST_SELFTIMER;  // set working state to self-timer state
                    //KeyScan_EnableLEDToggle(KEYSCAN_LED_GREEN, TRUE);
                    UISound_Play(DEMOSOUND_SOUND_KEY_TONE);
                    if (g_uiSelfTimerID == NULL_TIMER)
                    {
                        g_uiSelfTimerID = GxTimer_StartTimer(100, NVTEVT_01SEC_TIMER, CONTINUE);
                    }
                    break;
                case SELFTIMER_10SEC:
                    /* Suspend all keys, except S2 key while selftimer started */
                    Input_SetKeyMask(KEY_PRESS, FLGKEY_ENTER);
                    FlowPhoto_IconDrawSelftimerTime(&UIFlowWndPhoto_StaticTXT_SelftimerCntCtrl,10);
                    gPhotoData.SelfTimerCount = 100;        // set time counter
                    gPhotoData.State = PHOTO_ST_SELFTIMER;  // set working state to self-timer state
                    //#NT#2012/8/1#Philex - begin
                    //KeyScan_EnableLEDToggle(KEYSCAN_LED_GREEN, TRUE);
                    UISound_Play(DEMOSOUND_SOUND_KEY_TONE);
                    //#NT#2012/8/1#Philex - begin
                    if (g_uiSelfTimerID == NULL_TIMER)
                    {
                        g_uiSelfTimerID = GxTimer_StartTimer(100, NVTEVT_01SEC_TIMER, CONTINUE);
                    }
                    break;
                default:
                    /* Suspend all keys before sending capture command */
                    Input_SetKeyMask(KEY_PRESS, FLGKEY_KEY_MASK_NULL);
                    Ux_FlushEventByRange(NVTEVT_KEY_EVT_START,NVTEVT_KEY_EVT_END);

                    /* Clear the whole OSD screen */
                    UxCtrl_SetAllChildShow(pCtrl,FALSE);

                    gPhotoData.State = PHOTO_ST_CAPTURE;    // enter capture state
                    FlowPhoto_DoCapture();                  // do capture directly
                    break;
                 }
                break;
                case PHOTO_ST_SELFTIMER:
                     gPhotoData.State = PHOTO_ST_VIEW;
                     gPhotoData.SelfTimerCount = 0;
                     //KeyScan_EnableLEDToggle(KEYSCAN_LED_GREEN, FALSE);
                     FlowPhoto_IconHideSelftimer(&UIFlowWndPhoto_StaticTXT_SelftimerCntCtrl);
                     // resume press mask to default
                     Input_SetKeyMask(KEY_PRESS, g_uiMaskKeyPress);
                    break;
            }
            break;
        }

        case NVTEVT_KEY_RELEASE:
        {
            //Rsvd
            break;
        }

        default:
            debug_err(("UIFlowWndPhoto_OnKeyShutter2: Unknown evt 0x%x\r\n", uiEvtKeyAct));
            break;
    }
    return NVTEVT_CONSUME;
}