⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 key_handler_mmp.c

📁 SAMSUNG 5009的源代码
💻 C
📖 第 1 页 / 共 5 页
字号:
/******************************************************************************
 *   Filename    : Mmp_key_handler.c
 *   Start       : 2004. 11. 15
 *   By          : Taejin Kwon
 *   Contact     : eric.kwon@samsung.com
 *   Description : 
 ******************************************************************************
 */

/******************************************************
 *       INCLUDES
 *****************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "Basic_typedefs.h"
#include "CUSTOM/Custom_option.h"
#include "API/HAPI/SH_capability.h"
#include "OS/OS_abstract.h"
#include "API/SH_types.h"
#include "API/SH_api.h"

#include "COMMON/Common.h"

#include "MAIN/Global_state.h"
#include "MAIN/Appl_types.h"
#include "MAIN/Uop_msg.h"

#include "CUSTOM/Osd_types.h"
#include "CUSTOM/Osd_if.h"
#include "CUSTOM/Strings_ext.h"


#include "CUSTOM/Key_defs.h"
#include "CUSTOM/Key_receive.h"
#include "CUSTOM/Key_handler_setup.h"
#include "CUSTOM/Key_2_uop.h"

#include "DRIVER/FS/Fs_api.h"
#include "DRIVER/eeprom/Eeprom_drv.h"

#include "MAIN/MMP/MMN/Mmn_core.h"
#include "MAIN/MMP/Mmp_predef.h"
#include "MAIN/MMP/Mmp_common.h"
#include "MAIN/MMP/Mmp_global.h"
#include "MAIN/MMP/Mmp_show.h"
#include "MAIN/MMP/Mmp_util.h"
#include "MAIN/MMP/Mmp_callback.h"
#include "MAIN/MMP/Mmp_control.h"

#include "CUSTOM/FP_handle.h"


/*******************************************************
 *       Global Variables 
 ******************************************************/

/*******************************************************
 *       Extern  Variables 
 ******************************************************/
extern MmpUi_st 		*gpstMmp_ui;
extern SysTimer_t 		gTimer_icon;
extern BOOL 			gRedraw_flag;

//SSCR xuhui 061020
#if _APP_CAP_JPG_ASV
extern S5H_ASVMode_t gASV_SetupMode;
#endif

extern VOID OsdTimerSet( SysTimeTick_t time, SysEnable_t	set );
extern VOID OsdSelTimerSet( SysTimeTick_t time, SysEnable_t	set );
extern BOOL GetFlagNotSupportAVIVideo(VOID); 
extern BOOL MmpJPGFinalPlay(VOID);
extern BOOL MmpAudioFinalPlay(VOID);
extern INLINE OSD_MainType_et GetDisplayMainState( VOID );
extern INLINE void SetDisplayVolOsdTypeState( VolOsdType_et  type ); 
extern RepeatSub_et GuiRepeatStateCtrl(BOOL LeftFlag);
extern S5H_Lrstereo_et GuiLrsteroSelStateCtrl(BOOL LeftFlag);
extern UINT	iPAR_GetAviAudioCurStreamNo(void);
extern ULONG iPAR_GetTotalPlayTime(void);
extern BOOL SCRT_Ex_Get_ParseDone(VOID);
extern VOID GuiLrsteroOn(VOID);

#if _APP_CAP_PERI_VFD
extern VOID SetVfdJpegNumber( UINT16 num );
#endif

#if _API_CAP_SUP_PAR_AVI2_INDEX	
extern BOOL GetAVI2IndexFlag(void);
#endif

#if _APP_CAP_OSD_EXT_SUB_FILE_SELCTION
extern VOID GetMmpExtSubtitleFileTotalNumber( BYTE1 *total_file );
#endif

#if _APP_CAP_KEY_USE_CLEAR
#define MmpGuiClear GuiClear
#endif/*_APP_CAP_KEY_USE_CLEAR*/

#if _SUPPORT_MMN_RETURN
/******************************************************************************
* Function name  	: MmpGuiReturn 
* Arguments      	:  
*     IN        
*					VOID
*     OUT       
*     I/O       
* Return         	:  STATIC VOID
*					
* By             		: Kim Do Yeon
* Description    	: 
* Revision       	:  
******************************************************************************
*/  
STATIC VOID MmpGuiReturn( VOID )
{
	BYTE2 folder_index;
	
	if ((GetMmpFileType() == MMP_AUDIO_FILE) && IsBgPlay())
		folder_index = GetMmpFolderPlay();
	else
		folder_index = GetMmpFolderOpen();
	
	MmpExpSetPlay(folder_index, MMP_NO_SELECTION, MMP_DIR_NONE);		

}
#endif /* _SUPPORT_MMN_RETURN */

/******************************************************************************
* Function name  	: MmpExpAvailNum 
* Arguments      	:  
*     IN        
*					BYTE2 input_value
*     OUT       
*     I/O       
* Return         	:  BOOL
*					
* By             		: Kim Do Yeon
* Description    	: 
* Revision       	:  
******************************************************************************
*/   
BOOL MmpExpAvailNum(BYTE2 input_value)
{
	BYTE2 max, cursor;
	OSD_State_st *osd_state;

	osd_state = OSD_GetState();
	
	if(osd_state->etExp_state.etCtrl_focus == EXPLORER_SUB_FILE)
	{
		max = GetMmpTotalFiles();
		cursor = GetMmpFileCursor();	
	}	
	else	
	{
		max = GetMmpTotalFolders();	
		cursor = GetMmpFolderCursor();				
	}	

	if(input_value > max)
	{
		MmpShowNotAvail();
		MmpShowNoticeString(MMP_NOTICE_DEFAULT, "");
		return FALSE;			
	}	

	return TRUE;

}		

#if _APP_CAP_OSD_FLATTEN_EXPLORER

/******************************************************************************
* Function name  	: MmpHandleImagePlay 
* Arguments      	:  
*     IN        
*					BYTE2 input_value
*     OUT       
*     I/O       
* Return         	:  BOOL
*					
* By             		: Kim Do Yeon
* Description    	: Play key action in image handling
* Revision       	:  
******************************************************************************
*/   
BOOL MmpHandleImagePlay(BYTE2 input_value)
{
	BYTE2  max;

	/* Clear the image numeric input */
	OSD_SetIconDisplay(ICON_KEEP, NULL, SYS_NO_WAIT);
	
	/* Decide the playing item between numeric input and cursor */
	if(input_value == 0)
		input_value = GetMmpFileCursor();	
	else
	{
		input_value--; /* index 0 is the 1st */	

		max = GetMmpTotalFiles();
		if(input_value > max)
		{
			MmpShowNotAvail();		
			return FALSE;
		}	
	}			
#if _APP_CAP_JPG_ASV
	MmpStopAsv();
#endif

	if(input_value == MMP_NO_SELECTION)
		input_value = 0;	

	MmpExpImagePlay(input_value);
	MmpShowCursorMsgOn(ICON_PLAY);	
	
	return TRUE;	
	
}

/******************************************************************************
* Function name  	: MmpGuiStop 
* Arguments      	:  
*     IN        
*					VOID
*     OUT       
*     I/O       
* Return         	:  VOID
*					
* By             		: Kim Do Yeon
* Description    	: when STOP key we will set the main state to stop and osd return to explore
* Revision       	:  
******************************************************************************
*/    
VOID MmpGuiStop(VOID)
{	
	OSD_State_st *osd_state;
	SetMainState_t main_state = GetMainState();
	MmpStopMode_et stop_mode;
	MmpDspSync_et dis_sync;
	BYTE2 cursor;
	
	MmpClearNumericInput();     

	osd_state = OSD_GetState();
	stop_mode = GetMmpStopMode();
	dis_sync = GetMmpDispSync();
	
	switch (osd_state->etCur_dsp)
	{	
		case DISPLAY_EXPLORER:
			if( osd_state->etExp_state.etInfo1==  EXPLORER_MODE_INFO1SEARCH )
				MmpReturnToCurPlay();			
			else if(osd_state->etExp_state.etInfo2 != EXPLORER_MODE_INFO2NORMAL)
				MmpReturnInfo2Normal();
			break;
		
#if _APP_CAP_NAV_MMP_PLAY_VIDEO_FILE
		case DISPLAY_AUTHORIZATION_MSG:
		case DISPLAY_RENTAL_EXPIRED_MSG:
		case DISPLAY_RENTAL_CONFIRMATION_MSG:
			MmpDeinitVideoParsing();
#if !_APP_CAP_OSD_TOGGLE_BY_HOTKEY		
			OsdTimerSet( OSD_TIME_FOR_BANNER, TIMER_DISABLE );
#endif
			break;
			
#endif	
			
		case DISPLAY_IMAGE_ALBUM:
			MmpClearImageCmd();
			cursor = GetMmpAlbumSelect();
			SetMmpFileCursor(cursor);	
			SetMmpFilePage(cursor/MMP_CTRL_PAGE_UNIT_SIZE);

		case DISPLAY_IMAGE_INFO:
		case DISPLAY_OFF:
#if _APP_CAP_NAV_MMP_PLAY_VIDEO_FILE	// cydrain 20060117
		case DISPLAY_INFO:
		case DISPLAY_AUDIO:
		case DISPLAY_SUBTITLE:
		case DISPLAY_REPEAT:	// cydrain 20060110
		case DISPLAY_MODE_SEL:
		case DISPLAY_3D:		//(weilf)20060111
		case DISPLAY_REVERBRATION:	// cydrain 20060405
		case DISPLAY_STEREO:	// cydrain 20060126
#ifdef _APP_CAP_KEY_TIME_KEY
		case DISPLAY_TIME:	// cydrain 20060208
#endif
#ifdef _MMP_BOOKMARK		// cydrain 20060210
		case DISPLAY_BOOKMARK:
#endif
#if _APP_CAP_AUD_KARAOKE// Qian liping 060222
		case DISPLAY_KARA:
#endif
#endif
			if (GetMmpFileType()==MMP_IMAGE_FILE)
			{
				UiMmpImageReturn(TRUE);
				SysSleep(2000,NULL);
				return;
			}

#if !_APP_CAP_OSD_TOGGLE_BY_HOTKEY		// cydrain 20060222
			OsdTimerSet( OSD_TIME_FOR_BANNER, TIMER_DISABLE );
#endif	/* _APP_CAP_OSD_TOGGLE_BY_HOTKEY */
			break;
#if _APP_CAP_FUNC_MMP_FIXED_SUB_SCHEME
		case DISPLAY_EXT_SUBTITLE:
			return;
#endif


		default:
			break;
	}

	/* Display state: MMP_DSP_ONLY or MMP_DSP_BG_PLAY */
	if(dis_sync != MMP_DSP_IMG_PLAY)	
	{
#if !_APP_CAP_KEY_TIME_KEY
		if(osd_state->etExp_state.etInfo1 == EXPLORER_MODE_INFO1REMAIN) 
		{
			OSD_ChangeExplore(OSD_CTRL_EXPLORE_INFO1NORMAL, NULL, SYS_WAIT);
		}	
#endif /*!_APP_CAP_KEY_TIME_KEY*/
		
		if((stop_mode == MMP_NON_STOP) && (IsBgPlay()))
		{
			SetMmpSetupPrevState(MAIN_STOP);			

			if(main_state == MAIN_PAUSE && (GetMmpFileType()==MMP_AUDIO_FILE))
			{
				UiCmdGeneral(UOP_MMP_RESUME_STOP);	
			}
				
#if (!_MMP_SUPPORT_RESUME_STOP) ||_APP_CAP_FUNC_MMP_VIDEO_DIRECT_STOP   //gvg spec. azureming@061027
			else if (GetMmpFileType()==MMP_VIDEO_FILE)
			{

				UiMmpFullStop((MmpReqMode_et) GetMmpFileType() );
			}
#endif
			else
			{
				/* SSCR Weilifeng 060522 fix 342 */
				UiCmdGeneral(UOP_MMP_RESUME_STOP);	
				
#if _APP_CAP_FUNC_MMP_INTRO_PLAY
				MmpIntroFlagSet(FALSE);
#endif
#if _APP_CAP_NAV_MMP_PLAY_VIDEO_FILE		
				 if (GetMmpFileType()==MMP_VIDEO_FILE)
				{

					cursor = GetMmpBgPlay();
					SetMmpFilePage(cursor/MMP_CTRL_PAGE_UNIT_SIZE);
					MmpShowExplore();/* Setting the display sync to MMP_DSP_ONLY in preview */	
					MmpShowUpdateTime();	/* Reset the time display */			
				}

#endif
			}

		}	

		else
		{	
			
			UiMmpFullStop((MmpReqMode_et) GetMmpFileType() );
		}	

	}	

	SH_writeEepromFromBuffer();
	
}	

