📄 pbc_ig.cpp
字号:
/*****************************************************************************
******************************************************************************
** **
** Copyright (c) 2005-2006 Videon Central, Inc. **
** All rights reserved. **
** **
** The computer program contained herein contains proprietary information **
** which is the property of Videon Central, Inc. The program may be used **
** and/or copied only with the written permission of Videon Central, Inc. **
** or in accordance with the terms and conditions stipulated in the **
** agreement/contract under which the programs have been supplied. **
** **
******************************************************************************
*****************************************************************************/
/**
* @file pbc_ig.cpp
*
* Interactive Graphics module of the playback control engine.
* This API is intended to be private and used by other Playback
* Control Engine modules only.
*
* $Id: pbc_ig.cpp,v 1.18 2007/01/26 22:31:14 rbehe Exp $
*/
#include "vdvd_types.h"
#include "pbc_ig.h"
#include "playctrl.h"
#include "pbc_types.h"
#include "pbc_register.h"
#include "usrapi.h"
#include "dbgprint.h"
#ifdef DMALLOC
#include "dmalloc.h"
#endif
/* Debug macros */
#define DBG_PBCIG DBG_ERROR
#define DBG_ON(x) (DBG_PBCIG >= x)
/**
* PbcIGSelectButtonPage -- Change the selected Page and/or Button
*
* @param
* hPBC -- handle to playback control engine private data
* data1 -- page number
* data2 -- not used
* data3 -- not used
*
* @retval
* PLAYCTRL_STATUS
*/
PLAYCTRL_STATUS PbcIGSelectButtonPage(PBC_HANDLE *hPBC, ULONG data1, ULONG data2, ULONG data3)
{
DBGPRINT(DBG_ON(DBG_TRACE), ("PbcIGSelectButtonPage()\n"));
/* data1 is button id, data2 is page id, data3 is flags */
PE_ISTREAMCTRL_IG_PARAM ig_param;
/* configure command */
ig_param.cmd = PE_IG_BTN_PAGE_SELECT;
ig_param.btn_number_id = data1; /* button id */
ig_param.pg_id = data2; /* page id */
ig_param.flags = (uint8)(data3); /* flags */
/* send to PE for processing */
if (PEiStreamCtrlSendIGCmd(hPBC->hPE, &ig_param) != PE_SUCCESS)
{
return (PLAYCTRL_FAILURE);
}
return (PLAYCTRL_SUCCESS);
}
/**
* PbcIGPopUpOn -- Display the pop-up menu.
*
* @param
* hPBC -- handle to playback control engine private data
* data1 -- not used
* data2 -- not used
* data3 -- not used
*
* @retval
* PLAYCTRL_STATUS
*/
PLAYCTRL_STATUS PbcIGPopUpOn(PBC_HANDLE *hPBC, ULONG data1, ULONG data2, ULONG data3)
{
PE_ISTREAMCTRL_IG_PARAM ig_param;
DBGPRINT(DBG_ON(DBG_TRACE), ("PbcIGPopUpOn()\n"));
/* configure command */
ig_param.cmd = PE_IG_POPUP_ON;
/* send to PE for processing */
if (PEiStreamCtrlSendIGCmd(hPBC->hPE, &ig_param) != PE_SUCCESS)
{
return (PLAYCTRL_FAILURE);
}
return (PLAYCTRL_SUCCESS);
}
/**
* PbcIGPopUpOff -- Clear the pop-up menu display.
*
* @param
* hPBC -- handle to playback control engine private data
* data1 -- not used
* data2 -- not used
* data3 -- not used
*
* @retval
* PLAYCTRL_STATUS
*/
PLAYCTRL_STATUS PbcIGPopUpOff(PBC_HANDLE *hPBC, ULONG data1, ULONG data2, ULONG data3)
{
PE_ISTREAMCTRL_IG_PARAM ig_param;
DBGPRINT(DBG_ON(DBG_TRACE), ("PbcIGPopUpOff()\n"));
/* configure command */
ig_param.cmd = PE_IG_POPUP_OFF;
/* send to PE for processing */
if (PEiStreamCtrlSendIGCmd(hPBC->hPE, &ig_param) != PE_SUCCESS)
{
return (PLAYCTRL_FAILURE);
}
return (PLAYCTRL_SUCCESS);
}
/**
* PbcIGEnableButton -- Enable a button with the specified button id.
*
* @param
* hPBC -- handle to playback control engine private data
* data1 -- button id
* data2 -- not used
* data3 -- not used
*
* @retval
* PLAYCTRL_STATUS
*/
PLAYCTRL_STATUS PbcIGEnableButton(PBC_HANDLE *hPBC, ULONG data1, ULONG data2, ULONG data3)
{
PE_ISTREAMCTRL_IG_PARAM ig_param;
DBGPRINT(DBG_ON(DBG_TRACE), ("PbcIGEnableButton()\n"));
/* configure command */
ig_param.cmd = PE_IG_BTN_ENABLE;
ig_param.btn_number_id = data1;
/* send to PE for processing */
if (PEiStreamCtrlSendIGCmd(hPBC->hPE, &ig_param) != PE_SUCCESS)
{
return (PLAYCTRL_FAILURE);
}
return (PLAYCTRL_SUCCESS);
}
/**
* PbcIGDisableButton -- Disable a button with the specified button id.
*
* @param
* hPBC -- handle to playback control engine private data
* data1 -- button id
* data2 -- not used
* data3 -- not used
*
* @retval
* PLAYCTRL_STATUS
*/
PLAYCTRL_STATUS PbcIGDisableButton(PBC_HANDLE *hPBC, ULONG data1, ULONG data2, ULONG data3)
{
PE_ISTREAMCTRL_IG_PARAM ig_param;
DBGPRINT(DBG_ON(DBG_TRACE), ("PbcIGDisableButton()\n"));
/* configure command */
ig_param.cmd = PE_IG_BTN_DISABLE;
ig_param.btn_number_id = data1;
/* send to PE for processing */
if (PEiStreamCtrlSendIGCmd(hPBC->hPE, &ig_param) != PE_SUCCESS)
{
return (PLAYCTRL_FAILURE);
}
return (PLAYCTRL_SUCCESS);
}
/**
* PbcIGMoveUpSelectedButton -- Change the button currently in the selected state to
* the normal state and the predetermined up-side button
* to the selected state.
*
* @param
* hPBC -- handle to playback control engine private data
* data1 -- not used
* data2 -- not used
* data3 -- not used
*
* @retval
* PLAYCTRL_STATUS
*/
PLAYCTRL_STATUS PbcIGMoveUpSelectedButton(PBC_HANDLE *hPBC, ULONG data1, ULONG data2, ULONG data3)
{
DBGPRINT(DBG_ON(DBG_TRACE), ("PbcIGMoveUpSelectedButton()\n"));
/* The selected button cannot be changed when in the paused state */
if (hPBC->tState != PLAYCTRL_STATE_PAUSE)
{
PE_ISTREAMCTRL_IG_PARAM ig_param;
/* configure command */
ig_param.cmd = PE_IG_BTN_UP;
/* send to PE for processing */
if (PEiStreamCtrlSendIGCmd(hPBC->hPE, &ig_param) != PE_SUCCESS)
{
return (PLAYCTRL_FAILURE);
}
}
else
{
/* menu navigation while paused is prohibited */
UsrSendProhibitedEvent(VDVD_INFO_PROH_NORMAL, 0);
}
return (PLAYCTRL_SUCCESS);
}
/**
* PbcIGMoveDownSelectedButton -- Change the button currently in the selected state to
* the normal state and the predetermined down-side button
* to the selected state.
*
* @param
* hPBC -- handle to playback control engine private data
* data1 -- not used
* data2 -- not used
* data3 -- not used
*
* @retval
* PLAYCTRL_STATUS
*/
PLAYCTRL_STATUS PbcIGMoveDownSelectedButton(PBC_HANDLE *hPBC, ULONG data1, ULONG data2, ULONG data3)
{
DBGPRINT(DBG_ON(DBG_TRACE), ("PbcIGMoveDownSelectedButton()\n"));
/* The selected button cannot be changed when in the paused state */
if (hPBC->tState != PLAYCTRL_STATE_PAUSE)
{
PE_ISTREAMCTRL_IG_PARAM ig_param;
/* configure command */
ig_param.cmd = PE_IG_BTN_DOWN;
/* send to PE for processing */
if (PEiStreamCtrlSendIGCmd(hPBC->hPE, &ig_param) != PE_SUCCESS)
{
return (PLAYCTRL_FAILURE);
}
}
else
{
/* menu navigation while paused is prohibited */
UsrSendProhibitedEvent(VDVD_INFO_PROH_NORMAL, 0);
}
return (PLAYCTRL_SUCCESS);
}
/**
* PbcIGMoveLeftSelectedButton -- Change the button currently in the selected state to
* the normal state and the predetermined left-side button
* to the selected state.
*
* @param
* hPBC -- handle to playback control engine private data
* data1 -- not used
* data2 -- not used
* data3 -- not used
*
* @retval
* PLAYCTRL_STATUS
*/
PLAYCTRL_STATUS PbcIGMoveLeftSelectedButton(PBC_HANDLE *hPBC, ULONG data1, ULONG data2, ULONG data3)
{
DBGPRINT(DBG_ON(DBG_TRACE), ("PbcIGMoveLeftSelectedButton()\n"));
/* The selected button cannot be changed when in the paused state */
if (hPBC->tState != PLAYCTRL_STATE_PAUSE)
{
PE_ISTREAMCTRL_IG_PARAM ig_param;
/* configure command */
ig_param.cmd = PE_IG_BTN_LEFT;
/* send to PE for processing */
if (PEiStreamCtrlSendIGCmd(hPBC->hPE, &ig_param) != PE_SUCCESS)
{
return (PLAYCTRL_FAILURE);
}
}
else
{
/* menu navigation while paused is prohibited */
UsrSendProhibitedEvent(VDVD_INFO_PROH_NORMAL, 0);
}
return (PLAYCTRL_SUCCESS);
}
/**
* PbcIGMoveRightSelectedButton -- Change the button currently in the selected state to
* the normal state and the predetermined right-side button
* to the selected state.
*
* @param
* hPBC -- handle to playback control engine private data
* data1 -- not used
* data2 -- not used
* data3 -- not used
*
* @retval
* PLAYCTRL_STATUS
*/
PLAYCTRL_STATUS PbcIGMoveRightSelectedButton(PBC_HANDLE *hPBC, ULONG data1, ULONG data2, ULONG data3)
{
DBGPRINT(DBG_ON(DBG_TRACE), ("PbcIGMoveRightSelectedButton()\n"));
/* The selected button cannot be changed when in the paused state */
if (hPBC->tState != PLAYCTRL_STATE_PAUSE)
{
PE_ISTREAMCTRL_IG_PARAM ig_param;
/* configure command */
ig_param.cmd = PE_IG_BTN_RIGHT;
/* send to PE for processing */
if (PEiStreamCtrlSendIGCmd(hPBC->hPE, &ig_param) != PE_SUCCESS)
{
return (PLAYCTRL_FAILURE);
}
}
else
{
/* menu navigation while paused is prohibited */
UsrSendProhibitedEvent(VDVD_INFO_PROH_NORMAL, 0);
}
return (PLAYCTRL_SUCCESS);
}
/**
* PbcIGSelectButton -- Change the button currently in the selected state to the normal
* state and the button with the specified button id to the selected state.
*
* @param
* hPBC -- handle to playback control engine private data
* data1 -- button id
* data2 -- boolean: 0=numeric selection, 1=id selection
* data3 -- not used
*
* @retval
* PLAYCTRL_STATUS
*/
PLAYCTRL_STATUS PbcIGSelectButton(PBC_HANDLE *hPBC, ULONG data1, ULONG data2, ULONG data3)
{
DBGPRINT(DBG_ON(DBG_TRACE), ("PbcIGSelectButton()\n"));
if (hPBC->tState != PLAYCTRL_STATE_PAUSE)
{
PE_ISTREAMCTRL_IG_PARAM ig_param;
/* configure command */
if (data2 == 0)
{
ig_param.cmd = PE_IG_BTN_SELECT_NUMERIC;
ig_param.btn_number_id = data1;
}
else
{
DbgPrint(("Error in Numeric selection of button\n"));
}
/* send to PE for processing */
if (PEiStreamCtrlSendIGCmd(hPBC->hPE, &ig_param) != PE_SUCCESS)
{
return (PLAYCTRL_FAILURE);
}
}
else
{
/* menu navigation while paused is prohibited */
UsrSendProhibitedEvent(VDVD_INFO_PROH_NORMAL, 0);
}
return (PLAYCTRL_SUCCESS);
}
/**
* PbcIGActivateButton -- Activate the button in the selected state.
*
* @param
* hPBC -- handle to playback control engine private data
* data1 -- not used
* data2 -- not used
* data3 -- not used
*
* @retval
* PLAYCTRL_STATUS
*/
PLAYCTRL_STATUS PbcIGActivateButton(PBC_HANDLE *hPBC, ULONG data1, ULONG data2, ULONG data3)
{
DBGPRINT(DBG_ON(DBG_TRACE), ("PbcIGActivateButton()\n"));
if (hPBC->tState != PLAYCTRL_STATE_PAUSE)
{
PE_ISTREAMCTRL_IG_PARAM ig_param;
/* configure command */
ig_param.cmd = PE_IG_BTN_ACTIVATE;
/* send to PE for processing */
if (PEiStreamCtrlSendIGCmd(hPBC->hPE, &ig_param) != PE_SUCCESS)
{
return (PLAYCTRL_FAILURE);
}
}
else
{
/* menu navigation while paused is prohibited */
UsrSendProhibitedEvent(VDVD_INFO_PROH_NORMAL, 0);
}
return (PLAYCTRL_SUCCESS);
}
/**
* PbcIGSelectAndActivateButton -- Select and activate the specified button.
*
* @param
* hPBC -- handle to playback control engine private data
* data1 -- button id
* data2 -- not used
* data3 -- not used
*
* @retval
* PLAYCTRL_STATUS
*/
PLAYCTRL_STATUS PbcIGSelectAndActivateButton(PBC_HANDLE *hPBC, ULONG data1, ULONG data2, ULONG data3)
{
DBGPRINT(DBG_ON(DBG_TRACE), ("PbcIGSelectAndActivateButton()\n"));
if (hPBC->tState != PLAYCTRL_STATE_PAUSE)
{
PE_ISTREAMCTRL_IG_PARAM ig_param;
/* configure command */
ig_param.cmd = PE_IG_BTN_SELECTANDACTIVATE_NUMERIC;
ig_param.btn_number_id = data1;
/* send to PE for processing */
if (PEiStreamCtrlSendIGCmd(hPBC->hPE, &ig_param) != PE_SUCCESS)
{
return (PLAYCTRL_FAILURE);
}
}
else
{
/* menu navigation while paused is prohibited */
UsrSendProhibitedEvent(VDVD_INFO_PROH_NORMAL, 0);
}
return (PLAYCTRL_SUCCESS);
}
PLAYCTRL_STATUS PbcIGActivateButtonComplete(PBC_HANDLE *hPBC, ULONG data1, ULONG data2, ULONG data3)
{
PE_ISTREAMCTRL_IG_PARAM ig_param;
DBGPRINT(DBG_ON(DBG_TRACE), ("PbcIGActivateButtonComplete()\n"));
/* configure command */
ig_param.cmd = PE_IG_BTN_CMDS_DONE;
ig_param.context = (PVOID)data1;
/* send to PE for processing */
if (PEiStreamCtrlSendIGCmd(hPBC->hPE, &ig_param) != PE_SUCCESS)
{
return (PLAYCTRL_FAILURE);
}
return (PLAYCTRL_SUCCESS);
}
PLAYCTRL_STATUS PbcIGResetUserTimeout(PBC_HANDLE *hPBC, ULONG data1, ULONG data2, ULONG data3)
{
PE_ISTREAMCTRL_IG_PARAM ig_param;
DBGPRINT(DBG_ON(DBG_TRACE), ("PbcIGResetUserTimeout()\n"));
/* configure command */
ig_param.cmd = PE_IG_RESET_USERTIMEOUT;
/* send to PE for processing */
if (PEiStreamCtrlSendIGCmd(hPBC->hPE, &ig_param) != PE_SUCCESS)
{
return (PLAYCTRL_FAILURE);
}
return (PLAYCTRL_SUCCESS);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -