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

📄 filemodegui_pub.c

📁 dvd里面的一个文件系统的代码
💻 C
📖 第 1 页 / 共 5 页
字号:
 *                                                                                       *
\****************************************************************************************/
void FileModeGUI_right(void)
{
    //input table right
    if(full_scrn & INPUT_TBL)
    {
        input_str_func_right();
        return;
    }
    
    printf("\n============FileModeGUI_right================\n");
    if(pFsJpeg->ControlArea == CNT_AREA_SRCE)
    {
        Switch2SrcDesBuf(DEST);

        if(pFsJpeg->gifsState == FS_STATE_MEDIA)
        {
            pFsJpeg->ControlArea=CNT_AREA_DEST;
            FSGUI_FileMode_Init();
        
            //if(mediaStr[1] == "CDROM")
            if(!(strcmp(mediaStr[1],"CDROM")))
                pFsJpeg->media_will = pFsJpeg->media_current = 2;
            else
                pFsJpeg->media_will = pFsJpeg->media_current = 1; 
        }
        ShowWarning("PLEASE SELECT TO ENTER");             
    }
    else if(pFsJpeg->ControlArea == CNT_AREA_DEST)
    {
        pFsJpeg->ControlArea=CNT_AREA_CAPACITYBUTTON;  
        ShowWarning(functionStr[5]); 
    }
    else if(pFsJpeg->ControlArea == CNT_AREA_CAPACITYBUTTON)
    {
        pFsJpeg->ControlArea = CNT_AREA_DEST; 
        pFsJpeg->gifsFuncBtn = 0;           
        Switch2SrcDesBuf(DEST);
        if(pFsJpeg->gifsState == FS_STATE_MEDIA)
        {
            pFsJpeg->ControlArea=CNT_AREA_DEST;
            FSGUI_FileMode_Init();
        
            //if(mediaStr[1] == "CDROM")
            if(!(strcmp(mediaStr[1],"CDROM")))
                pFsJpeg->media_will = pFsJpeg->media_current = 2;
            else
                pFsJpeg->media_will = pFsJpeg->media_current = 1;             
        }  
        else  
        HL_show = pFsJpeg->file_current_in_page;                            
        ShowWarning("PLEASE SELECT TO ENTER");                        
    }
    else
    {
        int buttonNum = pFsJpeg->ControlArea;
        if(pFsJpeg->ControlArea <= CNT_AREA_CAPACITYBUTTON)
        {
            buttonNum ++;
            pFsJpeg->ControlArea = buttonNum;
            ShowWarning(functionStr[buttonNum -7]);   //need according to the user's define                         
        }
        if(pFsJpeg->ControlArea > CNT_AREA_CAPACITYBUTTON)
        {
            Switch2SrcDesBuf(DEST);
            ShowWarning("PLEASE SELECT TO ENTER");
        }
    }                
    ShowHL();
}
//*******************************************************************************************//
//play
void FileModeGUI_play(void)
{
    printf("\n============FileModeGUI_play================\n");

    if(pFsJpeg->gifsState == FS_STATE_MEDIA)
    {
        if(pFsJpeg->ControlArea == CNT_AREA_SRCE)
        {
            //to clear old control area.
            old_ControlArea = 0;
            
            file_mode_flag = 0;
            FileModeJudgeSelMedia();
            FileModeSwitchMedia();
        }
    }
}
/****************************************************************************************\
 *                                                                                       *
 *  Function Name : show_fat_dir_file_info                                               *
 *                                                                                       *
 *  Purposes      :  Show fat dir and file information in dubug.                         *
 *                                                                                       *
 *  Descriptions  :   Use for test.                                                      *
 *                                                                                       *
 *  Arguments     : (none)                                                               *
 *                                                                                       *
 *  Returns       : (none)                                                               *
 *                                                                                       *
 *  See also      :                                                                      *
 *                                                                                       *
\****************************************************************************************/
void show_fat_dir_file_info(void) 
{
#ifdef FILE_MODE_WRITE_DBG    
    printf("===========Show directory sturcture=========.\n");
    printf("===========all dir count:%d=========\n",pFsJpeg->iso9660_dir_cnt);
    int i,j,k;
    for (i = 0; i < pFsJpeg->iso9660_dir_cnt; i++)
    {
        printf("\nDir===%d:[%s],parent_dir===%d\n", i, iso9660_dir[i].name,iso9660_dir[i].parent_dir);
    }
    printf("Show the file name in the related directory .\n");
    for (i = 0; i < pFsJpeg->iso9660_dir_cnt; i++)
    {
        printf("\n===READ DIR:%d name:[%s],file amount:%d \n",i,iso9660_dir[i].name,iso9660_dir[i].dir);
        k=0;
        for (j = 0; j < pFsJpeg->iso9660_file_cnt; j++)
        {
            if(i == FS_GetFileProperty(j,FILE_PROPERTY_PARENT_FOLDER))
            //if(i==iso9660_file[j].parent_dir)
                printf("  (%d)File:%s\n",++k,FS_GetFileProperty(j,FILE_PROPERTY_NAME));
                //printf("  (%d)File:%s\n",++k,iso9660_file[j].name);            
        }    
    }
#endif 
} 

