📄 psl_process_user_input.cpp
字号:
/*****************************************************************************
******************************************************************************
** **
** Copyright (c) 2002 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 psl_process_user_input.cpp
*
* $Revision: 1.15 $
*
* Process User Input Module of the PSL.
*
*/
#include <string.h>
#include "vdvd_types.h"
#include "psl_process_user_input.h"
#include "psl_interface.h"
#include "psl_general.h"
#include "psl_types.h"
#include "psl_external_interface.h"
#include "psl_screen_layout.h"
#include "psl_process_key.h"
#include "dbgprint.h"
/* Debug macros */
#define DBG_PSL_USER_INPUT DBG_ERROR
#define DBG_ON(x) (DBG_PSL_USER_INPUT >= x)
/**
* PslProcessUserInputPower -- Process the power command
*
* @param
* pPSL - handle to internal PSL data
* ulInfo - info param with the command
*
* @retval
* PSL_SUCCESS if successful
* PSL_FAILURE if not successful
*/
PSL_STATUS PslProcessUserInputPower(PSL_HANDLE *pPSL, ULONG ulInfo)
{
DBGPRINT(DBG_ON(DBG_TRACE), ("PslProcessUserInputPower: ENTER\n"));
if (pPSL == NULL)
{
DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessUserInputPower: Invalid psl handle\n"));
return (PSL_NULL_POINTER);
}
/* If generic osd is active, clear it */
if (PslScreenLayoutIsGenericActive(pPSL) == TRUE)
{
if (PslScreenLayoutClearGeneric(pPSL) != PSL_SUCCESS)
{
DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessUserInputPower: failed to clear generic osd!\n"));
return (PSL_FAILURE);
}
}
/* If parental control is active, clear it */
if (PslScreenLayoutIsParentalControlActive(pPSL) == TRUE)
{
if (PslScreenLayoutClearParentalControl(pPSL) != PSL_SUCCESS)
{
DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessUserInputPower: failed to clear parental control!\n"));
return (PSL_FAILURE);
}
}
/* If setup menu is active, clear it */
if (PslScreenLayoutIsSetupMenuActive(pPSL) == TRUE)
{
/* clear setup menu */
if (PslScreenLayoutClearSetupMenu(pPSL) != PSL_SUCCESS)
{
DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessUserInputPower: Failure clearing setup menu!\n"));
return (PSL_FAILURE);
}
}
/* If status display is active, clear it */
if (PslScreenLayoutIsStatusDisplayActive(pPSL) == TRUE)
{
/* clear status display */
if (PslScreenLayoutClearStatusDisplay(pPSL) != PSL_SUCCESS)
{
DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessUserInputPower: Failure clearing status display!\n"));
return (PSL_FAILURE);
}
}
/* If status menu is active, clear it */
if (PslScreenLayoutIsStatusMenuActive(pPSL) == TRUE)
{
/* clear status menu */
if (PslScreenLayoutClearStatusMenu(pPSL) != PSL_SUCCESS)
{
DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessUserInputPower: Failure clearing status menu!\n"));
return (PSL_FAILURE);
}
}
/* If cdda gui is active, clear it */
if (PslScreenLayoutIsCDDAActive(pPSL) == TRUE)
{
/* clear cdda gui */
if (PslScreenLayoutClearCDDAInterface(pPSL) != PSL_SUCCESS)
{
DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessUserInputPower: Failure clearing cdda gui!\n"));
return (PSL_FAILURE);
}
}
/* Send command to the nav to be processed */
if (PslExternalSendNavCommand(PSL_USER_CMD_POWER, ulInfo) != PSL_SUCCESS)
{
DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessUserInputPower: Failure sending command to nav\n"));
return (PSL_FAILURE);
}
pPSL->powerState = !pPSL->powerState;
return (PSL_SUCCESS);
}
/**
* PslProcessUserInputPlay -- Process the play command
*
* @param
* pPSL - handle to internal PSL data
* ulInfo - info param with the command
*
* @retval
* PSL_SUCCESS if successful
* PSL_FAILURE if not successful
*/
PSL_STATUS PslProcessUserInputPlay(PSL_HANDLE *pPSL, ULONG ulInfo)
{
ULONG tStatus;
DBGPRINT(DBG_ON(DBG_TRACE), ("PslProcessUserInputPlay: ENTER\n"));
if (pPSL == NULL)
{
DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessUserInputPlay: Invalid psl handle\n"));
return (PSL_NULL_POINTER);
}
/* Get player status */
tStatus = PslExternalGetNavStatus();
/* If standby is on, do not process the user input */
if (tStatus != (ULONG)PSL_STATUS_STANDBY)
{
/* If parental control is active, do not process the user input */
if (PslScreenLayoutIsParentalControlActive(pPSL) == FALSE)
{
/*
* If currently on a still, issue a still off command.
* If in fast/slow mode, pause, etc then resume normal speed.
*/
if (tStatus == PSL_STATUS_STILL)
{
/* Send still-off command to the nav to be processed */
if (PslExternalSendNavCommand(PSL_USER_CMD_STILL_OFF, 0) != PSL_SUCCESS)
{
DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessUserInputPlay: Failure sending command to nav\n"));
return (PSL_FAILURE);
}
}
else if ( (tStatus == PSL_STATUS_FAST_FWD) || (tStatus == PSL_STATUS_SLOW_FWD) || (tStatus == PSL_STATUS_FAST_RWD) )
{
/* Send fwd play command to the nav to be processed */
if (PslExternalSendNavCommand(PSL_USER_CMD_FWD_PLAY, 1000) != PSL_SUCCESS)
{
DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessUserInputPlay: Failure sending command to nav\n"));
return (PSL_FAILURE);
}
}
else if (tStatus == PSL_STATUS_PAUSE)
{
/* Send pause off command to the nav to be processed */
if (PslExternalSendNavCommand(PSL_USER_CMD_PAUSE_OFF, 0) != PSL_SUCCESS)
{
DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessUserInputPlay: Failure sending command to nav\n"));
return (PSL_FAILURE);
}
}
else
{
/* If setup menu is active, clear it */
if (PslScreenLayoutIsSetupMenuActive(pPSL) == TRUE)
{
/* clear setup menu */
if (PslScreenLayoutClearSetupMenu(pPSL) != PSL_SUCCESS)
{
DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessUserInputPlay: Failure clearing setup menu!\n"));
return (PSL_FAILURE);
}
}
/* Send command to the nav to be processed */
if (PslExternalSendNavCommand(PSL_USER_CMD_PLAY, ulInfo) != PSL_SUCCESS)
{
DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessUserInputPlay: Failure sending command to nav\n"));
return (PSL_FAILURE);
}
}
}
}
return (PSL_SUCCESS);
}
/**
* PslProcessUserInputStop -- Process the stop command
*
* @param
* pPSL - handle to internal PSL data
* ulInfo - info param with the command
*
* @retval
* PSL_SUCCESS if successful
* PSL_FAILURE if not successful
*/
PSL_STATUS PslProcessUserInputStop(PSL_HANDLE *pPSL, ULONG ulInfo)
{
DBGPRINT(DBG_ON(DBG_TRACE), ("PslProcessUserInputStop: ENTER\n"));
if (pPSL == NULL)
{
DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessUserInputStop: Invalid psl handle\n"));
return (PSL_NULL_POINTER);
}
/* If standby is on, do not process the user input */
if (PslExternalGetNavStatus() != (ULONG)PSL_STATUS_STANDBY)
{
/* If parental control is active, do not process command */
if (PslScreenLayoutIsParentalControlActive(pPSL) == FALSE)
{
/* If setup menu is active, clear it */
if (PslScreenLayoutIsSetupMenuActive(pPSL) == TRUE)
{
/* clear setup menu */
if (PslScreenLayoutClearSetupMenu(pPSL) != PSL_SUCCESS)
{
DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessUserInputStop: Failure clearing setup menu!\n"));
return (PSL_FAILURE);
}
}
/* Send command to the nav to be processed */
if (PslExternalSendNavCommand(PSL_USER_CMD_STOP, ulInfo) != PSL_SUCCESS)
{
DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessUserInputStop: Failure sending command to nav\n"));
return (PSL_FAILURE);
}
}
}
return (PSL_SUCCESS);
}
/**
* PslProcessUserInputPause -- Process the pause command
*
* @param
* pPSL - handle to internal PSL data
* ulInfo - info param with the command
*
* @retval
* PSL_SUCCESS if successful
* PSL_FAILURE if not successful
*/
PSL_STATUS PslProcessUserInputPause(PSL_HANDLE *pPSL, ULONG ulInfo)
{
ULONG tStatus;
DBGPRINT(DBG_ON(DBG_TRACE), ("PslProcessUserInputPause: ENTER\n"));
if (pPSL == NULL)
{
DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessUserInputPause: Invalid psl handle\n"));
return (PSL_NULL_POINTER);
}
/* Get player status */
tStatus = PslExternalGetNavStatus();
/* If standby is on, do not process the user input */
if (tStatus != (ULONG)PSL_STATUS_STANDBY)
{
/* If parental control is active, do not process command */
if (PslScreenLayoutIsParentalControlActive(pPSL) == FALSE)
{
/* If setup menu is active, do not process the command */
if (PslScreenLayoutIsSetupMenuActive(pPSL) == FALSE)
{
/* If already paused, turn pause off */
if (tStatus == PSL_STATUS_PAUSE)
{
/* Send pause off command to the nav to be processed */
if (PslExternalSendNavCommand(PSL_USER_CMD_PAUSE_OFF, ulInfo) != PSL_SUCCESS)
{
DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessUserInputPause: Failure sending command to nav\n"));
return (PSL_FAILURE);
}
}
else
{
/* Send command to the nav to be processed */
if (PslExternalSendNavCommand(PSL_USER_CMD_PAUSE_ON, ulInfo) != PSL_SUCCESS)
{
DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessUserInputPause: Failure sending command to nav\n"));
return (PSL_FAILURE);
}
}
}
}
}
return (PSL_SUCCESS);
}
/**
* PslProcessUserInputEject -- Process the eject command
*
* @param
* pPSL - handle to internal PSL data
* ulInfo - info param with the command
*
* @retval
* PSL_SUCCESS if successful
* PSL_FAILURE if not successful
*/
PSL_STATUS PslProcessUserInputEject(PSL_HANDLE *pPSL, ULONG ulInfo)
{
DBGPRINT(DBG_ON(DBG_TRACE), ("PslProcessUserInputEject: ENTER\n"));
if (pPSL == NULL)
{
DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessUserInputEject: Invalid psl handle\n"));
return (PSL_NULL_POINTER);
}
/* If generic osd is active, clear it */
if (PslScreenLayoutIsGenericActive(pPSL) == TRUE)
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -