按键
1 INT32 UIFlowWndMovie_OnKeyMenu(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray) 2 { 3 UINT32 uiKeyAct; 4 UINT32 uiSoundMask; 5 6 __FUNC_TRACK__; 7 __MENU_TRACK__; 8 9 // uiKeyAct = paramArray[0]; 10 uiKeyAct = paramNum ? paramArray[0] : 0; //paramNum = 1; 11 12 /////////////////////////////////////////////////////////// 13 #if (_WATCH_DOG_FUNC_ == ENABLE) 14 15 #if 0 //watch dog test ÑéÖ¤watchdogÊÇ·ñÆð×÷Óᣠ16 17 UINT32 watch_time =0; 18 UINT32 watchdog_buf[10]; 19 20 while(1) 21 { 22 watch_time ++; 23 //debug_msg("watch_time =%d---\r\n",watch_time); 24 watchdog_buf[watch_time] = watch_time; 25 // debug_msg("watch dog test while(1) watchdog_buf[%d] =%d \r\n",watch_time,watchdog_buf[watch_time]); 26 //SwTimer_DelayMs(100); 27 } 28 29 return NVTEVT_CONSUME; 30 #endif 31 32 #endif 33 //////////////////////////////////////////////// 34 35 if(TRUE == ignor_menu_press_movie) { 36 __FUNC_TRACK__; 37 ignor_menu_press_movie = FALSE; 38 return NVTEVT_CONSUME; 39 } 40 41 switch (uiKeyAct) 42 { 43 //case NVTEVT_KEY_PRESS: 44 case NVTEVT_KEY_RELEASE: 45 46 if(TRUE == IsKeyBackOnLCDBacklight()){ 47 ResetScreenSaveTime(); 48 break; 49 } 50 51 #if 0 52 if(FALSE == bGsensorDataShow) { 53 54 __FUNC_TRACK__; 55 if(TRUE == GetLongShutter1KeyFlag()) { 56 57 __FUNC_TRACK__; 58 bGsensorDataShow = TRUE; 59 bGpsDataShow = FALSE ; 60 return NVTEVT_CONSUME; 61 } 62 } 63 #endif 64 65 switch(gMovData.State) 66 { 67 case MOV_ST_VIEW: 68 case MOV_ST_VIEW|MOV_ST_ZOOM: 69 // stope timer when entering menu 70 if (gUIMotionDetTimerID != NULL_TIMER) 71 { 72 GxTimer_StopTimer(&gUIMotionDetTimerID); 73 } 74 75 if (g_uiDateTimerID != NULL_TIMER) 76 { 77 GxTimer_StopTimer(&g_uiDateTimerID); 78 } 79 80 #if 0 81 // enable shutter2 sound (shutter2 as OK key in menu) 82 uiSoundMask = Input_GetKeySoundMask(KEY_PRESS); 83 uiSoundMask |= FLGKEY_ENTER; 84 Input_SetKeySoundMask(KEY_PRESS, uiSoundMask); 85 86 Input_SetKeyMask(KEY_RELEASE, FLGKEY_KEY_MASK_NULL); 87 #endif 88 89 90 SetRecEnterMenu( TRUE ); 91 92 if(LED_IsLEDOn(GPIOMAP_LED_GREEN) == TRUE) 93 LED_TurnOffLED(GPIOMAP_LED_GREEN); 94 95 #if(EAE_LOGO == ENABLE) 96 __FUNC_TRACK__; 97 Input_SetKeyMask(KEY_RELEASE, FLGKEY_KEY_MASK_NULL); 98 // Set Tab menu to Photo menu 99 TM_SetMenu(&gMovieMenu); 100 // Open common mix (Item + Option) menu 101 Ux_OpenWindow((VControl *)(&UIMenuChoiceViewWndX1Ctrl), 0); 102 gMovData.State = MOV_ST_MENU; 103 #else 104 // Open common mix (Item + Option) menu 105 Ux_OpenWindow((VControl *)(&MenuCommonItemCtrl), 0); 106 gMovData.State = MOV_ST_MENU; 107 #endif 108 break; 109 110 111 //case MOV_ST_REC: 112 //case MOV_ST_REC|MOV_ST_ZOOM: 113 114 //Ux_OpenWindow(&UIFlowWndWrnMsgCtrl, 2, UIFlowWndWrnMsg_StatusTXT_Msg_STRID_MENU_REC, FLOWWRNMSG_TIMER_3SEC); 115 //Show msg. 116 //break; 117 118 case MOV_ST_REC: 119 case MOV_ST_REC|MOV_ST_ZOOM: 120 #if(EAE_LOGO==DISABLE) 121 { 122 123 UINT32 uiJpegWidth, uiJpegHeight, uiDAR, uiMovieSize; 124 125 FlowMovie_DrawPIM(TRUE); 126 127 __FUNC_TRACK__; 128 { 129 uiMovieSize = UI_GetData(FL_MOVIE_SIZE); 130 uiJpegWidth = GetMovieSizeWidth(uiMovieSize); 131 uiJpegHeight = GetMovieSizeHeight(uiMovieSize); 132 uiDAR = GetMovieDispAspectRatio(uiMovieSize); 133 } 134 135 __FUNC_TRACK__; 136 if (uiDAR == VIDENC_DAR_16_9) 137 { 138 uiJpegWidth = (uiJpegHeight * 16) / 9; 139 } 140 141 GxSound_Stop(); 142 UISound_Play(DEMOSOUND_SOUND_SHUTTER_TONE); //scola for pic sound 143 144 __FUNC_TRACK__; 145 Ux_SendEvent(&CustomMovieObjCtrl, NVTEVT_EXE_MOVIE_REC_RAWENC, 2, uiJpegWidth, uiJpegHeight); 146 147 if(focusing_flag) { 148 149 capeture_num++; 150 151 __FUNC_TRACK__; 152 153 //×¥ÅÄÁ½ÕÅÏàƬºó Ö±½Ó½øÈëUSB Á¬½ÓµçÄÔ 154 if(capeture_num >= 2) { 155 156 __FUNC_TRACK__; 157 158 Ux_PostEvent(NVTEVT_SYSTEM_MODE, 1, PRIMARY_MODE_USBMSDC); 159 } 160 } 161 162 start_capeture_pic = 1; 163 } 164 #endif 165 break; 166 } 167 break; 168 } 169 170 //Ux_DefaultEvent(pCtrl,NVTEVT_KEY_MENU,paramNum,paramArray); 171 return NVTEVT_CONSUME; 172 }
1 INT32 System_UserKeyFilter(NVTEVT evt, UINT32 paramNum, UINT32 *paramArray) 2 { 3 UINT32 key = evt; 4 if(IN_RANGE_EVENT(key, NVTEVT_KEY_STATUS_START, NVTEVT_KEY_STATUS_END)) //Status class 5 { 6 System_ResetDetCloseLenCount(); 7 System_ResetPowerSaveCount(); 8 #if (STATUSKEY_FUNCTION == ENABLE)//is Enabled 9 DBG_IND("^Bgroup key event=0x%x\r\n", key); 10 11 if(g_bConsumeStatus) 12 { 13 g_bConsumeStatus = 0; 14 } 15 else 16 { 17 UINT32 uiDscMode = Input_Key2Mode(key); 18 DBG_IND("^YDscMode=0x%x\r\n", uiDscMode); 19 //FlowMode_OnKeyMode(uiDscMode); 20 UI_Switch_DscMode(uiDscMode,DSCMODE_SWITCH_FORCE,DSCMODE_SWITCHDIR_DONT_CARE); 21 } 22 #endif 23 __FUNC_TRACK__; 24 return NVTEVT_CONSUME; 25 } 26 else if(IN_RANGE_EVENT(key, NVTEVT_KEY_BUTTON_START, NVTEVT_KEY_BUTTON_END)) //Button class 27 { 28 if(IN_RANGE_EVENT(key, NVTEVT_KEY_PRESS_START, NVTEVT_KEY_PRESS_END)) //Press key 29 { 30 31 ReloadScreenSaveTime(); //scola 32 33 if(key == NVTEVT_KEY_POWER) 34 { 35 __FUNC_TRACK__; 36 return NVTEVT_CONSUME; 37 } 38 39 System_ResetDetCloseLenCount(); 40 if(GxPower_GetControl(GXPWR_CTRL_SLEEP_LEVEL) > 1) // drop key if sleep level > 1 41 { 42 //NOTE! do not set GXPWR_CTRL_SLEEP_RESET before get GXPWR_CTRL_SLEEP_LEVEL, 43 // because GXPWR_CTRL_SLEEP_LEVEL status maybe alter by sleep wakeup flow~ 44 System_ResetPowerSaveCount(); 45 __FUNC_TRACK__; 46 return NVTEVT_CONSUME; 47 } 48 else 49 { 50 System_ResetPowerSaveCount(); 51 if (m_uiAnyKeyUnlockEn) 52 { 53 Ux_PostEvent(NVTEVT_KEY_PRESS_START, 1, key); 54 __FUNC_TRACK__; 55 return NVTEVT_CONSUME; 56 } 57 __FUNC_TRACK__; 58 return NVTEVT_PASS; 59 } 60 } 61 else if(IN_RANGE_EVENT(key, NVTEVT_KEY_CONTINUE_START, NVTEVT_KEY_CONTINUE_END)) //Contine key 62 { 63 64 ReloadScreenSaveTime(); //scola 65 66 switch(key) { 67 68 //case NVTEVT_KEY_CUSTOM1_CONT: 69 case NVTEVT_KEY_POWER_CONT: 70 71 72 CheckSetLongKeyFlag();//++ 73 { 74 __FUNC_TRACK__; 75 if( Input_GetLongKeyFlag() ) 76 { 77 __FUNC_TRACK__; 78 //if(FALSE == MovRec_IsRecording()) 79 { 80 81 //²»ÐèÒª¼ì²â°´¼ü¹Ø±ÕÖ®ºó£¬USB½ÓÈëÖØÆô 82 PowerOffCheckUSB = TRUE; 83 __POWEROFF_TRACK__; 84 85 86 System_PowerOff(SYS_POWEROFF_NORMAL); 87 return NVTEVT_CONSUME; 88 } 89 } 90 } 91 break; 92 #if(EAE_LOGO==ENABLE) 93 case NVTEVT_KEY_SHUTTER1_CONT: 94 #else 95 case NVTEVT_KEY_MENU_CONT: 96 #endif 97 CheckSetLongKeyFlag();//++ 98 { 99 __FUNC_TRACK__; 100 if( Input_GetLongKeyFlag() ) 101 { 102 __FUNC_TRACK__; 103 104 if(key == NVTEVT_KEY_MENU_CONT ) 105 ignor_menu_press_movie = TRUE; 106 107 if((UI_GetData(FL_MOVIE_AUTO_PARKING_MODE) != 0)&&(SysGetFlag(FL_MOVIE_TIMELAPSE_REC)==MOVIE_TIMELAPSEREC_OFF)&&(System_GetState(SYS_STATE_CURRMODE) == PRIMARY_MODE_MOVIE)) 108 //if(UI_GetData(FL_MOVIE_AUTO_PARKING_MODE) != 0) 109 { 110 if(get_parking_mode_flag()) 111 app_exit_eae_parking_mode(); 112 else 113 app_enter_eae_parking_mode(); 114 } 115 } 116 } 117 break; 118 #if 0 119 case NVTEVT_KEY_SHUTTER1_CONT: 120 121 CheckSetLongKeyFlag();//++ 122 if(FALSE == get_ignore_mode_press()) 123 { 124 __FUNC_TRACK__; 125 if(Input_GetLongKeyFlag() && (FALSE == GetLongSetupWifi())) 126 { 127 __FUNC_TRACK__; 128 129 debug_msg("========= FL_ModeIndex: %d \r\n", UI_GetData(FL_ModeIndex)); 130 if(UI_GetData(FL_ModeIndex) == DSC_MODE_MOVIE) { 131 132 133 if(GetWifiSetupDalayTimeFlags()==FALSE) 134 { 135 debug_msg("========= gMovData.State : %d \r\n", gMovData.State ); 136 if(gMovData.State == MOV_ST_VIEW) 137 { 138 g_bRecordLock = FALSE; 139 140 SetLongSetupWifi( TRUE ); 141 UIFlowWndMovie_SetupWifi(); 142 } 143 } 144 else 145 { 146 debug_msg("=========1 wifi setup delaytime not readch!Wait...... \r\n" ); 147 } 148 } 149 else if(UI_GetData(FL_ModeIndex) < DSC_MODE_MOVIE) 150 { 151 if(GetWifiSetupDalayTimeFlags()==FALSE) { 152 153 debug_msg("========= gPhotoData.State : %d \r\n", gPhotoData.State ); 154 if(gPhotoData.State == PHOTO_ST_VIEW) 155 { 156 g_bRecordLock = FALSE; 157 158 SetLongSetupWifi( TRUE ); 159 UIFlowWndMovie_SetupWifi(); 160 } 161 } 162 else 163 { 164 debug_msg("=========2 wifi setup delaytime not readch!Wait...... \r\n" ); 165 } 166 } 167 else 168 { 169 170 } 171 172 return NVTEVT_CONSUME; 173 } 174 } 175 break; 176 177 178 case NVTEVT_KEY_POWER_CONT: 179 return NVTEVT_CONSUME; 180 181 case NVTEVT_KEY_MODE_CONT: 182 183 CheckSetLongKeyShutter1Flag();//++ 184 { 185 __FUNC_TRACK__; 186 if(Input_GetLongKeyShutter1Flag()) 187 { 188 __FUNC_TRACK__; 189 SetLongShutter1KeyFlag(TRUE); 190 } 191 } 192 return NVTEVT_CONSUME; 193 break; 194 #endif 195 } 196 197 System_ResetDetCloseLenCount(); 198 System_ResetPowerSaveCount(); 199 return NVTEVT_PASS; 200 } 201 else if(IN_RANGE_EVENT(key, NVTEVT_KEY_RELEASE_START, NVTEVT_KEY_RELEASE_END)) //Release key 202 { 203 204 __FUNC_TRACK__; 205 206 ReloadScreenSaveTime(); //scola 207 208 209 set_ignore_mode_press( FALSE ); 210 211 ClearKeyHoldCount(); 212 ClearKeyShutter1HoldCount(); 213 214 SetLongShutter1KeyFlag( FALSE ); 215 216 217 if(key == NVTEVT_KEY_POWER_REL) 218 { 219 System_ResetDetCloseLenCount(); 220 if(GxPower_GetControl(GXPWR_CTRL_SLEEP_LEVEL) > 1) // drop key if sleep level > 1 221 { 222 //NOTE! do not set GXPWR_CTRL_SLEEP_RESET before get GXPWR_CTRL_SLEEP_LEVEL, 223 // because GXPWR_CTRL_SLEEP_LEVEL status maybe alter by sleep wakeup flow~ 224 System_ResetPowerSaveCount(); 225 } 226 else 227 { 228 229 //debug_msg("==========power_times : %d \r\n", power_times); 230 { 231 232 //#NT#2016/03/07#KCHong -begin 233 //#NT#Low power timelapse function 234 #if (TIMELAPSE_LPR_FUNCTION == ENABLE) 235 MovieTLLPR_Process(TIMELAPSE_FROM_PWRKEY); 236 #endif 237 238 //#NT#2016/03/07#KCHong -end 239 //System_PowerOff(SYS_POWEROFF_NORMAL); 240 } 241 242 } 243 244 return NVTEVT_CONSUME; 245 } 246 247 System_ResetDetCloseLenCount(); 248 System_ResetPowerSaveCount(); 249 return NVTEVT_PASS; 250 } 251 } 252 return NVTEVT_PASS; 253 }
1 INT32 System_UserKeyFilter(NVTEVT evt, UINT32 paramNum, UINT32 *paramArray) 2 { 3 UINT32 key = evt; 4 if(IN_RANGE_EVENT(key, NVTEVT_KEY_STATUS_START, NVTEVT_KEY_STATUS_END)) //Status class 5 { 6 System_ResetDetCloseLenCount(); 7 System_ResetPowerSaveCount(); 8 #if (STATUSKEY_FUNCTION == ENABLE)//is Enabled 9 DBG_IND("^Bgroup key event=0x%x\r\n", key); 10 11 if(g_bConsumeStatus) 12 { 13 g_bConsumeStatus = 0; 14 } 15 else 16 { 17 UINT32 uiDscMode = Input_Key2Mode(key); 18 DBG_IND("^YDscMode=0x%x\r\n", uiDscMode); 19 //FlowMode_OnKeyMode(uiDscMode); 20 UI_Switch_DscMode(uiDscMode,DSCMODE_SWITCH_FORCE,DSCMODE_SWITCHDIR_DONT_CARE); 21 } 22 #endif 23 __FUNC_TRACK__; 24 return NVTEVT_CONSUME; 25 } 26 else if(IN_RANGE_EVENT(key, NVTEVT_KEY_BUTTON_START, NVTEVT_KEY_BUTTON_END)) //Button class 27 { 28 if(IN_RANGE_EVENT(key, NVTEVT_KEY_PRESS_START, NVTEVT_KEY_PRESS_END)) //Press key 29 { 30 31 ReloadScreenSaveTime(); //scola 32 33 if(key == NVTEVT_KEY_POWER) 34 { 35 __FUNC_TRACK__; 36 return NVTEVT_CONSUME; 37 } 38 39 System_ResetDetCloseLenCount(); 40 if(GxPower_GetControl(GXPWR_CTRL_SLEEP_LEVEL) > 1) // drop key if sleep level > 1 41 { 42 //NOTE! do not set GXPWR_CTRL_SLEEP_RESET before get GXPWR_CTRL_SLEEP_LEVEL, 43 // because GXPWR_CTRL_SLEEP_LEVEL status maybe alter by sleep wakeup flow~ 44 System_ResetPowerSaveCount(); 45 __FUNC_TRACK__; 46 return NVTEVT_CONSUME; 47 } 48 else 49 { 50 System_ResetPowerSaveCount(); 51 if (m_uiAnyKeyUnlockEn) 52 { 53 Ux_PostEvent(NVTEVT_KEY_PRESS_START, 1, key); 54 __FUNC_TRACK__; 55 return NVTEVT_CONSUME; 56 } 57 __FUNC_TRACK__; 58 return NVTEVT_PASS; 59 } 60 } 61 else if(IN_RANGE_EVENT(key, NVTEVT_KEY_CONTINUE_START, NVTEVT_KEY_CONTINUE_END)) //Contine key 62 { 63 64 ReloadScreenSaveTime(); //scola 65 66 switch(key) { 67 68 //case NVTEVT_KEY_CUSTOM1_CONT: 69 case NVTEVT_KEY_POWER_CONT: 70 71 72 CheckSetLongKeyFlag();//++ 73 { 74 __FUNC_TRACK__; 75 if( Input_GetLongKeyFlag() ) 76 { 77 __FUNC_TRACK__; 78 //if(FALSE == MovRec_IsRecording()) 79 { 80 81 //²»ÐèÒª¼ì²â°´¼ü¹Ø±ÕÖ®ºó£¬USB½ÓÈëÖØÆô 82 PowerOffCheckUSB = TRUE; 83 __POWEROFF_TRACK__; 84 85 86 System_PowerOff(SYS_POWEROFF_NORMAL); 87 return NVTEVT_CONSUME; 88 } 89 } 90 } 91 break; 92 #if(EAE_LOGO==ENABLE) 93 case NVTEVT_KEY_SHUTTER1_CONT: 94 #else 95 case NVTEVT_KEY_MENU_CONT: 96 #endif 97 CheckSetLongKeyFlag();//++ 98 { 99 __FUNC_TRACK__; 100 if( Input_GetLongKeyFlag() ) 101 { 102 __FUNC_TRACK__; 103 104 if(key == NVTEVT_KEY_MENU_CONT ) 105 ignor_menu_press_movie = TRUE; 106 107 if((UI_GetData(FL_MOVIE_AUTO_PARKING_MODE) != 0)&&(SysGetFlag(FL_MOVIE_TIMELAPSE_REC)==MOVIE_TIMELAPSEREC_OFF)&&(System_GetState(SYS_STATE_CURRMODE) == PRIMARY_MODE_MOVIE)) 108 //if(UI_GetData(FL_MOVIE_AUTO_PARKING_MODE) != 0) 109 { 110 if(get_parking_mode_flag()) 111 app_exit_eae_parking_mode(); 112 else 113 app_enter_eae_parking_mode(); 114 } 115 } 116 } 117 break; 118 #if 0 119 case NVTEVT_KEY_SHUTTER1_CONT: 120 121 CheckSetLongKeyFlag();//++ 122 if(FALSE == get_ignore_mode_press()) 123 { 124 __FUNC_TRACK__; 125 if(Input_GetLongKeyFlag() && (FALSE == GetLongSetupWifi())) 126 { 127 __FUNC_TRACK__; 128 129 debug_msg("========= FL_ModeIndex: %d \r\n", UI_GetData(FL_ModeIndex)); 130 if(UI_GetData(FL_ModeIndex) == DSC_MODE_MOVIE) { 131 132 133 if(GetWifiSetupDalayTimeFlags()==FALSE) 134 { 135 debug_msg("========= gMovData.State : %d \r\n", gMovData.State ); 136 if(gMovData.State == MOV_ST_VIEW) 137 { 138 g_bRecordLock = FALSE; 139 140 SetLongSetupWifi( TRUE ); 141 UIFlowWndMovie_SetupWifi(); 142 } 143 } 144 else 145 { 146 debug_msg("=========1 wifi setup delaytime not readch!Wait...... \r\n" ); 147 } 148 } 149 else if(UI_GetData(FL_ModeIndex) < DSC_MODE_MOVIE) 150 { 151 if(GetWifiSetupDalayTimeFlags()==FALSE) { 152 153 debug_msg("========= gPhotoData.State : %d \r\n", gPhotoData.State ); 154 if(gPhotoData.State == PHOTO_ST_VIEW) 155 { 156 g_bRecordLock = FALSE; 157 158 SetLongSetupWifi( TRUE ); 159 UIFlowWndMovie_SetupWifi(); 160 } 161 } 162 else 163 { 164 debug_msg("=========2 wifi setup delaytime not readch!Wait...... \r\n" ); 165 } 166 } 167 else 168 { 169 170 } 171 172 return NVTEVT_CONSUME; 173 } 174 } 175 break; 176 177 178 case NVTEVT_KEY_POWER_CONT: 179 return NVTEVT_CONSUME; 180 181 case NVTEVT_KEY_MODE_CONT: 182 183 CheckSetLongKeyShutter1Flag();//++ 184 { 185 __FUNC_TRACK__; 186 if(Input_GetLongKeyShutter1Flag()) 187 { 188 __FUNC_TRACK__; 189 SetLongShutter1KeyFlag(TRUE); 190 } 191 } 192 return NVTEVT_CONSUME; 193 break; 194 #endif 195 } 196 197 System_ResetDetCloseLenCount(); 198 System_ResetPowerSaveCount(); 199 return NVTEVT_PASS; 200 } 201 else if(IN_RANGE_EVENT(key, NVTEVT_KEY_RELEASE_START, NVTEVT_KEY_RELEASE_END)) //Release key 202 { 203 204 __FUNC_TRACK__; 205 206 ReloadScreenSaveTime(); //scola 207 208 209 set_ignore_mode_press( FALSE ); 210 211 ClearKeyHoldCount(); 212 ClearKeyShutter1HoldCount(); 213 214 SetLongShutter1KeyFlag( FALSE ); 215 216 217 if(key == NVTEVT_KEY_POWER_REL) 218 { 219 System_ResetDetCloseLenCount(); 220 if(GxPower_GetControl(GXPWR_CTRL_SLEEP_LEVEL) > 1) // drop key if sleep level > 1 221 { 222 //NOTE! do not set GXPWR_CTRL_SLEEP_RESET before get GXPWR_CTRL_SLEEP_LEVEL, 223 // because GXPWR_CTRL_SLEEP_LEVEL status maybe alter by sleep wakeup flow~ 224 System_ResetPowerSaveCount(); 225 } 226 else 227 { 228 229 //debug_msg("==========power_times : %d \r\n", power_times); 230 { 231 232 //#NT#2016/03/07#KCHong -begin 233 //#NT#Low power timelapse function 234 #if (TIMELAPSE_LPR_FUNCTION == ENABLE) 235 MovieTLLPR_Process(TIMELAPSE_FROM_PWRKEY); 236 #endif 237 238 //#NT#2016/03/07#KCHong -end 239 //System_PowerOff(SYS_POWEROFF_NORMAL); 240 } 241 242 } 243 244 return NVTEVT_CONSUME; 245 } 246 247 System_ResetDetCloseLenCount(); 248 System_ResetPowerSaveCount(); 249 return NVTEVT_PASS; 250 } 251 } 252 return NVTEVT_PASFilter