void ShowFileItem(UINT16 xStart,int hl_index)
{
    UINT16 index;
//whb modified    
//S:去除bug:file list 翻页且下一页文件数不足 PER_PAGE 个时,在list最后一行显示有误
    if( ((pFsJpeg->file_count_in_dir - PER_PAGE*(pFsJpeg->file_page_index) ) < PER_PAGE)
        && ( hl_index == (PER_PAGE-1) ) && ( hl_index == old_hl_index ) )
        hl_index = 0;
        
    old_hl_index = hl_index;
        
    index = hl_index+PER_PAGE*(pFsJpeg->file_page_index);
    if(pFsJpeg->ControlArea == CNT_AREA_SRCE)
        index = DirFileCount1[index];
    else if((pFsJpeg->ControlArea == CNT_AREA_DEST)||(pFsJpeg->ControlArea == CNT_AREA_CAPACITYBUTTON))
        index = DirFileCount2[index];

    if(index == ISO_FILE_MAX)
        ShowSrceItem(xStart, hl_index,"\\..");	        
    else if(index > ISO_FILE_MAX)
        ShowSrceItem(xStart, hl_index,iso9660_dir[(index-ISO_FILE_MAX)].name);            
    else
        ShowSrceItem(xStart, hl_index, FS_GetFileProperty(index,FILE_PROPERTY_NAME));
        //ShowSrceItem(xStart, hl_index,iso9660_file[index].name);
}

/****************************************************************************************\
 *                                                                                       *
 *  Function Name : Src_FileMode_DirList                                                 *
 *                                                                                       *
 *  Purposes      : Show all dir or file item  in that we select dir .                   *
 *                                                                                       *
 *  Descriptions  :                                                                      *
 *                                                                                       *
 *  Arguments     : (none)                                                               *
 *                                                                                       *
 *  Returns       : (none)                                                               *
 *                                                                                       *
 *  See also      :                                                                      *
 *                                                                                       *
\****************************************************************************************/
void FileMode_DirList(UINT16 iDirIndex)
{
    #ifdef FILE_MODE_WRITE_DBG   
    printf("\n===========Src_FileMode_DirList=========.\n");
    #endif
    int i = 0,j = 0;
    UINT16 xStart = 0; 
    int iconArea = 0;      
    
    if(pFsJpeg == &(share_data.JPEG)) 
    {
        pFsJpeg->ControlArea=CNT_AREA_SRCE;
        xStart = FS_DIRLIST_XSTART;
        iconArea = FS_AREA_DIRICON;
    } 
    else if(pFsJpeg == pFsJpeg_des_buf) 
    {
        pFsJpeg->ControlArea=CNT_AREA_DEST; 
        xStart = fsArea[FS_AREA_FILEITEM].xStart + 4;
        iconArea = FS_AREA_FILEICON;        
    }     

    pFsJpeg->file_count_in_dir = JudgeDir(iDirIndex);//total file count.
    printf("--------pFsJpeg->file_count_in_dir = %d\n",pFsJpeg->file_count_in_dir);
    if(pFsJpeg->file_count_in_dir >= PER_PAGE*(pFsJpeg->file_page_index+1))
        j = PER_PAGE;
    else
        j = (pFsJpeg->file_count_in_dir) % PER_PAGE;
	
	for(i=0;i<j;i++)
	{
	    int index = 0;
        if(pFsJpeg->ControlArea == CNT_AREA_SRCE)
	        index = DirFileCount1[i+PER_PAGE*(pFsJpeg->file_page_index)];
        else if(pFsJpeg->ControlArea == CNT_AREA_DEST)
	        index = DirFileCount2[i+PER_PAGE*(pFsJpeg->file_page_index)];  
 
	    if(index == ISO_FILE_MAX )
	    {
	        printf("\n===========\\..=========\n");
            ShowSrceItem(xStart, 0,"\\..");	        
	    }
	    else if(index > ISO_FILE_MAX)
	    {   
	        printf("\n===========FSShowMediaIcon=========\n");
            ShowSrceItem(xStart, i,iso9660_dir[(index-ISO_FILE_MAX)].name);            
	        FSShowFatIcon(fsArea[iconArea].xStart,i);	        
	    }
	    else
	    {
	        printf("\n===========FSShowFileIcon=========\n");	       
            ShowSrceItem(xStart, i,FS_GetFileProperty(index,FILE_PROPERTY_NAME));
            //ShowSrceItem(xStart, i,iso9660_file[index].name); 
	        FSShowFileIcon(index, iconArea,i);	       
	    }
	}
}
/****************************************************************************************\
 *                                                                                       *
 *  Function Name : ShowSrceItem                                                         *
 *                                                                                       *
 *  Purposes      : Show Source dir or file item                                         *
 *                                                                                       *
 *  Descriptions  :                                                                      *
 *                                                                                       *
 *  Arguments     : (none)                                                               *
 *                                                                                       *
 *  Returns       : (none)                                                               *
 *                                                                                       *
 *  See also      :                                                                      *
 *                                                                                       *
\****************************************************************************************/
void ShowSrceItem(UINT16 xStart,int iItem, const char *s)
{
  	char    buf[20];
    psprintf(buf,s);
#ifdef FS_BMP_GUI
    FSGUI_ShowString( xStart + 46, 
		(FS_DIRLIST_YSTART+ FS_FILELIST_YSTEP * iItem ), 
		buf, file_focus_y, file_focus_CrCb);
#else	
	FSGUI_ShowString( xStart, 
		(FS_DIRLIST_YSTART+ FS_FILELIST_YSTEP * iItem ), 
		buf, FS_FONTCOLOR_FILE_Y, FS_FONTCOLOR_FILE_CrCb);
#endif    
}
/****************************************************************************************\
 *                                                                                       *
 *  Function Name : FSShowFileIcon                                                       *
 *                                                                                       *
 *  Purposes      : Show file ICON                                                       *
 *                                                                                       *
 *  Descriptions  :                                                                      *
 *                                                                                       *
 *  Arguments     : (none)                                                               *
 *                                                                                       *
 *  Returns       : (none)                                                               *
 *                                                                                       *
 *  See also      :                                                                      *
 *                                                                                       *
\****************************************************************************************/
void FSShowFileIcon(UINT16 index, BYTE area, int yLoc)
{
    int type = 0;
    
    switch(FS_GetFileProperty(index,FILE_PROPERTY_FILE_TYPE))
    //switch(iso9660_file[index].file_type)
    {
        case CDROM:
        case CDROM_WMA:
            type = CNT_AREA_MP3BUTTON - 2;
            break;
        case CDROM_JPEG:
            type = CNT_AREA_JPEGBUTTON - 2;
            break;
        case CDROM_MPG:

⌨️ 快捷键说明

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