?? clips_menu.c
字號:
{
ActionEngine_CurrItemSlow(FgActionEnginePtr, 0);
bResult = 1;
}
return bResult;
}
/***************************************************************************************
* Function : _IncreaseRepeatChoice
*
* In :
*
* Out :
*
* Return :
*
* Desc : This function is to Inrease RepeatChoice and out new valIndex.
*
****************************************************************************************/
static void _IncreaseRepeat(void)
{
if(ActionEngine_IsRepeatOff(FgActionEnginePtr))
{
ActionEngine_SetRepeatSingle(FgActionEnginePtr, TRUE);
ActionEngine_SetRepeatSingle(BgActionEnginePtr, TRUE);
}
else if(ActionEngine_IsRepeatSingle(FgActionEnginePtr))
{
ActionEngine_SetRepeatAll(FgActionEnginePtr, TRUE);
ActionEngine_SetRepeatAll(BgActionEnginePtr, TRUE);
}
else
{
ActionEngine_SetRepeatOff(FgActionEnginePtr);
ActionEngine_SetRepeatOff(BgActionEnginePtr);
}
}
/***************************************************************************************
* Function : _AreWorkDirectoyDifferent
*
* In :
*
* Out :
*
* Return :
*
* Desc : This function is to Inrease RepeatChoice and out new valIndex.
*
****************************************************************************************/
static BOOL _AreWorkDirectoyDifferent(PtrToActionEngineObject pActionEngine1, PtrToActionEngineObject pActionEngine2)
{
if(!ActionEngine_IsDifferentObjectType(pActionEngine1, pActionEngine2))
{
#ifdef D_GUI_CLIPS_PROGRAM_VIEW
//to program list they are always in same dir
if(ActionEngine_IsProgramListObject(pActionEngine1))
return FALSE;
else
#endif //D_GUI_CLIPS_PROGRAM_VIEW
return (ActionEngine_GetWorkDirIndex(pActionEngine1) != ActionEngine_GetWorkDirIndex(pActionEngine2));
}
// The result of this function has no meaning for a program list
//MS_BREAK_POINT();
return 1;
}
/***************************************************************************************
* Function : _IsFileTypeFilterDifferent
*
* In :
*
* Out :
*
* Return :
*
* Desc : This function is to Inrease RepeatChoice and out new valIndex.
*
****************************************************************************************/
static BOOL _IsFileTypeFilterDifferent(PtrToActionEngineObject pActionEngine1, PtrToActionEngineObject pActionEngine2)
{
if ( (eObjectDirectoryBrowser == pActionEngine1->mObjectType)
&& (eObjectDirectoryBrowser == pActionEngine2->mObjectType))
{
return (DirBrowser_GetCurrFileTypes((PtrToDirBrowser)pActionEngine1) != DirBrowser_GetCurrFileTypes((PtrToDirBrowser)pActionEngine2));
}
// The result of this function has no meaning for a program list
MS_BREAK_POINT();
return 0;
}
/***************************************************************************************
* Function : _GetCurrentPlayMode
*
* In : NULL
*
* Out : NULL
*
* Return :
*
* Desc :
*
****************************************************************************************/
#ifdef D_GUI_CLIPS_PLAY_MODE
static UINT16 _GetCurrentPlayMode(void)
{
#ifdef D_INTRO_PLAYMODE
if(ActionEngine_IsPlaybackIntro(FgActionEnginePtr))
return PLAYMODE_INTRO;
else
#endif
if (ActionEngine_IsPlaybackNormal(FgActionEnginePtr))
return PLAYMODE_NORMAL;
else if (ActionEngine_IsPlaybackRandom(FgActionEnginePtr))
return PLAYMODE_RANDOM;
else if (ActionEngine_IsPlaybackShuffle(FgActionEnginePtr))
return PLAYMODE_SHUFFLE;
else return PLAYMODE_NULL;
}
#endif //D_GUI_CLIPS_PLAY_MODE
#ifdef D_GUI_CLIPS_PLAY_MODE
#ifndef D_CUSTOM__IsAllowedIntroMode
static BOOL _IsAllowedIntroMode(void)
{
return TRUE;
}
#endif// D_CUSTOM__IsAllowedIntroMode
#endif // D_GUI_CLIPS_PLAY_MODE
static CONST UINT8 * _GetDeviceIcon(UINT16 wDeviceId)
{
//can't get disc device type before load
if (DEVICE_DISC == wDeviceId)
return BMP_DEVICE_DISC;
switch (DeviceManager_GetDeviceType(wDeviceId))
{
#ifdef SUPPORT_FLASH_CARD
case DEVICE_TYPE_SD:
return BMP_DEVICE_SD;
case DEVICE_TYPE_MMC:
return BMP_DEVICE_MMC;
case DEVICE_TYPE_MS:
return BMP_DEVICE_MS;
case DEVICE_TYPE_MSPRO:
return BMP_DEVICE_MSPRO;
case DEVICE_TYPE_CF:
return BMP_DEVICE_CF;
case DEVICE_TYPE_SM:
return BMP_DEVICE_SM;
case DEVICE_TYPE_XD:
return BMP_DEVICE_XD;
case DEVICE_TYPE_USB:
return BMP_DEVICE_USB;
#endif//SUPPORT_FLASH_CARD
case DEVICE_TYPE_DISC:
return BMP_DEVICE_DISC;
default:
return NULL;
}
}
/***************************************************************************************
* Function : _SetPlayMode
*
* In : wPlayMode = mode set
*
* Out : NULL
*
* Return :
*
* Desc :
*
****************************************************************************************/
#ifdef D_GUI_CLIPS_PLAY_MODE
static void _SetPlayMode(UINT16 wPlayMode)
{
switch(wPlayMode)
{
#ifdef D_INTRO_PLAYMODE
case PLAYMODE_INTRO:
{
if(_IsAllowedIntroMode())
{
ActionEngine_SetPlayBackIntro(FgActionEnginePtr, TRUE);
//clear other play mode
ActionEngine_SetPlayBackRandom(FgActionEnginePtr, FALSE);
ActionEngine_SetPlayBackShuffle(FgActionEnginePtr, FALSE);
}
}
break;
#endif
case PLAYMODE_NORMAL:
{
ActionEngine_SetPlayBackNormal(FgActionEnginePtr);
//clear other play mode
ActionEngine_SetPlayBackIntro(FgActionEnginePtr, FALSE);
ActionEngine_SetPlayBackRandom(FgActionEnginePtr, FALSE);
ActionEngine_SetPlayBackShuffle(FgActionEnginePtr, FALSE);
}
break;
case PLAYMODE_RANDOM:
{
ActionEngine_SetPlayBackRandom(FgActionEnginePtr, TRUE);
//clear other play mode
ActionEngine_SetPlayBackIntro(FgActionEnginePtr, FALSE);
ActionEngine_SetPlayBackShuffle(FgActionEnginePtr, FALSE);
}
break;
case PLAYMODE_SHUFFLE:
{
ActionEngine_SetPlayBackShuffle(FgActionEnginePtr, TRUE);
//clear other play mode
ActionEngine_SetPlayBackIntro(FgActionEnginePtr, FALSE);
ActionEngine_SetPlayBackRandom(FgActionEnginePtr, FALSE);
}
break;
default:
break;
}
}
#endif //D_GUI_CLIPS_PLAY_MODE
/***************************************************************************************
* Function : _PlayModeChoiceAction
*
* In : pthis = Pointer to the choice object.
* eType = Getting or Setting the value
* wValue = 0 if value to get, or value to be set
*
* Out : None
*
* Return : None
*
* Desc : The Play mode choice action function.
****************************************************************************************/
#ifdef D_GUI_CLIPS_PLAY_MODE
#pragma argsused
STATIC void _PlayModeChoiceAction(MSO_OBJECT __NEAR* pThis, enMutatorType eType, UINT16 wValue)
{
MSO_CHOICE __NEAR* pChoice = (MSO_CHOICE __NEAR*)pThis;
if(eMutatorGet == eType)
{
UINT16 wCurrentMode = _GetCurrentPlayMode();
pChoice->moParam.mwCurrValIndex = OCHOICE_GetIndexFromValue(pThis, wCurrentMode);
}
else
{
_SetPlayMode(wValue);
pChoice->moParam.mwCurrValIndex = OCHOICE_GetIndexFromValue(pThis, wValue);
}
}
#endif//#ifdef D_GUI_CLIPS_PLAY_MODE
/****************************************************************************************************
* Function : _IsResumePlay
*
* Input : None
*
* Output : None
*
* Return : TRUE - Restart playback from the last point, FALSE - Restart playback from the beginning.
*
* Description : Return the condition to decide whether to restart playback from the last point or from the beginning.
*
****************************************************************************************************/
#ifndef D_CUSTOM_ClipsIsResumePlay
static BOOL _IsResumePlay(void)
{
return TRUE;
}
#endif //D_CUSTOM_ClipsIsResumePlay
/***************************************************************************************
* Operation handlers
****************************************************************************************/
/***************************************************************************************
* Function : _MenuCoreActionFinishedOperation
*
* In : pThis = Pointer to a Clips Menu object.
*
* lParam = Parameter associated with an MS_OP if any.
*
* Out : None.
*
* Return : None.
*
* Desc : This function processes the MS_OP_CORE_ACTION_FINISHED operation
* of the Clips Menu.
****************************************************************************************/
static void _MenuCoreActionFinishedOperation(MSO_OBJECT __NEAR* pThis, UINT32 lParam)
{
#ifdef JPEG_MP3_ENABLE
MSO_CLIPS_MENU __NEAR* pClipsMenu = (MSO_CLIPS_MENU __NEAR*)pThis;
UINT16 wActiveItemFg = ActionEngine_GetActiveItem(FgActionEnginePtr);
UINT16 wActiveItemBg = ActionEngine_GetActiveItem(BgActionEnginePtr);
#endif // JPEG_MP3_ENABLE
#ifdef D_GUI_CLIPS_ON_SCANB_REACH_BEGINING_RESUME_NORMAL_PLAY
if (0 == wActiveItemFg && (CoreAPI_GetScanSpeed() < 0))
{
_ResetSpeed();
ActionEngine_GotoEntry(FgActionEnginePtr, 0, eActionPlay);
MS_SendOp(MS_OP_MSG_PLAYSTATE_PLAY, 0);
return ;
}
#endif //D_GUI_CLIPS_ON_SCANB_REACH_BEGINING_RESUME_NORMAL_PLAY
if(ActionEngine_IsRepeatSingle(FgActionEnginePtr))
_ResetSpeed();
#ifdef JPEG_MP3_ENABLE
if((PtrToActionEngineObject)lParam == BgActionEnginePtr)
{
if(TRUE == _JPEGFinished(pClipsMenu))
{
MSO_OBJECT __NEAR * pList = NULL;
MSO_PAGE __NEAR* pActivePage = NULL;
// Stop the foreground action engine and swap it with the background action engine.
ActionEngine_Stop(FgActionEnginePtr);
ActionEngine_Destruct(FgActionEnginePtr);
CoreAPI_SetClipWorkingMode(CLIP_WORKING_MODE_NORMAL);
FgActionEnginePtr = BgActionEnginePtr;
FgPageIndex = BgPageIndex;
BgActionEnginePtr = NULL;
BgPageIndex = INVALID_PAGE_INDEX;
_SwitchToBrowser();
_JPEGFinished(pClipsMenu) = FALSE;
pActivePage = _GetActivePage();
#ifdef D_GUI_CLIPS_PROGRAM_VIEW
//if FG and source are different type of action engine,
//as to display FG list should switch source action engine to program list or dir browser which type is same as FG action engine's
if(ActionEngine_IsDifferentObjectType(FgActionEnginePtr, _GetSrcActionEnginePtr(pActivePage)))
{
if(ActionEngine_IsDirBrowserObject(_GetSrcActionEnginePtr(pActivePage)))
{
_GetSrcActionEnginePtr(_GetActivePage()) = *_GetPtrProgramActionEnginePtr(_GetActivePage());
MsSetProgramView(_GetActivePage());
}
else
{
_GetSrcActionEnginePtr(_GetActivePage()) = *_GetPtrBrowserActionEnginePtr(_GetActivePage());
MsClearProgramView(_GetActivePage());
}
//refresh toolkit list
MS_SendOperation(MS_FindDescendant(pActivePage, &oToolKitDescriptor),
MS_OP_REFRESH, REFRESH_LIST_DISPLAY_FIRST_ITEM);
}
#endif// D_GUI_CLIPS_PROGRAM_VIEW
// Synchronize the source action engine of the active page, refresh the browser list, and set focus to the active item.
ActionEngine_CopyObject(_GetSrcActionEnginePtr(pActivePage), FgActionEnginePtr);
// Refresh the list.
// TODO: Check if active page is the Jpeg page for multipage.
MS_SendOperation(MS_FindDescendant(pActivePage, &oBrowserVScrollListDescriptor),
MS_OP_REFRESH, REFRESH_LIST_DISPLAY_FIRST_ITEM);
ActionEngine_GotoEntry(FgActionEnginePtr, wActiveItemBg, eActionPlay);
if(!ActionEngine_NextItem(FgActionEnginePtr))
ActionEngine_Stop(FgActionEnginePtr);
pList = MS_FindDescendant(pActivePage, &oBrowserVListDescriptor);
if(MS_IsFocused(pList))
MS_SET_BROWSERVLIST_FOCUS_ON_ACTIVE(pList);
}
else if(FALSE == ActionEngine_CoreActionFinished(BgActionEnginePtr))
{
// MUST destruct Bg when finished.
// Can't resume MP3
// Reset the MP3+JPEG simultaneous mode.
// MUST stop the foreground playback and restart it after clearing CoreAPI_SetClipWorkingMode(CLIP_WORKING_MODE_SIMULTANEOUS)
//The ucode will be reloaded, JPEG can't run without MP3 on MP3+JPEG ucode
_StopPlayback();
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -