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

📄 psl_process_status.cpp

📁 这是DVD中伺服部分的核心代码
💻 CPP
📖 第 1 页 / 共 5 页
字号:
/*****************************************************************************
******************************************************************************
**                                                                          **
**  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_status.cpp
 *
 * $Revision: 1.7 $ 
 *
 * Process Status Module of the PSL.
 * 
 */

#include "vdvd_types.h"
#include "psl_process_status.h"
#include "psl_interface.h"
#include "psl_screen_layout.h"
#include "psl_external_interface.h"
#include "psl_bitmap_bank.h"
#include "psl_general.h"
#include "psl_types.h"
#include "deal_control.h"
#include "deal_general.h"
#include "dbgprint.h"
#include <string.h>

/* Debug macros */
#define DBG_PSL_STATUS  DBG_ERROR
#define DBG_ON(x)       (DBG_PSL_STATUS >= x)

/**
 * Local variables
 */
static BOOLEAN m_fNoResume = FALSE;

/**
 * PslProcessStatusProhibited -- Process the prohibited status event
 *
 * @param
 *      pPSL         - handle to internal PSL data
 *      ulData1      - data parameter associated with status event
 *      ulData2      - data parameter associated with status event
 *      pvBuffer     - buffer containing data associated with status event
 *      ulBufferSize - size of buffer pointed to by pvBuffer
 *
 * @retval
 *    PSL_SUCCESS if successful
 *    PSL_FAILURE if not successful
 */
PSL_STATUS PslProcessStatusProhibited(PSL_HANDLE *pPSL, ULONG ulData1, ULONG ulData2, PVOID pvBuffer, ULONG ulBufferSize)
{
    ULONG ulTimeout = 3000;

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

    if (pPSL == NULL)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessStatusProhibited: NULL handle!\n"));
        return (PSL_NULL_POINTER);
    }

    /* check that icon data is valid */
    if (pPSL->pIconData == NULL)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessStatusProhibited: NULL handle!\n"));
        return (PSL_FAILURE);
    }

    /* Get the prohibited icon */
    pPSL->pIconData->pActiveIcon = PslBitmapGetProhibitedIcon();
    if (pPSL->pIconData->pActiveIcon == NULL)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessStatusProhibited: failed to get icon!\n"));
        return (PSL_FAILURE);
    }

    /* Set the Icon timer */
    if (OS_TimerSetMsec(pPSL->pIconData->Timer, ulTimeout) != OS_OK)
    {
        DbgPrint(("PslProcessStatusProhibited: Timer set FAILED\n"));
        return (PSL_FAILURE);
    }

    /* Draw the icon */
    if (PslScreenLayoutDrawIcon(pPSL, pPSL->pIconData->pActiveIcon) != PSL_SUCCESS)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessStatusProhibited: failed to draw icon!\n"));
        return (PSL_FAILURE);
    }

    return (PSL_SUCCESS);
}

/**
 * PslProcessStatusPause -- Process the pause status event
 *
 * @param
 *      pPSL         - handle to internal PSL data
 *      ulData1      - data parameter associated with status event
 *      ulData2      - data parameter associated with status event
 *      pvBuffer     - buffer containing data associated with status event
 *      ulBufferSize - size of buffer pointed to by pvBuffer
 *
 * @retval
 *    PSL_SUCCESS if successful
 *    PSL_FAILURE if not successful
 */
PSL_STATUS PslProcessStatusPause(PSL_HANDLE *pPSL, ULONG ulData1, ULONG ulData2, PVOID pvBuffer, ULONG ulBufferSize)
{
    ULONG ulTimeout = 0;

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

    if (pPSL == NULL)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessStatusPause: NULL handle!\n"));
        return (PSL_NULL_POINTER);
    }

    /* check that icon data is valid */
    if (pPSL->pIconData == NULL)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessStatusPause: NULL handle!\n"));
        return (PSL_FAILURE);
    }

    /* Get the pause icon */
    pPSL->pIconData->pActiveIcon = PslBitmapGetPauseIcon();
    if (pPSL->pIconData->pActiveIcon == NULL)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessStatusPause: failed to get icon!\n"));
        return (PSL_FAILURE);
    }

    /* If time display is not active, icon should timeout */
    if ( (PslScreenLayoutIsStatusDisplayActive(pPSL) == FALSE) &&
         (PslScreenLayoutIsCDDAActive(pPSL) == FALSE) )
    {
        ulTimeout = 3000;
    }

    /* Set the Icon timer */
    if (OS_TimerSetMsec(pPSL->pIconData->Timer, ulTimeout) != OS_OK)
    {
        DbgPrint(("PslProcessStatusPause: Timer set FAILED\n"));
        return (PSL_FAILURE);
    }

    /* Draw the icon */
    if (PslScreenLayoutDrawIcon(pPSL, pPSL->pIconData->pActiveIcon) != PSL_SUCCESS)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessStatusPause: failed to draw icon!\n"));
        return (PSL_FAILURE);
    }

    return (PSL_SUCCESS);
}

