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

📄 psl_process_user_input.cpp

📁 这是DVD中伺服部分的核心代码
💻 CPP
📖 第 1 页 / 共 5 页
字号:
            {
                /* Get the current play rate */
                ulRate = PslExternalGetPlayRate();

                if (ulRate == (1000 * 2) )
                {
                    /* Change rate from 2x to 4x */
                    ulRate = 1000 * 4;
                }
                else if (ulRate == (1000 * 4) )
                {
                    /* Change rate from 4x to 16x */
                    ulRate = 1000 * 16;
                }
                else
                {
                    /* Set rate to 2x */
                    ulRate = 1000 * 2;
                }

                /* Send command to the nav to be processed */
                if (PslExternalSendNavCommand(PSL_USER_CMD_BWD_PLAY, ulRate) != PSL_SUCCESS)
                {
                    DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessUserInputFastRwd: Failure sending command to nav\n"));
                    return (PSL_FAILURE);
                }
            }
        }
    }

    return (PSL_SUCCESS);
}

/**
 * PslProcessUserInputSlowFwd -- Process the slow forward 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 PslProcessUserInputSlowFwd(PSL_HANDLE *pPSL, ULONG ulInfo)
{
    ULONG   ulRate;

    DBGPRINT(DBG_ON(DBG_TRACE), ("PslProcessUserInputSlowFwd: ENTER\n"));

    if (pPSL == NULL)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessUserInputSlowFwd: 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, do not process the command */
            if (PslScreenLayoutIsSetupMenuActive(pPSL) == FALSE)
            {
                /* Get the current play rate */
                ulRate = PslExternalGetPlayRate();

                if (ulRate == (1000 / 2) )
                {
                    /* Change rate from 1/2x to 1/4x */
                    ulRate = 1000 / 4;
                }
                else if (ulRate == (1000 / 4) )
                {
                    /* Change rate from 1/4x to 1/16x */
                    ulRate = 1000 / 16;
                }
                else
                {
                    /* Set rate to 1/2x */
                    ulRate = 1000 / 2;
                }

                /* Send command to the nav to be processed */
                /* @TODO: send appropriate speed */
                if (PslExternalSendNavCommand(PSL_USER_CMD_FWD_PLAY, ulRate) != PSL_SUCCESS)
                {
                    DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessUserInputSlowFwd: Failure sending command to nav\n"));
                    return (PSL_FAILURE);
                }
            }
        }
    }

    return (PSL_SUCCESS);
}

/**
 * PslProcessUserInputSlowRwd -- Process the slow rewind 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 PslProcessUserInputSlowRwd(PSL_HANDLE *pPSL, ULONG ulInfo)
{
    DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessUserInputSlowRwd: stubbed\n"));
    return (PSL_FAILURE);
}

/**
 * PslProcessUserInputStepFwd -- Process the step forward 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 PslProcessUserInputStepFwd(PSL_HANDLE *pPSL, ULONG ulInfo)
{
    DBGPRINT(DBG_ON(DBG_TRACE), ("PslProcessUserInputStepFwd: ENTER\n"));

    if (pPSL == NULL)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessUserInputStepFwd: 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, do not process the command */
            if (PslScreenLayoutIsSetupMenuActive(pPSL) == FALSE)
            {
                /* Send command to the nav to be processed */
                if (PslExternalSendNavCommand(PSL_USER_CMD_STEP_FWD, ulInfo) != PSL_SUCCESS)
                {
                    DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessUserInputStepFwd: Failure sending command to nav\n"));
                    return (PSL_FAILURE);
                }
            }
        }
    }

    return (PSL_SUCCESS);
}

/**
 * PslProcessUserInputStepBwd -- Process the step backward 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 PslProcessUserInputStepBwd(PSL_HANDLE *pPSL, ULONG ulInfo)
{
    DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessUserInputStepBwd: stubbed\n"));
    return (PSL_FAILURE);
}

/**
 * PslProcessUserInputVolumeUp -- Process the volume up 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 PslProcessUserInputVolumeUp(PSL_HANDLE *pPSL, ULONG ulInfo)
{
    DBGPRINT(DBG_ON(DBG_TRACE), ("PslProcessUserInputVolumeUp: ENTER\n"));

    if (pPSL == NULL)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessUserInputVolumeUp: 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, do not process the command */
            if (PslScreenLayoutIsSetupMenuActive(pPSL) == FALSE)
            {
                /* Send command to the nav to be processed */
                if (PslExternalSendNavCommand(PSL_USER_CMD_VOL_UP, ulInfo) != PSL_SUCCESS)
                {
                    DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessUserInputVolumeUp: Failure sending command to nav\n"));
                    return (PSL_FAILURE);
                }
            }
        }
    }

    return (PSL_SUCCESS);
}

/**
 * PslProcessUserInputVolumeDown -- Process the volume down 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 PslProcessUserInputVolumeDown(PSL_HANDLE *pPSL, ULONG ulInfo)
{
    DBGPRINT(DBG_ON(DBG_TRACE), ("PslProcessUserInputVolumeDown: ENTER\n"));

    if (pPSL == NULL)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessUserInputVolumeDown: 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, do not process the command */
            if (PslScreenLayoutIsSetupMenuActive(pPSL) == FALSE)
            {
                /* Send command to the nav to be processed */
                if (PslExternalSendNavCommand(PSL_USER_CMD_VOL_DOWN, ulInfo) != PSL_SUCCESS)
                {
                    DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessUserInputVolumeDown: Failure sending command to nav\n"));
                    return (PSL_FAILURE);
                }
            }
        }
    }

    return (PSL_SUCCESS);
}

/**
 * PslProcessUserInputVolumeMute -- Process the volume mute 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 PslProcessUserInputVolumeMute(PSL_HANDLE *pPSL, ULONG ulInfo)
{
    DBGPRINT(DBG_ON(DBG_TRACE), ("PslProcessUserInputVolumeMute: ENTER\n"));

    if (pPSL == NULL)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessUserInputVolumeMute: 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, do not process the command */
            if (PslScreenLayoutIsSetupMenuActive(pPSL) == FALSE)
            {
                /* Send command to the nav to be processed */
                if (PslExternalSendNavCommand(PSL_USER_CMD_VOL_MUTE, ulInfo) != PSL_SUCCESS)
                {
                    DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessUserInputVolumeMute: Failure sending command to nav\n"));
                    return (PSL_FAILURE);
                }
            }
        }
    }

    return (PSL_SUCCESS);
}

/**
 * PslProcessUserInputRepeat -- Process the repeat 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 PslProcessUserInputRepeat(PSL_HANDLE *pPSL, ULONG ulInfo)
{
    DBGPRINT(DBG_ON(DBG_TRACE), ("PslProcessUserInputRepeat: ENTER\n"));

    if (pPSL == NULL)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessUserInputRepeat: 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, do not process the command */
            if (PslScreenLayoutIsSetupMenuActive(pPSL) == FALSE)
            {
                /* Send command to the nav to be processed */
                if (PslExternalSendNavCommand(PSL_USER_CMD_REPEAT, ulInfo) != PSL_SUCCESS)
                {
                    DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessUserInputRepeat: Failure sending command to nav\n"));
                    return (PSL_FAILURE);
                }
            }
        }
    }

    return (PSL_SUCCESS);
}

/**
 * PslProcessUserInputRepeatAB -- Process the repeat a-b 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 PslProcessUserInputRepeatAB(PSL_HANDLE *pPSL, ULONG ulInfo)
{

⌨️ 快捷键说明

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