📄 modmgr.cpp
字号:
if (pvLocation == NULL)
{
DBGPRINT(DBG_ON(DBG_ERROR), ("ModMgrGetLocation: NULL pointer!\n"));
return (MODMGR_NULL_POINTER);
}
if (hModMgr == NULL)
{
DBGPRINT(DBG_ON(DBG_ERROR), ("ModMgrGetLocation: Module Manager not created!\n"));
return (MODMGR_FAILURE);
}
if (uiSize < sizeof(MODMGR_PLAY_LOCATION) )
{
DBGPRINT(DBG_ON(DBG_ERROR), ("ModMgrGetLocation: Invalid size!\n"));
return (MODMGR_FAILURE);
}
/* Get current playitem id */
PlayCtrlGetPSR(PLAYCTRL_PSR_PLAYITEM, &uiPlayitemID);
uiPlayitemID &= 0x0000ffff;
/* Get current title number */
ulTitle = ModMgrGetTitle();
/*
* Setting a bookmark is prohibited in the following cases
* 1. Current title is an interactive title.
* 2. Current title is the top-menu.
* 3. Full-stop state (no active title).
*/
if ( (hModMgr->StateInfo.tActiveTitle == MODMGR_TITLE_HDMV_INTERACTIVE) ||
(ulTitle == 0) ||
(hModMgr->StateInfo.tActiveTitle == MODMGR_TITLE_NONE) )
{
DBGPRINT(DBG_ON(DBG_TRACE), ("ModMgrGetLocation: Bookmark prohibited!\n"));
return (MODMGR_UOP_PROHIBITED);
}
/* Check active title type */
if ( (hModMgr->StateInfo.tActiveTitle == MODMGR_TITLE_HDMV_MOVIE) ||
(hModMgr->StateInfo.tActiveTitle == MODMGR_TITLE_HDMV_INTERACTIVE) )
{
/* set location handle size */
pPlayLocation->uiSize = uiSize;
/* Record all PSR's */
if (PlayCtrlCopyAllPSR(pPlayLocation->PSR, (PSR_TOTAL_NUMBER * sizeof(uint32)) ) != PLAYCTRL_SUCCESS)
{
DBGPRINT(DBG_ON(DBG_ERROR), ("ModMgrGetLocation: Failed to copy PSR's!\n"));
return (MODMGR_FAILURE);
}
/* Record all GPR's */
if (PlayCtrlCopyAllGPR(pPlayLocation->GPR, (GPR_TOTAL_NUMBER * sizeof(uint32)) ) != PLAYCTRL_SUCCESS)
{
DBGPRINT(DBG_ON(DBG_ERROR), ("ModMgrGetLocation: Failed to copy GPR's!\n"));
return (MODMGR_FAILURE);
}
/* Get play time in seconds (round up) */
pPlayLocation->uiTimeInSeconds = (PlayCtrlGetCurrentPlayListTime() / 45000) + 1;
/* Record current movie object info */
pPlayLocation->MovieObject = hModMgr->ActiveObj;
pPlayLocation->MovieObject.ulSuspendedCmdID = HdmvModGetNavCmdID();
}
#ifdef ENABLE_BDJ
else if ( (hModMgr->StateInfo.tActiveTitle == MODMGR_TITLE_BDJ_MOVIE) ||
(hModMgr->StateInfo.tActiveTitle == MODMGR_TITLE_BDJ_INTERACTIVE) )
{
DBGPRINT(DBG_ON(DBG_TRACE), ("ModMgrGetLocation: Bookmark prohibited during BDJ!\n"));
return (MODMGR_UOP_PROHIBITED);
}
#endif
else
{
DBGPRINT(DBG_ON(DBG_TRACE), ("ModMgrGetLocation: No active title, so prohibit!\n"));
return (MODMGR_UOP_PROHIBITED);
}
return (MODMGR_SUCCESS);
}
/**
* ModMgrIsPopupOn -- Return the Popup Menu On/Off State.
*
* @param
* None
*
* @retval
* FALSE - Pop up is OFF
* TRUE - Pop up is ON
*/
BOOLEAN ModMgrIsPopupOn(void)
{
if (hModMgr == NULL)
{
DBGPRINT(DBG_ON(DBG_ERROR), ("ModMgrIsPopupOn: Module Manager not created!\n"));
return (FALSE);
}
/* get popup menu state from playback control engine */
return ( PlayCtrlIsPopupOn() );
}
/**
* ModMgrIsButtonSelected - Check if there is an IG button currently selected.
*
* @param
* None
*
* @retval
* FALSE - No button in the selected state.
* TRUE - A button is in the selected state.
*/
BOOLEAN ModMgrIsButtonSelected(void)
{
if (hModMgr == NULL)
{
DBGPRINT(DBG_ON(DBG_ERROR), ("ModMgrIsButtonSelected: Module Manager not created!\n"));
return (FALSE);
}
/* get ig button state from playback control engine */
return ( PlayCtrlIsButtonSelected() );
}
/**
* ModMgrGetRepeatMode -- Return the repeat mode.
*
* @param
* None
*
* @retval
* VDVD_INFO_REPEAT repeat mode
*/
UBYTE ModMgrGetRepeatMode(void)
{
uint8 repeat_mode = VDVD_INFO_REPEAT_OFF;
if (hModMgr == NULL)
{
DBGPRINT(DBG_ON(DBG_ERROR), ("ModMgrGetRepeatMode: Module Manager not created!\n"));
}
else if ( ( (hModMgr->StateInfo.tActiveTitle == MODMGR_TITLE_HDMV_MOVIE) ||
(hModMgr->StateInfo.tActiveTitle == MODMGR_TITLE_HDMV_INTERACTIVE) ) &&
(HdmvModIsTitleRepeatOn() == TRUE) )
{
repeat_mode = VDVD_INFO_REPEAT_TITLE;
}
#ifdef VDVD_ENABLE_BDJ
else if ( ( (hModMgr->StateInfo.tActiveTitle == MODMGR_TITLE_BDJ_MOVIE) ||
(hModMgr->StateInfo.tActiveTitle == MODMGR_TITLE_BDJ_INTERACTIVE) ) &&
(hModMgr->fBDJTitleRepeat) )
{
repeat_mode = VDVD_INFO_REPEAT_TITLE;
}
#endif
else
{
/* get repeat mode from playback control engine */
repeat_mode = PlayCtrlGetRepeatMode();
}
return (repeat_mode);
}
/**
* MogMgrGetPlayRate -- Get the current play rate of the BD-ROM navigator
*
* @param
* none
*
* @retval
* ULONG
*/
int32 MogMgrGetPlayRate(void)
{
if (hModMgr == NULL)
{
DBGPRINT(DBG_ON(DBG_ERROR), ("ModMgrGetTitle: Module Manager not created!\n"));
return (0);
}
else
{
return (PlayCtrlGetPlayRate());
}
}
/**
* MogMgrGetPlayState -- Get the current play state of the BD-ROM navigator
*
* @param
* none
*
* @retval
* MODMGR_PLAYSTATE
*/
MODMGR_PLAYSTATE MogMgrGetPlayState(void)
{
PLAYCTRL_STATE tPBCState;
MODMGR_PLAYSTATE tPlayState = MODMGR_PLAYSTATE_INVALID;
if (hModMgr == NULL)
{
DBGPRINT(DBG_ON(DBG_ERROR), ("MogMgrGetPlayState: Module Manager not created!\n"));
}
else
{
if ( (hModMgr->StateInfo.tState == MODMGR_STATE_TERMINATED) ||
(hModMgr->StateInfo.tState == MODMGR_STATE_TERMINATED_FIRSTPLAY) )
{
tPlayState = MODMGR_PLAYSTATE_FULLSTOP;
}
else if (hModMgr->StateInfo.tState == MODMGR_STATE_HOLD)
{
tPlayState = MODMGR_PLAYSTATE_STOP;
}
else
{
/* Get state of pbc engine */
tPBCState = PlayCtrlGetState();
/* Check the pbc engine state */
if (tPBCState == PLAYCTRL_STATE_STOP)
{
#ifdef VDVD_ENABLE_BDJ
if ( (hModMgr->StateInfo.tActiveTitle == MODMGR_TITLE_BDJ_MOVIE) ||
(hModMgr->StateInfo.tActiveTitle == MODMGR_TITLE_BDJ_INTERACTIVE) )
{
/* BD-J title do not always have an AV presentation so if we have an active BD-J title_prev
* return play even if the playback control engine is not active */
tPlayState = MODMGR_PLAYSTATE_PLAY;
}
else
{
tPlayState = MODMGR_PLAYSTATE_FULLSTOP;
}
#else
tPlayState = MODMGR_PLAYSTATE_FULLSTOP;
#endif
}
else if (tPBCState == PLAYCTRL_STATE_PAUSE)
{
/* Check for still */
if (PlayCtrlIsStillOn() == TRUE)
{
tPlayState = MODMGR_PLAYSTATE_STILL;
}
else
{
tPlayState = MODMGR_PLAYSTATE_PAUSE;
}
}
else if (tPBCState == PLAYCTRL_STATE_PLAY)
{
/* Check for still */
if (PlayCtrlIsStillOn() == TRUE)
{
tPlayState = MODMGR_PLAYSTATE_STILL;
}
else
{
int rate;
/* Get play rate */
rate = PlayCtrlGetPlayRate();
/* Determine play state according to play rate */
if ( (rate == 0) || (rate == 1000) )
{
tPlayState = MODMGR_PLAYSTATE_PLAY;
}
else if ( (rate == 1) || (rate == -1) )
{
tPlayState = MODMGR_PLAYSTATE_PAUSE;
}
else if (rate > 1000)
{
tPlayState = MODMGR_PLAYSTATE_FAST_F;
}
else if (rate > 0)
{
tPlayState = MODMGR_PLAYSTATE_SLOW_F;
}
else if (rate > -1000)
{
tPlayState = MODMGR_PLAYSTATE_SLOW_R;
}
else
{
tPlayState = MODMGR_PLAYSTATE_FAST_R;
}
}
}
}
}
return (tPlayState);
}
/**
* ModMgrGetTitle -- Get the current title number
*
* @param
* none
*
* @retval
* Title number
*/
ULONG ModMgrGetTitle(void)
{
uint32 uiTitle = 0;
if (hModMgr == NULL)
{
DBGPRINT(DBG_ON(DBG_ERROR), ("ModMgrGetTitle: Module Manager not created!\n"));
}
else
{
/* Get status register for title number */
PlayCtrlGetPSR(PLAYCTRL_PSR_TITLE, &uiTitle);
}
return (uiTitle & 0x0000ffff);
}
/**
* ModMgrGetTitleInfo -- Get the current title information
*
* @param
* none
*
* @retval
* VDVD_TITLE_INFO bit-mask
*/
ULONG ModMgrGetTitleInfo(void)
{
ULONG ulTitleInfo = VDVD_TITLE_UNKNOWN;
uint8 app_type;
if (hModMgr == NULL)
{
DBGPRINT(DBG_ON(DBG_ERROR), ("ModMgrGetTitleInfo: Module Manager not created!\n"));
}
else if (hModMgr->StateInfo.tActiveTitle == MODMGR_TITLE_NONE)
{
DBGPRINT(DBG_ON(DBG_ERROR), ("ModMgrGetTitleInfo: No active title!\n"));
}
else
{
ULONG ulTitleNumber;
INDEX_OBJ_REF *pTitleObj = NULL;
/* Check for BDJ/HDMV and Movie/Interactive title types */
if (hModMgr->StateInfo.tActiveTitle == MODMGR_TITLE_BDJ_MOVIE)
{
ulTitleInfo |= VDVD_TITLE_BDJ;
ulTitleInfo |= VDVD_TITLE_BD_MOVIE;
}
else if (hModMgr->StateInfo.tActiveTitle == MODMGR_TITLE_BDJ_INTERACTIVE)
{
ulTitleInfo |= VDVD_TITLE_BDJ;
ulTitleInfo |= VDVD_TITLE_BD_INTERACTIVE;
}
else if (hModMgr->StateInfo.tActiveTitle == MODMGR_TITLE_HDMV_MOVIE)
{
ulTitleInfo |= VDVD_TITLE_HDMV;
ulTitleInfo |= VDVD_TITLE_BD_MOVIE;
}
else if (hModMgr->StateInfo.tActiveTitle == MODMGR_TITLE_HDMV_INTERACTIVE)
{
ulTitleInfo |= VDVD_TITLE_HDMV;
ulTitleInfo |= VDVD_TITLE_BD_INTERACTIVE;
}
/* Get the application type of the playlist */
app_type = PlayCtrlGetCurrentApplicationType();
/* Check if title is a slideshow */
if ( (app_type == APPTYPE_MAIN_TIMEBASE_SLIDESHOW) || (app_type == APPTYPE_MAIN_BROWSABLE_SLIDESHOW) )
{
ulTitleInfo |= VDVD_TITLE_BD_SLIDESHOW;
}
/* get current title number */
ulTitleNumber = ModMgrGetTitle();
/* get title object */
if (ulTitleNumber == 0)
{
pTitleObj = IndexGetTopMenu();
}
else if (ulTitleNumber == 0xffff)
{
pTitleObj = IndexGetFirstPlayback();
}
else
{
pTitleObj = IndexGetTitle((USHORT)ulTitleNumber);
}
if (pTitleObj != NULL)
{
/* check if title access is prohibited or if if osd during this title is prohibited*/
if (pTitleObj->tAccessType == INDEX_TITLE_ACCESS_PROHIBIT)
{
ulTitleInfo |= VDVD_TITLE_ACCESS_PROHIBIT;
}
else if (pTitleObj->tAccessType == INDEX_TITLE_ACCESS_PROHIBIT_NO_OSD)
{
ulTitleInfo |= VDVD_TITLE_OSD_PROHIBIT;
}
}
}
return (ulTitleInfo);
}
/**
* ModMgrGetChapter -- Get the current chapter number
*
* @param
* none
*
* @retval
* Chapter number
*/
ULONG ModMgrGetChapter(void)
{
uint32 uiChapter = 0;
if (hModMgr == NULL)
{
DBGPRINT(DBG_ON(DBG_ERROR), ("ModMgrGetChapter: Module Manager not created!\n"));
}
else
{
/*
* If current title is an interactive title, then chapter numbers don't exist,
* so get the current entry-mark id, and use that for the chapter number.
*/
if ( (hModMgr->StateInfo.tActiveTitle == MODMGR_TITLE_HDMV_MOVIE) ||
(hModMgr->StateInfo.tActiveTitle == MODMGR_TITLE_BDJ_MOVIE) )
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -