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

📄 psl_screen_layout.cpp

📁 这是DVD中伺服部分的核心代码
💻 CPP
📖 第 1 页 / 共 5 页
字号:
        /* Draw the background rectangle */
        if (DealDMDrawFilledRectangle(pPSL->hDeal, &rect) != DEAL_SUCCESS)
        {
            DBGPRINT(DBG_ON(DBG_ERROR), ("PslScreenLayoutDrawGeneric: failed to draw rectangle!\n"));
            return (PSL_FAILURE);
        }
    
        /* Draw line of message */
        if (DealDMDrawString(pPSL->hDeal, "When PLAY is pushed, the player", &text) != DEAL_SUCCESS)
        {
            DBGPRINT(DBG_ON(DBG_ERROR), ("PslScreenLayoutDrawGeneric: failed to draw string!\n"));
            return (PSL_FAILURE);
        }
    
        /* Adjust string coordinate */
        text.usStartY   += 22;

        /* Draw line of message */
        if (DealDMDrawString(pPSL->hDeal, "will play from where you stopped.", &text) != DEAL_SUCCESS)
        {
            DBGPRINT(DBG_ON(DBG_ERROR), ("PslScreenLayoutDrawGeneric: failed to draw string!\n"));
            return (PSL_FAILURE);
        }
    
        /* Adjust string coordinate */
        text.usStartY   += 22;

        /* Draw line of message */
        if (DealDMDrawString(pPSL->hDeal, "To start from the beginning, press", &text) != DEAL_SUCCESS)
        {
            DBGPRINT(DBG_ON(DBG_ERROR), ("PslScreenLayoutDrawGeneric: failed to draw string!\n"));
            return (PSL_FAILURE);
        }
    
        /* Adjust string coordinate */
        text.usStartY   += 22;

        /* Draw line of message */
        if (DealDMDrawString(pPSL->hDeal, "STOP again.", &text) != DEAL_SUCCESS)
        {
            DBGPRINT(DBG_ON(DBG_ERROR), ("PslScreenLayoutDrawGeneric: failed to draw string!\n"));
            return (PSL_FAILURE);
        }
        break;

    case PSL_STATUS_NO_RESUME:
        /* Get string width to determine how wide to draw the background rectangle */
        if (DealDMStringWidthGet(pPSL->hDeal, "Start from beginning on play.", 
                                 (DEAL_FONT *)&tLARGEFONT, &ulWidth) != DEAL_SUCCESS)
        {
            DBGPRINT(DBG_ON(DBG_ERROR), ("PslScreenLayoutDrawGeneric: failed to get string width!\n"));
            return (PSL_FAILURE);
        }
    
        /* Set background rectangle dimensions */
        rect.usWidth    = (USHORT)(ulWidth + 4);
        rect.usHeight   = 47;

        /* Draw the background rectangle */
        if (DealDMDrawFilledRectangle(pPSL->hDeal, &rect) != DEAL_SUCCESS)
        {
            DBGPRINT(DBG_ON(DBG_ERROR), ("PslScreenLayoutDrawGeneric: failed to draw rectangle!\n"));
            return (PSL_FAILURE);
        }
    
        /* Draw line of message */
        if (DealDMDrawString(pPSL->hDeal, "Resume not possible.", &text) != DEAL_SUCCESS)
        {
            DBGPRINT(DBG_ON(DBG_ERROR), ("PslScreenLayoutDrawGeneric: failed to draw string!\n"));
            return (PSL_FAILURE);
        }
    
        /* Adjust string coordinate */
        text.usStartY   += 22;

        /* Draw line of message */
        if (DealDMDrawString(pPSL->hDeal, "Start from beginning on play.", &text) != DEAL_SUCCESS)
        {
            DBGPRINT(DBG_ON(DBG_ERROR), ("PslScreenLayoutDrawGeneric: failed to draw string!\n"));
            return (PSL_FAILURE);
        }
        break;
    case PSL_STATUS_NO_DISC:
        /* Get string width to determine how wide to draw the background rectangle */
        if (DealDMStringWidthGet(pPSL->hDeal, "No Disc", (DEAL_FONT *)&tLARGEFONT, &ulWidth) != DEAL_SUCCESS)
        {
            DBGPRINT(DBG_ON(DBG_ERROR), ("PslScreenLayoutDrawGeneric: failed to get string width!\n"));
            return (PSL_FAILURE);
        }
    
        /* Set background rectangle dimensions */
        rect.usWidth    = (USHORT)(ulWidth + 4);
        rect.usHeight   = 25;

        /* Draw the background rectangle */
        if (DealDMDrawFilledRectangle(pPSL->hDeal, &rect) != DEAL_SUCCESS)
        {
            DBGPRINT(DBG_ON(DBG_ERROR), ("PslScreenLayoutDrawGeneric: failed to draw rectangle!\n"));
            return (PSL_FAILURE);
        }
    
        /* Draw line of message */
        if (DealDMDrawString(pPSL->hDeal, "No Disc", &text) != DEAL_SUCCESS)
        {
            DBGPRINT(DBG_ON(DBG_ERROR), ("PslScreenLayoutDrawGeneric: failed to draw string!\n"));
            return (PSL_FAILURE);
        }
        break;

    case PSL_STATUS_LOADING:
        /* Get string width to determine how wide to draw the background rectangle */
        if (DealDMStringWidthGet(pPSL->hDeal, "Loading", (DEAL_FONT *)&tLARGEFONT, &ulWidth) != DEAL_SUCCESS)
        {
            DBGPRINT(DBG_ON(DBG_ERROR), ("PslScreenLayoutDrawGeneric: failed to get string width!\n"));
            return (PSL_FAILURE);
        }
    
        /* Set background rectangle dimensions */
        rect.usWidth    = (USHORT)(ulWidth + 4);
        rect.usHeight   = 25;

        /* Draw the background rectangle */
        if (DealDMDrawFilledRectangle(pPSL->hDeal, &rect) != DEAL_SUCCESS)
        {
            DBGPRINT(DBG_ON(DBG_ERROR), ("PslScreenLayoutDrawGeneric: failed to draw rectangle!\n"));
            return (PSL_FAILURE);
        }
    
        /* Draw line of message */
        if (DealDMDrawString(pPSL->hDeal, "Loading", &text) != DEAL_SUCCESS)
        {
            DBGPRINT(DBG_ON(DBG_ERROR), ("PslScreenLayoutDrawGeneric: failed to draw string!\n"));
            return (PSL_FAILURE);
        }
        break;

    case PSL_STATUS_DISC_TYPE:
        switch (ulData)
        {
        case VDVD_INFO_DISCTYPE_BDROM:
#ifndef BDROM_ENABLE
            /* Get string width to determine how wide to draw the background rectangle */
            if (DealDMStringWidthGet(pPSL->hDeal, "BDROM not supported", (DEAL_FONT *)&tLARGEFONT, &ulWidth) != DEAL_SUCCESS)
            {
                DBGPRINT(DBG_ON(DBG_ERROR), ("PslScreenLayoutDrawGeneric: failed to get string width!\n"));
                return (PSL_FAILURE);
            }
        
            /* Set background rectangle dimensions */
            rect.usWidth    = (USHORT)(ulWidth + 4);
            rect.usHeight   = 25;

            /* Draw the background rectangle */
            if (DealDMDrawFilledRectangle(pPSL->hDeal, &rect) != DEAL_SUCCESS)
            {
                DBGPRINT(DBG_ON(DBG_ERROR), ("PslScreenLayoutDrawGeneric: failed to draw rectangle!\n"));
                return (PSL_FAILURE);
            }
        
            /* Draw line of message */
            if (DealDMDrawString(pPSL->hDeal, "BDROM not supported", &text) != DEAL_SUCCESS)
            {
                DBGPRINT(DBG_ON(DBG_ERROR), ("PslScreenLayoutDrawGeneric: failed to draw string!\n"));
                return (PSL_FAILURE);
            }
#endif
            break;
        case VDVD_INFO_DISCTYPE_VCD:
#ifndef VCD_ENABLE
            /* Get string width to determine how wide to draw the background rectangle */
            if (DealDMStringWidthGet(pPSL->hDeal, "Unsupported Disc Type", (DEAL_FONT *)&tLARGEFONT, &ulWidth) != DEAL_SUCCESS)
            {
                DBGPRINT(DBG_ON(DBG_ERROR), ("PslScreenLayoutDrawGeneric: failed to get string width!\n"));
                return (PSL_FAILURE);
            }
        
            /* Set background rectangle dimensions */
            rect.usWidth    = (USHORT)(ulWidth + 4);
            rect.usHeight   = 25;

            /* Draw the background rectangle */
            if (DealDMDrawFilledRectangle(pPSL->hDeal, &rect) != DEAL_SUCCESS)
            {
                DBGPRINT(DBG_ON(DBG_ERROR), ("PslScreenLayoutDrawGeneric: failed to draw rectangle!\n"));
                return (PSL_FAILURE);
            }
        
            /* Draw line of message */
            if (DealDMDrawString(pPSL->hDeal, "Unsupported Disc Type", &text) != DEAL_SUCCESS)
            {
                DBGPRINT(DBG_ON(DBG_ERROR), ("PslScreenLayoutDrawGeneric: failed to draw string!\n"));
                return (PSL_FAILURE);
            }
#endif
            break;
        case VDVD_INFO_DISCTYPE_CDDA:
#ifndef CDDA_ENABLE
            /* Get string width to determine how wide to draw the background rectangle */
            if (DealDMStringWidthGet(pPSL->hDeal, "Unsupported Disc Type", (DEAL_FONT *)&tLARGEFONT, &ulWidth) != DEAL_SUCCESS)
            {
                DBGPRINT(DBG_ON(DBG_ERROR), ("PslScreenLayoutDrawGeneric: failed to get string width!\n"));
                return (PSL_FAILURE);
            }
        
            /* Set background rectangle dimensions */
            rect.usWidth    = (USHORT)(ulWidth + 4);
            rect.usHeight   = 25;

            /* Draw the background rectangle */
            if (DealDMDrawFilledRectangle(pPSL->hDeal, &rect) != DEAL_SUCCESS)
            {
                DBGPRINT(DBG_ON(DBG_ERROR), ("PslScreenLayoutDrawGeneric: failed to draw rectangle!\n"));
                return (PSL_FAILURE);
            }
        
            /* Draw line of message */
            if (DealDMDrawString(pPSL->hDeal, "Unsupported Disc Type", &text) != DEAL_SUCCESS)
            {
                DBGPRINT(DBG_ON(DBG_ERROR), ("PslScreenLayoutDrawGeneric: failed to draw string!\n"));
                return (PSL_FAILURE);
            }
#endif
            break;
        case VDVD_INFO_DISCTYPE_MP3:
#ifndef MP3_ENABLE
            /* Get string width to determine how wide to draw the background rectangle */
            if (DealDMStringWidthGet(pPSL->hDeal, "Unsupported Disc Type", (DEAL_FONT *)&tLARGEFONT, &ulWidth) != DEAL_SUCCESS)
            {
                DBGPRINT(DBG_ON(DBG_ERROR), ("PslScreenLayoutDrawGeneric: failed to get string width!\n"));
                return (PSL_FAILURE);
            }
        
            /* Set background rectangle dimensions */
            rect.usWidth    = (USHORT)(ulWidth + 4);
            rect.usHeight   = 25;

            /* Draw the background rectangle */
            if (DealDMDrawFilledRectangle(pPSL->hDeal, &rect) != DEAL_SUCCESS)
            {
                DBGPRINT(DBG_ON(DBG_ERROR), ("PslScreenLayoutDrawGeneric: failed to draw rectangle!\n"));
                return (PSL_FAILURE);
            }
        
            /* Draw line of message */
            if (DealDMDrawString(pPSL->hDeal, "Unsupported Disc Type", &text) != DEAL_SUCCESS)
            {
                DBGPRINT(DBG_ON(DBG_ERROR), ("PslScreenLayoutDrawGeneric: failed to draw string!\n"));
                return (PSL_FAILURE);
            }
#endif
            break;
        case VDVD_INFO_DISCTYPE_UNKNOWN:
            /* Get string width to determine how wide to draw the background rectangle */
            if (DealDMStringWidthGet(pPSL->hDeal, "Unknown Disc Type", (DEAL_FONT *)&tLARGEFONT, &ulWidth) != DEAL_SUCCESS)
            {
                DBGPRINT(DBG_ON(DBG_ERROR), ("PslScreenLayoutDrawGeneric: failed to get string width!\n"));
                return (PSL_FAILURE);
            }
        
            /* Set background rectangle dimensions */
            rect.usWidth    = (USHORT)(ulWidth + 4);
            rect.usHeight   = 25;

            /* Draw the background rectangle */
            if (DealDMDrawFilledRectangle(pPSL->hDeal, &rect) != DEAL_SUCCESS)
            {
                DBGPRINT(DBG_ON(DBG_ERROR), ("PslScreenLayoutDrawGeneric: failed to draw rectangle!\n"));
                return (PSL_FAILURE);
            }
        
            /* Draw line of message */
            if (DealDMDrawString(pPSL->hDeal, "Unknown Disc Type", &text) != DEAL_SUCCESS)
            {
                DBGPRINT(DBG_ON(DBG_ERROR), ("PslScreenLayoutDrawGeneric: failed to draw string!\n"));
                return (PSL_FAILURE);
            }
            break;
        default:
            fDisplay = FALSE;
            break;
        }
        break;

    case PSL_STATUS_AUDIO_NOT_SUPPORTED:
        switch (ulData)
        {
        case VDVD_INFO_AUDIOTYPE_DOLBY:
            /* Get string width to determine how wide to draw the background rectangle */
            if (DealDMStringWidthGet(pPSL->hDeal, "Dolby Audio Not Supported - MUTING", (DEAL_FONT *)&tLARGEFONT, &ulWidth) != DEAL_SUCCESS)
            {
                DBGPRINT(DBG_ON(DBG_ERROR), ("PslScreenLayoutDrawGeneric: failed to get string width!\n"));
                return (PSL_FAILURE);
            }
        
            /* Set background rectangle dimensions */
            rect.usWidth    = (USHORT)(ulWidth + 4);
            rect.usHeight   = 25;

            /* Draw the background rectangle */
            if (DealDMDrawFilledRectangle(pPSL->hDeal, &rect) != DEAL_SUCCESS)
            {
                DBGPRINT(DBG_ON(DBG_ERROR), ("PslScreenLayoutDrawGeneric: failed to draw rectangle!\n"));
                return (PSL_FAILURE);
            }
        
            /* Draw line of message */
            if (DealDMDrawString(pPSL->hDeal, "Dolby Audio Not Supported - MUTING", &text) != DEAL_SUCCESS)
            {
                DBGPRINT(DBG_ON(DBG_ERROR), ("PslScreenLayoutDrawGeneric: failed to draw string!\n"));
                return (PSL_FAILURE);
            }
            break;
        case VDVD_INFO_AUDIOTYPE_MPEG:
            /* Get string width to determine how wide to draw the background rectangle */
            if (DealDMStringWidthGet(pPSL->hDeal, "Mpeg Audio Not Supported - MUTING", (DEAL_FONT *)&tLARGEFONT, &ulWidth) != DEAL_SUCCESS)
            {
                DBGPRINT(DBG_ON(DBG_ERROR), ("PslScreenLayoutDrawGeneric: failed to get string width!\n"));
                return (PSL_FAILURE);
            }
        
            /* Set background rectangle dimensions */
            rect.usWidth    = (USHORT)(ulWidth + 4);
            rect.usHeight   = 25;

            /* Draw the background rectangle */
            if (DealDMDrawFilledRectangle(pPSL->hDeal, &rect) != DEAL_SUCCESS)
            {
                DBGPRINT(DBG_ON(DBG_ERROR), ("PslScreenLayoutDrawGeneric: failed to draw rectangle!\n"));
                return (PSL_FAILURE);
            }
        
            /* Draw line of message */
            if (DealDMDrawString(pPSL->hDeal, "Mpeg Audio Not Supported - MUTING", &text) != DEAL_SUCCESS)
            {
                DBGPRINT(DBG_ON(DBG_ERROR), ("PslScreenLayoutDrawGeneric: failed to draw string!\n"));
                return (PSL_FAILURE);
            }
            break;
        case VDVD_INFO_AUDIOTYPE_LPCM:
            /* Get string width to determine how wide to draw the background rectangle */
            if (DealDMStringWidthGet(pPSL->hDeal, "PCM Audio Not Supported - MUTING", (DEAL_FONT *)&tLARGEFONT, &ulWidth) != DEAL_SUCCESS)
            {
                DBGPRINT(DBG_ON(DBG_ERROR), ("PslScreenLayoutDrawGeneric: failed to get string width!\n"));
                return (PSL_FAILURE);
            }
        
            /* Set background rectangle dimensions */
            rect.usWidth    = (USHORT)(ulWidth + 4);
            rect.usHeight   = 25;

            /* Draw the background rectangle */
            if (DealDMDrawFilledRectangle(pPSL->hDeal, &rect) != DEA

⌨️ 快捷键说明

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