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

📄 clips_menu.c

📁 ZORAN 962/966 SOURCE CODE,DVD chip
💻 C
📖 第 1 页 / 共 5 页
字号:
			return;
		poBrowserParam->mbCdgInGraphicView = FALSE;
		go_CurrentLayout.m_bOSDBufferNum = OSD_BUFFER_0;
		OSDSetPlane();
	}
	OSDSetMemoryRange();
	OSDSetDisplayRange();
}
#endif//D_CD_GRAPHIC_ENABLED
/***************************************************************************************
*	Function	:	_IsSlideShowPlaying
*
*	In		:	None.
*
*	Out 		:	TRUE if MP3+JPEG are currently playing.
*
*	Desc		:	This function checks if the background API object is currently playing.
*				The sole purpose of the background API object is to play MP3 during
*				slideshow.
****************************************************************************************/
#ifdef JPEG_MP3_ENABLE
#if 0
static BOOL _IsSlideShowPlaying(void)
{
	if(ActionEngine_AmIPlaying(BgActionEnginePtr, ActionEngine_GetActiveItem(BgActionEnginePtr)))
		return TRUE;

	return FALSE;
}
#endif
#endif // JPEG_MP3_ENABLE

/***************************************************************************************
*	Function	:	_RefreshIntroButton
*
*	In		:	pPage	=	Pointer to the page who's "Intro" tool button needs to be refresed.
*
*	Out 		:	None.
*
*	Desc		:	Checks if the intro mode is currently set for the source API object, and refreshes the
*				"Intro" button to appear dipressed if necessary.
****************************************************************************************/
#ifdef D_GUI_TOOLKIT_ADD_INTRO
static void _RefreshIntroButton(MSO_BROWSER_PAGE __NEAR* pPage)
{
	MS_ASSERT(NULL != pPage);
	
	if(TRUE == ActionEngine_IsPlaybackIntro(_GetSrcActionEnginePtr(pPage)))
	{
		if(NULL_INDEX != DirBrowser_FindFile((PtrToDirBrowser)_GetSrcActionEnginePtr(pPage), NULL_INDEX, CLIPTYPE_JPEG, FALSE))
		{
			MSO_OBJECT __NEAR* pObject = MS_FindDescendant(pPage, &oIntroButtonDescriptor);
			ActionEngine_SetPlayBackIntro(_GetSrcActionEnginePtr(pPage), FALSE);

			if(NULL != pObject)
			{
				MS_ResetRadio(pObject);
				MS_DisplayAddObject(pObject);
			}
		}
	}
}
#endif // D_GUI_TOOLKIT_ADD_INTRO


/***************************************************************************************
*	Function	:	_PrepareFgBeforeNewAction
*
*	In		:	None.
*
*	Out 		:	None.
*
*	Desc	:	The purpose of this function is to synchronize the foreground API object with the source
*				currently active page.
****************************************************************************************/
static void _PrepareFgBeforeNewAction(void)
{
	MSO_CLIPS_MENU __NEAR* pClipsMenu 	= _GetMsoClipsMenu();
	MSO_PAGE __NEAR* pActivePage 		= _GetActivePage();
	PtrToActionEngineObject pApiObjectSrc 	= _GetSrcActionEnginePtr(pActivePage);
	ActionEngineObject oActionEngineObject;
	BOOL bPreserveFgPlayModes = FALSE;

	MS_ASSERT(NULL != pActivePage);

	// If playing on another page, stop the current playback and destruct the engine
	if(NULL != FgActionEnginePtr)
	{
		// Destruct Fg to get it re-construct if changed page, changed directory or changed the file type filter
		if (	(OPAGE_GetPageIndex(pActivePage) != FgPageIndex)
			||_AreWorkDirectoyDifferent(FgActionEnginePtr, pApiObjectSrc)
			||(ActionEngine_IsDirBrowserObject(pApiObjectSrc)&&_IsFileTypeFilterDifferent(FgActionEnginePtr, pApiObjectSrc)))
		{
			// Copy the playmodes of Fg to temporary object, it will be copied back the Fg later
			memcpy(&(oActionEngineObject), FgActionEnginePtr, sizeof(ActionEngineObject));
			bPreserveFgPlayModes = TRUE;

			ActionEngine_Stop(FgActionEnginePtr);
			ActionEngine_Destruct(FgActionEnginePtr);
			FgActionEnginePtr = NULL;
			FgPageIndex = INVALID_PAGE_INDEX;
		}
	}

	// If no engine, build according to active page, copying the source engine attached to it.
	if((NULL == FgActionEnginePtr))
	{
			FgActionEnginePtr = ActionEngine_Construct_Ex(pApiObjectSrc->mObjectType, (UiIdentifier)pClipsMenu, FALSE);
		ActionEngine_CopyObject(FgActionEnginePtr, pApiObjectSrc);
		if(bPreserveFgPlayModes)
			_CopyPlaymode(FgActionEnginePtr, (PtrToActionEngineObject)&oActionEngineObject);
		MS_ASSERT(NULL != FgActionEnginePtr);

		FgPageIndex = OPAGE_GetPageIndex(pActivePage);
	}
}

/***************************************************************************************
*	Function	: 	_CopyPlaymode
*
*	In		:
*
*
*	Out		: 	None.
*
*	Return	:	None.
*
*	Desc 	:
****************************************************************************************/
static void _CopyPlaymode(PtrToActionEngineObject pActionEngineObjectDest, PtrToActionEngineObject pActionEngineObjectSource)
{
	if(ActionEngine_IsRepeatSingle(pActionEngineObjectSource))
		ActionEngine_SetRepeatSingle(pActionEngineObjectDest, TRUE);
	else if(ActionEngine_IsRepeatAll(pActionEngineObjectSource))
		ActionEngine_SetRepeatAll(pActionEngineObjectDest, TRUE);
	else
		ActionEngine_SetRepeatOff(pActionEngineObjectDest);

	if(ActionEngine_IsPlaybackNormal(pActionEngineObjectSource))
		ActionEngine_SetPlayBackNormal(pActionEngineObjectDest);

	if(ActionEngine_IsPlaybackRandom(pActionEngineObjectSource))
		ActionEngine_SetPlayBackRandom(pActionEngineObjectDest, TRUE);
	else
		ActionEngine_SetPlayBackRandom(pActionEngineObjectDest, FALSE);

	if(ActionEngine_IsPlaybackShuffle(pActionEngineObjectSource))
		ActionEngine_SetPlayBackShuffle(pActionEngineObjectDest, TRUE);
	else
		ActionEngine_SetPlayBackShuffle(pActionEngineObjectDest, FALSE);
	
	if(ActionEngine_IsPlaybackIntro(pActionEngineObjectSource))
		ActionEngine_SetPlayBackIntro(pActionEngineObjectDest, TRUE);
	else
		ActionEngine_SetPlayBackIntro(pActionEngineObjectDest, FALSE);


}
/***************************************************************************************
*	Function	: 	_StopPlayback
*
*	In		:
*
*
*	Out		: 	None.
*
*	Return	:	None.
*
*	Desc 	:
****************************************************************************************/
static BOOL _StopPlayback(void)
{
	BOOL bResult = 0;

	if(!CoreAPI_WaitForUICoreActionDone())
		return FALSE;

	_ResetSpeed();
	if(FALSE == ActionEngine_CurrItemIsRepeatABOff(FgActionEnginePtr))
	{
		ActionEngine_CurrItemRepeatABOff(FgActionEnginePtr);
		//MS_SendOp(MS_OP_MSG_PLAYMODE_REPEAT_AB, PM_REPEAT_AB_OFF);
	}

	if (ActionEngine_CurrItemStop(FgActionEnginePtr))
	{
		UINT16 wActiveItem = ActionEngine_GetActiveItem(FgActionEnginePtr);
		enClipType tClipType = ActionEngine_GetFileType(FgActionEnginePtr, wActiveItem);
		bResult = 1;

		// Cancel Repeat mode in full stop.
		if((FALSE == ActionEngine_IsRepeatOff(FgActionEnginePtr))
		&& ((PST_STOP == ActionEngine_GetPlayState(FgActionEnginePtr))
				&& ((FALSE == ActionEngine_AmIResumeStop(FgActionEnginePtr, wActiveItem))
#ifndef CLIPS_WMA_SUPPORT_RESUMESTOP
				|| _IsFileTypeWma(tClipType)
#endif // CLIPS_WMA_SUPPORT_RESUMESTOP
#ifdef D_OGG_VORBIS
				|| _IsFileTypeOgg(tClipType)
#endif
				|| _IsFileTypeJpeg(tClipType))))
		{
		_CancelRepeat();
	}
	}
	//if FG already stop we should not return right now but stop BG for next step.
	else if(ActionEngine_IsListNonStop(FgActionEnginePtr))
		return 0;

	// The stop state of fg and bg and synchronized
	if (NULL != BgActionEnginePtr)
	{	ActionEngine_Stop(BgActionEnginePtr);
		CoreAPI_SetClipWorkingMode(CLIP_WORKING_MODE_NORMAL);
		ActionEngine_Destruct(BgActionEnginePtr);
		BgActionEnginePtr = NULL;
		bResult = 1;
	}
	return bResult;
}
/***************************************************************************************
*	Function	: 	_FullStopPlayback
*
*	In		:
*
*
*	Out		: 	None.
*
*	Return	:	None.
*
*	Desc 	:
****************************************************************************************/
static BOOL _FullStopPlayback(void)
{
	if (_StopPlayback())
	{
		ActionEngine_Stop(FgActionEnginePtr);
		_CancelRepeat();
		return 1;
	}
	return 0;
}
/***************************************************************************************
*	Function	: 	_ResumeStopPlayback
*
*	In		:
*
*
*	Out		: 	None.
*
*	Return	:	None.
*
*	Desc 	:
****************************************************************************************/
static BOOL _ResumeStopPlayback(void)
{
	BOOL bResult = 0;
	if (PST_STOP != ActionEngine_GetPlayState(FgActionEnginePtr))
	{
	if (ActionEngine_CurrItemStop(FgActionEnginePtr))
		bResult = 1;
	}
	if (PST_STOP != ActionEngine_GetPlayState(BgActionEnginePtr))
	{
	if (ActionEngine_CurrItemStop(BgActionEnginePtr))
		bResult = 1;
	}
	return bResult;
}

/***************************************************************************************
*	Function	: 	_ResumePlayback
*
*	In		:
*
*
*	Out		: 	None.
*
*	Return	:	None.
*
*	Desc 	:	Handles resume play for Bg and Fg. First resumes the Bg and then Fg.
*				In case one fails, then return FALSE.
****************************************************************************************/
static BOOL _ResumePlayback(void)
{
	BOOL bResult = TRUE;
	UINT16 wFgActiveItem = ActionEngine_GetActiveItem(FgActionEnginePtr);

	if (NULL_INDEX != wFgActiveItem)
	{
		UINT16 wBgActiveItem = ActionEngine_GetActiveItem(BgActionEnginePtr);

		if (NULL_INDEX != wBgActiveItem)
		{
			MS_ASSERT(CoreAPI_IsSimultaneousMode());
			bResult = ActionEngine_CurrItemPlay(BgActionEnginePtr);
		}
		// If Bg failed, don't resume Fg.
		// Another possibility would be to clear the simultaneous mode and restart Fg (Jpeg).
		if (TRUE == bResult)
		{
			enClipType tClipType = ActionEngine_GetFileType(FgActionEnginePtr, wFgActiveItem);

			// Display background if we are about to play PHOTO or MOVIE.
			if (_IsFileTypeVideo(tClipType))
				CoreAPI_DisplayLogo(eBackground);

			if (_IsFileTypeJpeg(tClipType) || _IsFileTypeWma(tClipType))
				bResult = ActionEngine_GotoEntry(FgActionEnginePtr, wFgActiveItem, eActionPlay);
			else
				bResult = ActionEngine_CurrItemPlay(FgActionEnginePtr);
		}
	}
	else
		bResult = FALSE;

	return bResult;
}

/***************************************************************************************
* Function : _CancelRepeat
*
* In :
*
*
* Out : None.
*
* Return : None.
*
* Desc :
****************************************************************************************/
static BOOL _CancelRepeat(void)
{
	BOOL bResult = 0;

	if(FALSE == ActionEngine_IsRepeatOff(FgActionEnginePtr))
	{
		ActionEngine_SetRepeatOff(FgActionEnginePtr);
		bResult = 1;
	}

	return bResult;
}
/***************************************************************************************
* Function : _CancelRepeatAB
*
* In :
*
*
* Out : None.
*
* Return : None.
*
* Desc :
****************************************************************************************/
#ifdef D_REPEAT_CANCELS_REPEATAB
static BOOL _CancelRepeatAB(void)
{
	// Cancel Repeat
	if (FALSE == ActionEngine_CurrItemIsRepeatABOff(FgActionEnginePtr))
	{
		return (ActionEngine_CurrItemRepeatABOff(FgActionEnginePtr));
	}
	return 0;
}
#endif // D_REPEAT_CANCELS_REPEATAB
/***************************************************************************************
*	Function	: 	_ResetSpeed
*
*	In		:
*
*
*	Out		: 	None.
*
*	Return	:	None.
*
*	Desc 	:
****************************************************************************************/
static BOOL _ResetSpeed(void)
{
	BOOL bResult = 0;
	if(ActionEngine_GetScanSpeed(FgActionEnginePtr))
	{
		ActionEngine_CurrItemScan(FgActionEnginePtr, 0);
		bResult = 1;
	}
	else if(ActionEngine_GetSlowSpeed(FgActionEnginePtr))

⌨️ 快捷键说明

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