/**
 * PslProcessStatusPlay -- Process the play status event
 *
 * @param
 *      pPSL         - handle to internal PSL data
 *      ulData1      - data parameter associated with status event
 *      ulData2      - data parameter associated with status event
 *      pvBuffer     - buffer containing data associated with status event
 *      ulBufferSize - size of buffer pointed to by pvBuffer
 *
 * @retval
 *    PSL_SUCCESS if successful
 *    PSL_FAILURE if not successful
 */
PSL_STATUS PslProcessStatusPlay(PSL_HANDLE *pPSL, ULONG ulData1, ULONG ulData2, PVOID pvBuffer, ULONG ulBufferSize)
{
    ULONG ulTimeout = 0;

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

    if (pPSL == NULL)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessStatusPlay: NULL handle!\n"));
        return (PSL_NULL_POINTER);
    }

    /* check that icon data is valid */
    if (pPSL->pIconData == NULL)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessStatusPlay: NULL handle!\n"));
        return (PSL_FAILURE);
    }

    /* If generic osd is active, clear it */
    if (PslScreenLayoutIsGenericActive(pPSL) == TRUE)
    {
        if (PslScreenLayoutClearGeneric(pPSL) != PSL_SUCCESS)
        {
            DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessStatusPlay: failed to clear generic osd!\n"));
            return (PSL_FAILURE);
        }
    }

    /* Get the play icon */
    pPSL->pIconData->pActiveIcon = PslBitmapGetPlayIcon();
    if (pPSL->pIconData->pActiveIcon == NULL)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessStatusPlay: failed to get icon!\n"));
        return (PSL_FAILURE);
    }

    /* If time display is not active, icon should timeout */
    if ( (PslScreenLayoutIsStatusDisplayActive(pPSL) == FALSE) &&
         (PslScreenLayoutIsCDDAActive(pPSL) == FALSE) )
    {
        ulTimeout = 3000;
    }

    /* Set the Icon timer */
    if (OS_TimerSetMsec(pPSL->pIconData->Timer, ulTimeout) != OS_OK)
    {
        DbgPrint(("PslProcessStatusPlay: Timer set FAILED\n"));
        return (PSL_FAILURE);
    }

    /* Draw the icon */
    if (PslScreenLayoutDrawIcon(pPSL, pPSL->pIconData->pActiveIcon) != PSL_SUCCESS)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessStatusPlay: failed to draw icon!\n"));
        return (PSL_FAILURE);
    }

    /* Unset flag */
    m_fNoResume = FALSE;

    return (PSL_SUCCESS);
}

/**
 * PslProcessStatusStop -- Process the stop status event
 *
 * @param
 *      pPSL         - handle to internal PSL data
 *      ulData1      - data parameter associated with status event
 *      ulData2      - data parameter associated with status event
 *      pvBuffer     - buffer containing data associated with status event
 *      ulBufferSize - size of buffer pointed to by pvBuffer
 *
 * @retval
 *    PSL_SUCCESS if successful
 *    PSL_FAILURE if not successful
 */
PSL_STATUS PslProcessStatusStop(PSL_HANDLE *pPSL, ULONG ulData1, ULONG ulData2, PVOID pvBuffer, ULONG ulBufferSize)
{
    ULONG ulTimeout = 0;

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

    if (pPSL == NULL)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessStatusStop: NULL handle!\n"));
        return (PSL_NULL_POINTER);
    }

    /* check that icon data is valid */
    if (pPSL->pIconData == NULL)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessStatusStop: NULL handle!\n"));
        return (PSL_FAILURE);
    }

    /* 
     * If setup menu is active, then clear it 
     */
    if (PslScreenLayoutIsSetupMenuActive(pPSL) == TRUE)
    {
        /* clear setup menu */ 
        if (PslScreenLayoutClearSetupMenu(pPSL) != PSL_SUCCESS)
        {
            DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessStatusStop: Failure clearing setup menu!\n"));
            return (PSL_FAILURE);
        } 
    }

    /* If time display is active, draw the stop icon */
    if ( (PslScreenLayoutIsStatusDisplayActive(pPSL) == TRUE) ||
         (PslScreenLayoutIsCDDAActive(pPSL) == TRUE) ) 
    {
        /* Get the stop icon */
        pPSL->pIconData->pActiveIcon = PslBitmapGetStopIcon();
        if (pPSL->pIconData->pActiveIcon == NULL)
        {
            DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessStatusStop: failed to get icon!\n"));
            return (PSL_FAILURE);
        }

        /* Set the Icon timer */
        if (OS_TimerSetMsec(pPSL->pIconData->Timer, ulTimeout) != OS_OK)
        {
            DbgPrint(("PslProcessStatusStop: Timer set FAILED\n"));
            return (PSL_FAILURE);
        }

        /* Draw the icon */
        if (PslScreenLayoutDrawIcon(pPSL, pPSL->pIconData->pActiveIcon) != PSL_SUCCESS)
        {
            DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessStatusStop: failed to draw icon!\n"));
            return (PSL_FAILURE);
        }
    }

    /* If we are in hold mode and not full stop, then draw stop message */
    if (PslExternalGetNavStatus() == (ULONG)PSL_STATUS_STOP)
    {
        /* Set the osd timer */
        if (OS_TimerSetMsec(pPSL->Timer, ulTimeout) != OS_OK)
        {
            DbgPrint(("PslProcessStatusStop: Timer set FAILED\n"));
            return (PSL_FAILURE);
        }

        /* Draw stop message on generic osd */
        if (PslScreenLayoutDrawGeneric(pPSL, PSL_STATUS_STOP, ulData1) != PSL_SUCCESS)
        {
            DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessStatusStop: failed to draw message!\n"));
            return (PSL_FAILURE);
        }
    }

    return (PSL_SUCCESS);
}

/**
 * PslProcessStatusFullStop -- Process the fullstop status event
 *
 * @param
 *      pPSL         - handle to internal PSL data
 *      ulData1      - data parameter associated with status event
 *      ulData2      - data parameter associated with status event
 *      pvBuffer     - buffer containing data associated with status event
 *      ulBufferSize - size of buffer pointed to by pvBuffer
 *
 * @retval
 *    PSL_SUCCESS if successful
 *    PSL_FAILURE if not successful
 */
PSL_STATUS PslProcessStatusFullStop(PSL_HANDLE *pPSL, ULONG ulData1, ULONG ulData2, PVOID pvBuffer, ULONG ulBufferSize)
{
    DBGPRINT(DBG_ON(DBG_TRACE), ("PslProcessStatusFullStop: ENTER\n"));

    if (pPSL == NULL)
    {
        DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessStatusFullStop: NULL handle!\n"));
        return (PSL_NULL_POINTER);
    }

    /* If generic osd is active, clear it */
    if ( (PslScreenLayoutIsGenericActive(pPSL) == TRUE) && (m_fNoResume == FALSE) )
    {
        if (PslScreenLayoutClearGeneric(pPSL) != PSL_SUCCESS)
        {
            DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessStatusFullStop: failed to clear generic osd!\n"));
            return (PSL_FAILURE);
        }
    }

    /* If setup menu is active, then clear it */
    if (PslScreenLayoutIsSetupMenuActive(pPSL) == TRUE)
    {
        /* clear setup menu */ 
        if (PslScreenLayoutClearSetupMenu(pPSL) != PSL_SUCCESS)
        {
            DBGPRINT(DBG_ON(DBG_ERROR), ("PslProcessStatusFullStop: Failure clearing setup menu!\n"));
            return (PSL_FAILURE);
        } 
    }

    /* If status menu is active, then clear it */
    if (PslScreenLayoutIsStatusMenuActive(pPSL) == TRUE)
    {

⌨️ 快捷键说明

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