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

📄 drm_ui.c

📁 dvd里面的一个文件系统的代码
💻 C
📖 第 1 页 / 共 3 页
字号:
		{
		case 0: count_icode =29;break;
		case 1: count_icode =15;break;
		case 2: count_icode =2;break;
		case 3: count_icode =25;break;
		case 4: count_icode =13;break;
		default:count_icode=0;break;
		}
	
	for(i=0;i<10;i++)
	osd_DrawString( (38-strlen(Divxstr4_1[osd_font_mode][i]))/2, i, Divxstr4_1[osd_font_mode][i], 11, 0 );
		
		//psprintf(Divxstr4_1[osd_font_mode][1], "%02d", iCode%100);
		if(osd_font_mode==4)
		count_line = 2;
		else
		count_line = 1;
		
		cert_code[2] = '\0';
		psprintf(cert_code, "%02d", iCode%100);

		osd_DrawString( count_icode, count_line, cert_code, 11, 0 );

		switch(osd_font_mode)
		{
		case 0: osd_DrawString( 14, 9, "[YES]", 11, 7 );osd_DrawString( 21, 9, "[NO]",  11, 0 );break;
		case 1: osd_DrawString( 14, 9, "[JA]", 11, 7 );osd_DrawString( 21, 9, "[NEIN]",  11, 0 );break;
		case 2: osd_DrawString( 14, 9, "[SI]", 11, 7 );osd_DrawString( 21, 9, "[NO]",  11, 0 );break;
		case 3: osd_DrawString( 14, 9, "[OUI]", 11, 7 );osd_DrawString( 21, 9, "[NON]",  11, 0 );break;
		case 4: osd_DrawString( 14, 9, "[SI]", 11, 7 );osd_DrawString( 21, 9, "[NO]",  11, 0 );break;
		default:osd_DrawString( 14, 9, "[YES]", 11, 7 );osd_DrawString( 21, 9, "[NO]",  11, 0 );break;
		}
        //osd_DrawString( 14, 9, "[YES]", 11, 7 );
        //osd_DrawString( 21, 9, "[NO]",  11, 0 );
        }
        break;

    case DRM_DISPLAY_HW_UNSUPPORTED:
        pOsdStr = DivxStr5;
        iCount = sizeof( DivxStr5 ) / sizeof( t_osd_str );
        osd_DrawString( 16, 9, "[DONE]", 11, 7 );
        break;

    case DRM_DISPLAY_AES_ONLY:
        pOsdStr = DivxStr6;
        iCount = sizeof( DivxStr6 ) / sizeof( t_osd_str );
        osd_DrawString( 16, 9, "[DONE]", 11, 7 );
        break;

    default:
        return -1;
        break;
    }

    full_scrn = DIVX_DRM_MENU;
    
    //Maoyong added for IR U/D/L/R/Sel proc func setting 2004-9-24 10:14
    SetFullscrnCmdFuncPtr( ircmd_null, ircmd_null, divx_func_left,
                                   divx_func_right, divx_func_select);
    
    // align all lines to center
    for( i = 0; i < iCount - 1; i++ )
    {
        int iLen = strlen( pOsdStr[i].str );
        pOsdStr[i].xst = ( 38 - iLen ) / 2;
    }

    osd_DrawStrings( pOsdStr, 11, 0 );  

    int iRet = 0;

    if( iPage != DRM_DISPLAY_REGISTRATION_CODE )
    {
        int iBtnYes = 1;
        
        while( 1 )
        {
            polling();

            if( sys_cmd == ( CMD_SELECT | CMD_FUNC_GAME_L ) )
                iBtnYes = 1;
            else if( sys_cmd == ( CMD_SELECT | CMD_FUNC_GAME_R ) )
                iBtnYes = 0;
            else if( sys_cmd == ( CMD_FUNC | CMD_FUNC_SELECT ) )
                break;

            if( iPage == DRM_DISPLAY_RENTAL_CONFIRMATION )
            {
            	/*
                osd_DrawString( 14, 9, "[JA]", 11, iBtnYes ? 7 : 0 );
                osd_DrawString( 21, 9, "[NEIN]",  11, iBtnYes ? 0 : 7 );
                */
                //liumzh 2005-5-7 10:19
       switch(osd_font_mode)
		{
		case 0: osd_DrawString( 14, 9, "[YES]", 11, iBtnYes ? 7 : 0 );osd_DrawString( 21, 9, "[NO]",  11, iBtnYes ? 0 : 7 );break;
		case 1: osd_DrawString( 14, 9, "[JA]", 11, iBtnYes ? 7 : 0 );osd_DrawString( 21, 9, "[NEIN]",  11, iBtnYes ? 0 : 7 );break;
		case 2: osd_DrawString( 14, 9, "[SI]", 11, iBtnYes ? 7 : 0 );osd_DrawString( 21, 9, "[NO]",  11, iBtnYes ? 0 : 7 );break;
		case 3: osd_DrawString( 14, 9, "[OUI]", 11, iBtnYes ? 7 : 0 );osd_DrawString( 21, 9, "[NON]",  11, iBtnYes ? 0 : 7 );break;
		case 4: osd_DrawString( 14, 9, "[SI]", 11, iBtnYes ? 7 : 0 );osd_DrawString( 21, 9, "[NO]",  11, iBtnYes ? 0 : 7 );break;
		default:osd_DrawString( 14, 9, "[YES]", 11, iBtnYes ? 7 : 0 );osd_DrawString( 21, 9, "[NO]",  11, iBtnYes ? 0 : 7 );break;
		}
                iRet = iBtnYes;
            }

            sys_cmd = 0;
        }
    }
    
    return iRet;
}	
#endif//#ifndef DRM_UI_FIVE_LANG

#else//#ifndef DRM_SHOW_FOLLOW_OSD_LANGUAGE_SET
//xujf-060420-modify for select osd language
EXTERN t_osd_str DivxStrn[N_OSD_LANGS][16];
int osd_divx_drm_display( int iPage, int iCode )
{
	char buffer[20];
    #define DRM_FONT_COLOR          1
    #define DRM_BACK_COLOR          0

    extern BYTE    osd0_state;
    osd0_state = 0;
    t_disp = 0;

#ifdef NEW_OSD_DRIVER

    #ifdef OSD_SUPPORT_2_COLOR  // 2005/06/18 yltseng
	const _t_osd_hdr osd_divx_menu_hdr[] = {
        { 36 * 4 * 4, 32 * 5, 32, 80, SIMPLE_HEADER, OSD_FORMAT_2COLOR,  OSD_INTERLACED },
	};
    #else
	const _t_osd_hdr osd_divx_menu_hdr[] = {
        { 36 * 4 * 4, 32 * 5, 32, 80, NORMAL_HEADER, OSD_FORMAT_4COLOR,  OSD_INTERLACED },
	};
    #endif

    #ifdef LARGE_OSD_SHOW_IN_LOGO    
    regs0->osd_base_addr=OSD_BASE_USE_ADDR;
    #endif
    
    #ifdef LARGE_OSD_USE_DSP_MEMORY
    switch( InitializeOSDMenu(OSD_MENU_DRM_UI) )
    {
    //cases other than success is not handled...
    default:
        break;
    }
    #endif  //#ifdef LARGE_OSD_USE_DSP_MEMORY
    
	osd_init_regions( sizeof( osd_divx_menu_hdr ) / sizeof( _t_osd_hdr ), (_t_osd_hdr *) &osd_divx_menu_hdr );
	osd_set_palette_color( 0, DRM_BACK_COLOR, __palette4F( 150,210, 141, 0xe0 ) );
	osd_set_palette_color( 0, DRM_FONT_COLOR, __palette4F( 0, 70, 0,0xff ) );

    osd_tog_region( 0, OSD_ON );
#else

    extern void osd_init_regions(int n, const _t_osd_hdr *hdrp);
    
	const _t_osd_hdr osd_divx_menu_hdr[] = {
        { 18 * 4, 24, 32, 34, NORMAL_HEADER, OSD_FORMAT_4COLOR,  OSD_INTERLACED },
        { 36 * 8, 32 * 5, 32, 80, SETUP_HEADER, OSD_FORMAT_16COLOR,  OSD_INTERLACED },
	};

	osd_init_regions( sizeof( osd_divx_menu_hdr ) / sizeof( _t_osd_hdr ), (_t_osd_hdr *) &osd_divx_menu_hdr );

    SetOsdCol( 1, 1, DRM_BACK_COLOR, __palette4F( 150,210, 141, 0xe0 ) );
    SetOsdCol( 1, 1, DRM_FONT_COLOR, __palette4F( 0, 70, 0,0xff ) );
#endif    

    switch( iPage )
    {
    case DRM_DISPLAY_REGISTRATION_CODE:
        
		set_divx_drm_model_id(Divx_drm_modelID);//linrc change for change this ID needn't update fs_mp4.a 2005-8-11 17:15
		//set_divx_drm_model_id(DIVX_DRM_MODEL_ID);		
        generate_registration_code( buffer );		
	    osd_DrawString( DivxStrn[osd_font_mode][0].xst, DivxStrn[osd_font_mode][0].yst, DivxStrn[osd_font_mode][0].str, DRM_FONT_COLOR, DRM_BACK_COLOR ); //23 char
        osd_DrawString( DivxStrn[osd_font_mode][1].xst, DivxStrn[osd_font_mode][1].yst, DivxStrn[osd_font_mode][1].str, DRM_FONT_COLOR, DRM_BACK_COLOR ); //33 char
        osd_DrawString( DivxStrn[osd_font_mode][2].xst, DivxStrn[osd_font_mode][2].yst, DivxStrn[osd_font_mode][2].str, DRM_FONT_COLOR, DRM_BACK_COLOR );
        osd_DrawString( 27, 1, buffer, DRM_FONT_COLOR, DRM_BACK_COLOR );
        break;

    case DRM_DISPLAY_AUTHORIZATION_ERROR:

        osd_DrawString( DivxStrn[osd_font_mode][3].xst, DivxStrn[osd_font_mode][3].yst, DivxStrn[osd_font_mode][3].str, DRM_FONT_COLOR, DRM_BACK_COLOR );
        iCode %= 100;
        
        if( iCode == 1 )
        {
            osd_DrawString( DivxStrn[osd_font_mode][4].xst, DivxStrn[osd_font_mode][4].yst, DivxStrn[osd_font_mode][4].str, DRM_FONT_COLOR, DRM_BACK_COLOR );//19
            osd_DrawString( DivxStrn[osd_font_mode][5].xst, DivxStrn[osd_font_mode][5].yst, DivxStrn[osd_font_mode][5].str, DRM_FONT_COLOR, DRM_BACK_COLOR );//19
        }
        else if( iCode == 2 )
            osd_DrawString( DivxStrn[osd_font_mode][6].xst, DivxStrn[osd_font_mode][6].yst, DivxStrn[osd_font_mode][6].str, DRM_FONT_COLOR, DRM_BACK_COLOR );//18
        else
            osd_DrawString( DivxStrn[osd_font_mode][7].xst, DivxStrn[osd_font_mode][7].yst, DivxStrn[osd_font_mode][7].str, DRM_FONT_COLOR, DRM_BACK_COLOR );//18
        break;

    case DRM_DISPLAY_RENTAL_EXPIRED:
        
        osd_DrawString( DivxStrn[osd_font_mode][8].xst, DivxStrn[osd_font_mode][8].yst, DivxStrn[osd_font_mode][8].str, DRM_FONT_COLOR, DRM_BACK_COLOR );        //16
        break;

    case DRM_DISPLAY_RENTAL_CONFIRMATION:

		// modify by gary.huang 070316, we need to care rental file with unlimited views.
		if (iCode == 0xff)
		{
			osd_DrawString( DivxStrn[osd_font_mode][9].xst, DivxStrn[osd_font_mode][9].yst,DivxStrn[osd_font_mode][9].str, DRM_FONT_COLOR, DRM_BACK_COLOR );	            
	        osd_DrawString( 0, 1, " THIS RENTAL HAS UNLIMITED VIEWS LEFT.", DRM_FONT_COLOR, DRM_BACK_COLOR );
	
	        osd_DrawString( DivxStrn[osd_font_mode][10].xst, DivxStrn[osd_font_mode][10].yst, DivxStrn[osd_font_mode][10].str, DRM_FONT_COLOR, DRM_BACK_COLOR );
	        osd_DrawString( 0, 3, "     YOUR UNLIMITED VIEWS NOW?", DRM_FONT_COLOR, DRM_BACK_COLOR );
		}
		else
		{
	        osd_DrawString( DivxStrn[osd_font_mode][9].xst, DivxStrn[osd_font_mode][9].yst,DivxStrn[osd_font_mode][9].str, DRM_FONT_COLOR, DRM_BACK_COLOR );
	            
	            psprintf( linebuf, "   THIS RENTAL HAS %02d VIEWS LEFT.", iCode % 100 );
	        osd_DrawString( 0, 1, linebuf, DRM_FONT_COLOR, DRM_BACK_COLOR );
	
	        osd_DrawString( DivxStrn[osd_font_mode][10].xst, DivxStrn[osd_font_mode][10].yst, DivxStrn[osd_font_mode][10].str, DRM_FONT_COLOR, DRM_BACK_COLOR );
	            psprintf( linebuf, "       YOUR %02d VIEWS NOW?", iCode % 100 );
	        osd_DrawString( 0, 3, linebuf, DRM_FONT_COLOR, DRM_BACK_COLOR );
	    }
        
        osd_DrawString( DivxStrn[osd_font_mode][11].xst, DivxStrn[osd_font_mode][11].yst, DivxStrn[osd_font_mode][11].str, DRM_BACK_COLOR, DRM_FONT_COLOR );
        osd_DrawString( DivxStrn[osd_font_mode][12].xst, DivxStrn[osd_font_mode][12].yst, DivxStrn[osd_font_mode][12].str,  DRM_FONT_COLOR, DRM_BACK_COLOR );
        goto DRM_MENU_START;
        break;

    case DRM_DISPLAY_HW_UNSUPPORTED:
    
        osd_DrawString( DivxStrn[osd_font_mode][13].xst, DivxStrn[osd_font_mode][13].yst, DivxStrn[osd_font_mode][13].str, DRM_FONT_COLOR, DRM_BACK_COLOR );
        break;

    case DRM_DISPLAY_AES_ONLY:
        
        osd_DrawString( DivxStrn[osd_font_mode][14].xst, DivxStrn[osd_font_mode][14].yst, DivxStrn[osd_font_mode][14].str, DRM_FONT_COLOR, DRM_BACK_COLOR );
        break;

    default:
        return -1;
        break;
    }

    osd_DrawString( DivxStrn[osd_font_mode][15].xst, DivxStrn[osd_font_mode][15].yst, DivxStrn[osd_font_mode][15].str, DRM_BACK_COLOR, DRM_FONT_COLOR );

DRM_MENU_START:

    full_scrn = DIVX_DRM_MENU;
    
    //Maoyong added for IR U/D/L/R/Sel proc func setting 2004-9-24 10:14
    SetFullscrnCmdFuncPtr( ircmd_null, ircmd_null, divx_func_left,
                                   divx_func_right, divx_func_select);
    int iRet = 0;

    if( iPage != DRM_DISPLAY_REGISTRATION_CODE )
    {
        int iBtnYes = 1;
        
        while( 1 )
        {
            polling();

            if( sys_cmd == ( CMD_SELECT | CMD_FUNC_GAME_L ) )
                iBtnYes = 1;
            else if( sys_cmd == ( CMD_SELECT | CMD_FUNC_GAME_R ) )
                iBtnYes = 0;
            else if( sys_cmd == ( CMD_FUNC | CMD_FUNC_SELECT ) )
                break;

            if( iPage == DRM_DISPLAY_RENTAL_CONFIRMATION )
            {
                if( iBtnYes )
                {
                    osd_DrawString( DivxStrn[osd_font_mode][11].xst, DivxStrn[osd_font_mode][11].yst, DivxStrn[osd_font_mode][11].str, DRM_BACK_COLOR, DRM_FONT_COLOR );
                    osd_DrawString( DivxStrn[osd_font_mode][12].xst, DivxStrn[osd_font_mode][12].yst, DivxStrn[osd_font_mode][12].str,  DRM_FONT_COLOR, DRM_BACK_COLOR );
                }
                else
                {
                    osd_DrawString( DivxStrn[osd_font_mode][11].xst, DivxStrn[osd_font_mode][11].yst, DivxStrn[osd_font_mode][11].str, DRM_FONT_COLOR, DRM_BACK_COLOR );
                    osd_DrawString( DivxStrn[osd_font_mode][12].xst, DivxStrn[osd_font_mode][12].yst, DivxStrn[osd_font_mode][12].str,  DRM_BACK_COLOR, DRM_FONT_COLOR );                    
                }

                iRet = iBtnYes;
            }

            sys_cmd = 0;
        }
    }
    
    return iRet;
}
#endif//#ifndef DRM_SHOW_FOLLOW_OSD_LANGUAGE_SET

#endif//#ifdef SUPPORT_DIVX_HOME_THEATER


⌨️ 快捷键说明

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