mediaplayerfunc.c
来自「M3355的源代码」· C语言 代码 · 共 2,203 行 · 第 1/5 页
C
2,203 行
KaraProc(MsgType, MsgInput);
#endif
}
else
{
if ((g_UiCrntFunc==UI_FUNC_SLIDE) && !(MsgType == C_FP_KEY && MsgInput == V_KEY_OPEN))
UiFuncSlideProc(MsgType, MsgInput);
else
MediaPlayerProc(MsgType, MsgInput);
// MediaPlayerProc(MsgType, MsgInput);
#ifdef _MUTE_ENABLE_
ptr_GetMuteVolumeStatus = GetMuteVolumeStatus;
if((*ptr_GetMuteVolumeStatus)() == MUTEVOLUME_STATUS_MUTE && g_UiCrntSubFunc != UI_SUBFUNC_MUTEVOLUME)
{
MPO_GetPositionInfo(&tMPFCurPosition);
if(tMPFCurPosition.iPlayerFocused==MPLR_CD || tMPFCurPosition.iPlayerFocused==MPLR_MUSIC)
{
MPO_RefreshOutlook(RT_HIGHLIGHT_INOUT, &iRefreshParam);
gui_hdc=gMPOdc;
ptr_ShowMuteVolume = ShowMuteVolume;
(*ptr_ShowMuteVolume)(MUTEVOLUME_STATUS_MUTE);
g_UiCrntSubFunc = UI_SUBFUNC_MUTEVOLUME;
}
}
#endif
}
}
/*--------------------------------------------------------------------
* Function_Name KaraProc
*
* Description:
* proc msg on karaoke gui
* Arguments:
*
*------------------------------------------------------------------*/
#ifdef _KARAOKE_ENABLE_
void KaraProc( WORD MsgType, DWORD MsgInput )
{
//ENTER_FUNCTION;
switch(MsgType)
{
case C_FP_MIC_DETECT:
BasalRespondFPMicDetect( MsgInput);
if( (MsgInput == C_LEFT_MIC_OFF || MsgInput == C_RIGHT_MIC_OFF ) &&
bOutOfMPO == TRUE )
{
VolumRespondTimer(17);
MPO_RefreshOutlook(RT_HIGHLIGHT_INOUT, &iRefreshParam);
}
if(MsgInput == C_LEFT_MIC_ON || MsgInput == C_RIGHT_MIC_ON )
{
AP2PEOprParam.VirtualSurroundMode = FALSE;
// DecSetVirtualSurround(SYSOption.bChannelNum, FALSE);
MPF_Attr.wSurMode=0;
MPO_RefreshOutlook(RT_SURMODE_CHG, &iRefreshParam);
}
break;
case C_TIMER_ACTIVE:
MPF_RespondTimerActive(MsgInput);
break;
case C_PLAYBACK_MANAGE:
case C_NV_NOTICE:
case C_FP_PLAYTIME:
MediaPlayerProc(MsgType, MsgInput);
break;
case C_FP_KEY:
Kara_RespondFPKey( MsgInput );
break;
/* case C_SCRSV_NOTICE:
MPF_RespondScrsv(MsgInput);*/
break;
default:
break;
}
//LEAVE_FUNCTION;
}
#endif
static WORD tmpUiCoreState=UI_CORE_STOP;
static BOOL tmpIsSecondStop=FALSE;
/*--------------------------------------------------------------------
* Function_Name MediaPlayerProc
*
* Description:
* proc msg on mediaplayer gui
* Arguments:
*
*------------------------------------------------------------------*/
void MediaPlayerProc( WORD MsgType, DWORD MsgInput )
{
PLAYPOINT iPlayPoint;
WORD iCurPic, iTotalPic;
extern BYTE JpgNextState,JpgResumeState;
extern WORD zoomnum;
LoaderStatus status;
switch(MsgType)
{
case C_DT_TEST:
case C_FP_SHOWLOAD:
UiFuncNormalProc(MsgType,MsgInput);
break;
#ifdef _KARAOKE_ENABLE_
case C_FP_MIC_DETECT:
BasalRespondFPMicDetect( MsgInput);
if( (MsgInput == C_LEFT_MIC_OFF || MsgInput == C_RIGHT_MIC_OFF ) &&
bOutOfMPO == TRUE )
{
VolumRespondTimer(17);
MPO_RefreshOutlook(RT_HIGHLIGHT_INOUT, &iRefreshParam);
}
if(MsgInput == C_LEFT_MIC_ON || MsgInput == C_RIGHT_MIC_ON )
{
AP2PEOprParam.VirtualSurroundMode = FALSE;
// DecSetVirtualSurround(SYSOption.bChannelNum, FALSE);
MPF_Attr.wSurMode=0;
MPO_RefreshOutlook(RT_SURMODE_CHG, &iRefreshParam);
}
break;
#endif
case C_TIMER_ACTIVE:
MPF_RespondTimerActive(MsgInput);
break;
case C_PLAYBACK_MANAGE:
if(MsgInput==C_NV_SEG_END)
{
if(g_UiCoreState!=UI_CORE_STOP)
{
GetLoaderStatus(&status);
if(status.tray==LOADER_TRAY_CLOSE)
MPF_RespondNVSegEnd();
}
}
else if(MsgInput==C_REPEAT_AB_END)
MPF_RespondNVPointEnd();
break;
case C_FP_KEY:
MPF_RespondFPKey( MsgInput );
break;
case C_FP_PLAYTIME:
if(g_UiCoreState == UI_CORE_STOP && bIsSecondStop)
{
if(DiscType == C_FILEOPENDISC)
MPF_Attr.dwPlaytime = 0;
else
MPF_Attr.dwPlaytime=NVGetTotalTime();
}
else
{
if(tmpUiCoreState==UI_CORE_STOP && tmpIsSecondStop==FALSE && MsgInput==0x00)
DBG_PRINT("don't show time 0\n");
else
MPF_Attr.dwPlaytime=MsgInput;
}
tmpUiCoreState=g_UiCoreState;
tmpIsSecondStop=bIsSecondStop;
MPO_RefreshOutlook(RT_PLAYTIME_CHG, &iRefreshParam);
break;
#if 0
case C_SLIDESHOW_HELP:
gAuxParam.bDrawSlideShowHelp=&bDrawSlideShowHelp;
iTotalPic=FileOpenMenuGetTTNs();
iCurPic = wShowedNum+1;
gAuxParam.iCurPic = &iCurPic;
gAuxParam.iTotalPic=&iTotalPic;
MPA_RefreshAuxiliary(AT_SLIDESHOWHELP_INIT, &gAuxParam);
SendVFDPart1Show();
break;
case C_SLIDESHOW_TT:
NVGetCurInfo(&iPlayPoint);
iCurPic=iPlayPoint.wTTN+1;
iTotalPic=FileOpenMenuGetTTNs();
wShowedNum=iPlayPoint.wTTN;
if(zoomnum!=wShowedNum)
zoomnum=0xffff;
SendVFDPart1Show();
if(g_UiCrntSubFunc==UI_SUBFUNC_ZOOM)
{
break;
}
gAuxParam.iCurPic=&iCurPic;
gAuxParam.iTotalPic=&iTotalPic;
MPA_RefreshAuxiliary(AT_SLIDESHOWHELP_CHG_NUM, &gAuxParam);
break;
case C_SHOWJPG_OK:
JpgNextState =0;//benjamin add for jpg play ,skip one ,ignore othe skip before complete
JpgResumeState = 0;
break;
case C_SLIDESENDJPG_AGAIN://benjamin add ,only for slide show jpg,send current jpg again
MPF_JPGSendAgain();
break;
#endif
}
}
#if 0
//benjamin add this,only for slide show jpeg,not mix
void MPF_JPGSendAgain()
{
PLAYPOINT PPtemp;
tPositionInfo curPositionInfo;
PLAYPOINT iPlayPoint;
int i;
int iNextNum=0;
g_UiCoreState=UI_CORE_PLAY;
MPO_GetPositionInfo(&curPositionInfo);
CloseZoom();
PPtemp.wTTN = curPositionInfo.wListHighlightIndex-(MPF_Attr.wItemCount-MPF_Attr.wFileCount) ;
PPtemp.FileTp = C_JPGFILE;
PPtemp.dwLBAAddr = 0;
PPtemp.bProPlay = FALSE;
PPtemp.bMixPlay = FALSE;
NVPlayModeChg(C_NV_Play,0);
NVPTTPlay( &PPtemp, C_STOP_SKIPPG, KEY_NULL );
}
#endif
/*--------------------------------------------------------------------
* Function_Name MPF_RespondTimerActive
*
* Description:
*
* .
* Arguments: Type:
*
* Return Value:
*------------------------------------------------------------------*/
void MPF_RespondTimerActive(DWORD MsgInput)
{
switch (MsgInput)
{
case C_PLAYMODEGUI_TIMER:
MPF_NumEnter();
break;
case C_SCRSAVERON_TIMER:
ScrSaverTurnON();
break;
#ifdef _KARAOKE_ENABLE_
case C_KARAOKE_TIMER:
VolumRespondTimer(17);
MPO_RefreshOutlook(RT_HIGHLIGHT_INOUT, &iRefreshParam);
break;
#endif
default:
break;
}
}
/*--------------------------------------------------------------------
* Function_Name MPF_RespondNVSegEnd
*
* Description:
*
* .
* Arguments: Type:
*
* Return Value:
*------------------------------------------------------------------*/
void MPF_RespondNVSegEnd(void)
{
tPositionInfo iPos;
MPO_GetPositionInfo(&iPos);
#if 0
if(g_UiCrntFunc == UI_FUNC_NORMAL)
{
if(iPos.iPlayerFocused==MPLR_PHOTO)
{
if(g_UiCoreState==UI_CORE_PAUSE)
return;
}
MPF_NextPrevProc(V_KEY_NEXT,1);
}
else
#endif
{
MPF_Next(C_NOUSER);
if(g_UiCoreState==UI_CORE_FAST)
NVPlayModeChg(C_NV_Fast, bActionCtl - MinFastVal + 1);
else if(g_UiCoreState==UI_CORE_REVERSE)
NVPlayModeChg(C_NV_Reverse, bActionCtl - MinReverseVal + 1);
}
}
/*--------------------------------------------------------------------
* Function_Name
*
* Description:
*
* .
* Arguments: Type:
*
* Return Value:
*------------------------------------------------------------------*/
void MPF_RespondNVPointEnd(void)
{
tPositionInfo tMPFCurPosition;
MPO_GetPositionInfo(&tMPFCurPosition);
if(1)
{
MPF_Attr.iFocusObj = tMPFCurPosition.iFocusObj;
MPF_Attr.iPlayingObj = OBJ_LIST;
MPF_Attr.wListBeginIndex = tMPFCurPosition.wListHighlightIndex-tMPFCurPosition.iListHighlightIndex;
MPF_Attr.wListHighlightIndex = tMPFCurPosition.wListHighlightIndex;
MPF_Attr.wListPlayingIndex = PBInfo[ REPEATAB_SMALL ].wTTN-1;
if(g_UiCoreState!=UI_CORE_PLAY)
{
g_UiCoreState = UI_CORE_PLAY;
bActionCtl = 0;
NVPlayModeChg( C_NV_Play, 0 );
MPO_RefreshOutlook( RT_PLAYMODE_CHG, &iRefreshParam);
}
NVPTTPlay( &PBInfo[ REPEATAB_SMALL ], C_STOP_SKIPPG, KEY_NULL );
MPO_RefreshOutlook( RT_FEEDBACK, &iRefreshParam);
MPO_RefreshOutlook( RT_PLAYMODE_CHG, &iRefreshParam);
SendVFDPart1Show();
return;
}
MPF_Attr.wListPlayingIndex=PBInfo[ REPEATAB_SMALL ].wTTN-1;
if(MPF_Attr.wListPlayingIndex<MPF_Attr.wListBeginIndex+C_ITEMPERCOL&&MPF_Attr.wListPlayingIndex>=MPF_Attr.wListBeginIndex)
;
else if(MPF_Attr.wListPlayingIndex < C_ITEMPERCOL)
MPF_Attr.wListBeginIndex = 0;
else
MPF_Attr.wListBeginIndex= MPF_Attr.wListPlayingIndex - C_ITEMPERCOL+1;
MPF_Attr.iFocusObj = OBJ_LIST;
MPF_Attr.iPlayingObj = OBJ_LIST;
MPF_Attr.wListHighlightIndex = MPF_Attr.wListPlayingIndex;
if(g_UiCoreState!=UI_CORE_PLAY)
{
g_UiCoreState = UI_CORE_PLAY;
bActionCtl = 0;
NVPlayModeChg( C_NV_Play, 0 );
MPO_RefreshOutlook( RT_PLAYMODE_CHG, &iRefreshParam);
}
NVPTTPlay( &PBInfo[ REPEATAB_SMALL ], C_STOP_SKIPPG, KEY_NULL );
MPO_RefreshOutlook( RT_FEEDBACK, &iRefreshParam);
}
extern HDC gui_hdc, gMPOdc;
extern void UiSubFuncMuteVolumeInit(void);
void (*ptr_UiSubFuncMuteVolumeInit)(void);
extern void UiSubFuncBrightContrastSharpInit(void);
void (*ptr_UiSubFuncBrightContrastSharpInit)(void);
void MPF_Program()
{
tPositionInfo tMPFCurPosition;
MPO_GetPositionInfo(&tMPFCurPosition);
if(findProgItem(tMPFCurPosition.wListHighlightIndex)==PROG_ITEM_NULL)
{
insertProgItem(tMPFCurPosition.wListHighlightIndex);
#ifdef _DEBUG
showProgList();
#endif
MPO_RefreshOutlook(RT_PROGRAM_ONOFF, &iRefreshParam);
}
else
{
#ifdef _TIANKE_PROG
#else
g_UiPlaybackList=UI_PLAYBACKLIST_PROGRAM;
g_VCDProCurNum=GetProgCurIndex(tMPFCurPosition.wListHighlightIndex);
MPO_RefreshOutlook(RT_PROGPLAY_ONOFF, &iRefreshParam);
CheckPlayback(V_KEY_PLAY, tMPFCurPosition.wListHighlightIndex-(MPF_Attr.wItemCount-MPF_Attr.wFileCount) );
MPF_Play(C_USEROP);
#endif
}
}
void MPF_Clear()
{
tPositionInfo tMPFCurPosition;
MPO_GetPositionInfo(&tMPFCurPosition);
if(findProgItem(tMPFCurPosition.wListHighlightIndex)!=PROG_ITEM_NULL)
{
deleteProgItem(tMPFCurPosition.wListHighlightIndex);
#ifdef _DEBUG
showProgList();
#endif
MPO_RefreshOutlook(RT_PROGRAM_ONOFF, &iRefreshParam);
if(DiscType != C_VCD20 && DiscType && C_SVCD && DiscType != C_VCD10)
{
if( tMPFCurPosition.wListPlayingIndex==tMPFCurPosition.wListHighlightIndex )
if(g_UiPlaybackList==UI_PLAYBACKLIST_PROGRAM)
MPF_Next(C_USEROP);
else
MPF_Stop(C_USEROP);
}
}
}
static int iTotal=0;
void MPF_RespondFPKey( DWORD UserKey )
{
int i;
tAudType CurrentAudioType;
tPositionInfo tMPFCurPosition;
ScrSaver(SCRSAVER_CANCEL);
MPO_GetPositionInfo(&tMPFCurPosition);
#if(_VCD_PROGRAM_MODE==_VCD_PROGRAM_ENABLE_)
if(!CheckVCDKey(UserKey))
return;
#endif
switch ( UserKey )
{
case V_KEY_VOLUM:
#ifdef _KARAOKE_ENABLE_
EPRINTF("\n in media play audiotype = %d\n",AudioType);
CurrentAudioType = ReportAudioType();
if((SYSOption.bDTS == C_OFF && bIsSecondStop == TRUE && g_UiCoreState == UI_CORE_STOP ) || (SYSOption.bDTS == C_OFF && CurrentAudioType != C_DTS && CurrentAudioType != C_DTS_CD_AUDIO) || SYSOption.bDTS == C_ON )
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?