//gaoping this code is no use 20051228
#if 0
/******************************************************************************
* Function name  : MmpGuiAlbumPlay
* Arguments      :  
*     IN        
*				BYTE2 input_value
*     OUT       
*     I/O       
* Return         	:  STATIC VOID 
*					
* By             : 	Kim Do Yeon
* Description    :  
* Revision       :  
******************************************************************************
*/
STATIC VOID MmpGuiAlbumPlay(BYTE2 input_value)
{
#if _APP_CAP_OSD_SLIDE_ICON_FIRST_INFO		
	SetMmpImageInfoState(MMP_IMG_INFO_SLIDE1);	
#else /* _APP_CAP_OSD_SLIDE_ICON_FIRST_INFO */
	SetMmpImageInfoState(MMP_IMG_INFO_ALBUM);	
#endif /* _APP_CAP_OSD_SLIDE_ICON_FIRST_INFO */	
	
	SetMmpSlideShowTime(MMP_SLIDE_SHOW_TIME_1);	
#if _APP_CAP_FUNC_JPG_PLAY_MODE
	MmpResetImgPlayMode();
#endif
	MmpHandleImagePlay(input_value);
}	
#endif
#if 0
/******************************************************************************
* Function name  	: MmpGuiAlbumEnter 
* Arguments      	:  
*     IN        
*					BYTE2 input_value
*     OUT       
*     I/O       
* Return         	:  STATIC VOID 
*					
* By             		: Liu renliang
* Description    	: 
* Revision       	:  
******************************************************************************
*/    
STATIC VOID MmpGuiAlbumEnter(BYTE2 input_value)
{
	BYTE2	select;

	//gaoping 051205
	// [bug 2364] in Jpeg album mode, input a number bigger than file number, the OSD wrong.
	if ((input_value != 0) && (input_value >  GetMmpTotalFiles()))
	{
	/* Clear the image numeric input */
		OSD_SetIconDisplay(ICON_KEEP, NULL, SYS_NO_WAIT);
		MmpShowNotAvail();
		return;
	}

	if(input_value > 0)
	{
		select = input_value -1;
		SetMmpFileCursor(input_value -1);
		SetMmpAlbumSelect(select);
	}
	else
	{
		select = GetMmpAlbumSelect();
//gaoping 20051228 when album this is no use because now album play mode is normal
#if 0// _APP_CAP_FUNC_JPG_PLAY_MODE
		if (gpstMmp_ctrl->epstImg_play->ecPlay_status==PARAM_PB_PROGRAM)
		{
			BYTE2 folder;
			
			gpstMmp_ctrl->epstPgm_image->cur_index = select;
			folder =gpstMmp_ctrl->epstPgm_image->folder[select];
			
			if (folder!=GetMmpFolderOpen())
				MmpExpSetPlay(folder, select, MMP_DIR_NONE); 
			
			select = gpstMmp_ctrl->epstPgm_image->file[select];

		}
		SetMmpFileCursor(select);
#else
		SetMmpFileCursor(select);
#endif
	}

	MmpIntoImgDisplay(GetMmpFolderOpen(),select);	//xh 20060424


}
#endif
/******************************************************************************
* Function name  	: MmpGuiAlbumSelectMove 
* Arguments      	:  
*     IN        
*					SSHORT move
*     OUT       
*     I/O       
* Return         	:  STATIC VOID 
*					
* By             		: Kim Do Yeon
* Description    	: 
* Revision       	:  
******************************************************************************
*/     
STATIC VOID MmpGuiAlbumSelectMove(SSHORT move)
{
	BYTE2 album_index = 0, page_num = 0, total_num = 0;

	album_index = GetMmpAlbumSelect();/* start from 1 */
//gaoping 20051228 when album this is no use because now album play mode is normal
#if 0//_APP_CAP_FUNC_JPG_PLAY_MODE
	if (gpstMmp_ctrl->epstImg_play->ecPlay_status==PARAM_PB_PROGRAM)
		total_num = gpstMmp_ctrl->epstPgm_image->num_program;
	else 
		total_num = GetMmpTotalFiles();
#else
	total_num = GetMmpTotalFiles();

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -