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

📄 fsgui_osd.c

📁 dvd里面的一个文件系统的代码
💻 C
📖 第 1 页 / 共 3 页
字号:
/**************************************************************
** FILE
** fsGUI_osd.c
**
** DESCRIPTION
**  build a GUI like PC with OSD for MP3/JPEG/WMA ,ect.
**
**
**   Creator:  zhaoyanhua
** 	 Date:     2004-4-2 11:04
****************************************************************/

#include "global.h"
#include "func.h"
#include "memmap.h"
#include "util.h"
#include "graph.h"
#include "memcfg.h"
#include "framebuf.h"
#include "macro.h"
#include "stc.h"
#include "cfont.h"
#include "vfdfunc.h"
#include "osd.h"
#include "image.h"
#include "nesinit.h"
#include "fs96602.h"
#include "fsNAV.h"
#include "fsGUI.h"
#include "fsGUI1.h"

#ifdef SUPPORT_FLASH_UI
#include "FHUI.h"  // add ; hf.pang ; 2006-12-07
#endif

#ifdef OP_UI
#include "menu_def.h"
#include "menu_page.h"
#include "fsGUI_osd_def.h"
#include "fsGUI_osd_func.h"
#include "fs_OSD_bmp.h"
#include "osdGUI_def.h"
#include "osdGUI_func.h"
#include "Infobanner_def.h"
//mainmenu related
extern int	menu_page;
extern int	menu_level;
extern int HL_menu;
extern BYTE index_y1;



UINT16 dir_set_top = 0;
BYTE selected_flag = NONE_SELECTED;
//define null funciton about fsGUI1.c
void FSGUI_JpgUpdateOSD(void)
{}



UINT16 CountSpecifyFile(int iDir)
{}
void Playing2Will(void)
{}

void FSGUI_UpdateInfoArea(BYTE* strInfo)
{}

void FSGUI_Refresh(void)
{}

int FSGUI_PreChangeDir(UINT16 *iDir,UINT16 iDirect)
{}



void FindPreSelectFileDir(UINT16 *iSelect)
{}

void FSGUI_Menu()
{
    #ifdef SUPPORT_FLASH_UI // add for Native32 Game UI ; hf.pang ; 2007-04-06
    if(g_iFHUIFileExisted)
    {
        return;
    }
   #endif

    FSGUI_OsdMenu();
}

int FSGUI_Select(int iSelect)
{}

void FSGUI_Stop()
{}

void FSGUI_JpgPreview()
{}

void FSGUI_CookFileItem(BYTE iItem)
{}

int  FSGUI_GetDispTrack()
{}

void Restore2PlayingDir(void)
{}

void Restore2PlayingFile(void)
{}

void FSGUI_Shuffle()
{}

UINT32  FSGUI_IsSelectable()
{}

void FSGUI_2Last()
{}

void FSGUI_FileSelect(int iSelect)
{}

void FSGUI_ProgSelect(UINT16 index)
{
    UINT16 iSel = 0;
    UINT16 i = 0;
    
    iSel = prog[index][1] - 1; //get real file index.
    if (iSel >= SUB_FOLDER_BASE)//current prog item is folder
    {    
        pFsJpeg->fsnav_dir_now = iSel - SUB_FOLDER_BASE;//get real dir index in iso9660_dir
        CalcDirFirstPage(pFsJpeg->fsnav_dir_now);
        dir_set_top = 0;
        //printf("#### progselect ,pFsJpeg->fsnav_dir_now:%d,pFsJpeg->fsnav_trk_now:%d--\n",pFsJpeg->fsnav_dir_now,pFsJpeg->fsnav_trk_now);
        //get dir_set[] index value
        for (i = 0; i < pFsJpeg->iso9660_dir_cnt; i++)
        {
            if(dir_set[i] == pFsJpeg->fsnav_dir_now)
            {   
                dir_set_top = i;
                break;
            }
        }
    }
    else//current prog item is file
    {
        pFsJpeg->fsnav_dir_now = prog[index][0]; 
        CalcDirFirstPage(pFsJpeg->fsnav_dir_now);
        pFsJpeg->fsnav_trk_now = iSel - pFsJpeg->first_mp3_entry;
    }
    
    //FSGUI_FileSelect();
    
    if(pFsJpeg->gifsFuncBtn == FS_FUNC_MP3)
        pFsJpeg->gifsState = FS_STATE_MP3;
        
    FSGUI_ShowCurrentSelection((pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry));
}


/*
 *  Description:
 *     to judge if the folder is in its end.
 *
 *  INPUT:
 *     Direction:  
 *          PAGE_UP----> judge if the current file of the folder(iDir) is  its first file
 *          PAGE_DOWN ---> judge if the current file of the folder(iDir) is in its final file.  
 *
 *  RETURN:
 *          TRUE or FALSE
 */
BYTE FSGUI_IsFolderEnd(UINT16 iDir, BYTE Direction)
{
    BYTE  EndFlag = FALSE;
    
    if ((Direction == PAGE_UP) 
    && (pFsJpeg->fsnav_trk_now <= 0))
    {
        EndFlag = TRUE;
    }
    else if ((Direction == PAGE_DOWN) 
    && (pFsJpeg->fsnav_trk_now >= (iso9660_dir[iDir].dir - 1)))
        EndFlag = TRUE;
        
    return EndFlag;
}

/*
 * Description:
 *    Find the first file in this dir
 *
 * INPUT:
 *    type :---> MP3
 *          ---> JPEG
 *
 *    iDir  ---> the dir index(in iso9660_dir)
 *
 * RETURN:
 *    If iDir has this type file, return first file index(in iso9660_file) 
 *    else return -1;
 */
INT16  FSGUI_FindFirstFileForDir(int type, int iDir)
{
    INT16 first_file_index = 0;
    
    if ((iso9660_dir[iDir].type) & (0x01 << type))  
    {
        do
        {
            if (FS_GetFileProperty((first_file_index + pFsJpeg->first_mp3_entry),FILE_PROPERTY_CATEGORY) == type)
            //if (iso9660_file[(first_file_index + pFsJpeg->first_mp3_entry)].type == type)
                break;
            else
                first_file_index ++;
        }while(1); 
    }
    else
    {
        first_file_index = -1;    
    } 

    return first_file_index;
}

/*
 * Description:
 *    when in slide JPEG, stop slide mode return to menu.
 *
 */
void FSGUI_Return2Menu(void)
{
    pFsJpeg->gbfsSlide	= 0;
   
    pFsJpeg->gifsbPreview = 0; 
    //play_state = VCD_STATE_MP3_FILELIST; 
    pFsJpeg->gifsFuncBtn = FS_FUNC_MP3;
    resumeMSF = 0;
#ifdef SURRORT_MP3_PREPLAY
	FS_ClearPreplayFlag();
#endif//#ifdef SURRORT_MP3_PREPLAY

    if (pFsJpeg->gifsState == FS_STATE_JPEG)
    {
        config_memory(MEMORY_GRAPH_SMALL);
    	setup_tv_format(tv_format);
        reset_zoom_state();  
        startup_vpp();
        AVD_ResetMediaStatus();
        #if defined(FALSE_POWER)&&defined(STOP_LOADER)//zhuyanfeng20041008	
		pFsJpeg->gifsbPreview = 0;
		#ifndef SUPPORT_DPF_UI
		ShowTitle();
		#endif
        #else
		FS_ForceReturn2Menu();
		#endif
        //printf("#### 111111------RETURN 2 menu sys_cmd:%d--\n",sys_cmd);
        
        
        //NOTE:
        //must load the code again.
        //else  hang.
        //zhaoyanhua note 2004-5-8 11:43
        FSNav_MP3Init();
        #ifndef SUPPORT_DPF_UI
        ShowTitle();
        #endif
        sys_cmd = 0;//must clear 0
    }
    pFsJpeg->gifsState = FS_STATE_LIST;
    
    //show GUI menu
    FSGUI_Osdinit();
    FSGUI_RefreshMenu(1);
    
}

int FSGUI_NormalPrev(void)
{
    int done = 0;
    UINT16 dir_real_index = 0;
    BYTE   need_new_dir = FALSE;
    UINT16 top = dir_set_top;
    int temp = 0x01 << pFsJpeg->gifsFuncBtn ;
 
    printf("##### FSGUI_NormalPrev ---############--\n");
    
    if (FSGUI_IsFolderEnd(pFsJpeg->fsnav_dir_now, PAGE_UP) == TRUE)//the first file in current dir
    {
        need_new_dir = TRUE;
    }
    else //if (FSGUI_IsFolderEnd() == FALSE)//not change dir
    {
        
        dir_real_index = dir_set[top];
        printf("\n-------not change dir---------\n");
        do
        {
            if (FSGUI_IsFolderEnd(pFsJpeg->fsnav_dir_now, PAGE_UP) == TRUE)//(pFsJpeg->fsnav_trk_now <= 0)
            {   
                need_new_dir = TRUE;
                
                break;
            } 
              
            pFsJpeg->fsnav_trk_now --;
            
            printf("file:%d------type:%d, name=%s, pFsJpeg->gifsFuncBtn:%d\n",
                    pFsJpeg->fsnav_trk_now, 
                    FS_GetFileProperty(pFsJpeg->fsnav_trk_now+pFsJpeg->first_mp3_entry,FILE_PROPERTY_CATEGORY),
                    FS_GetFileProperty(pFsJpeg->fsnav_trk_now+pFsJpeg->first_mp3_entry,FILE_PROPERTY_NAME),
                    pFsJpeg->gifsFuncBtn);
            //printf("file:%d------type:%d, name=%s, pFsJpeg->gifsFuncBtn:%d\n",pFsJpeg->fsnav_trk_now, iso9660_file[pFsJpeg->fsnav_trk_now+pFsJpeg->first_mp3_entry].type,iso9660_file[pFsJpeg->fsnav_trk_now+pFsJpeg->first_mp3_entry].name, pFsJpeg->gifsFuncBtn);

            if (FS_GetFileProperty((pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry),FILE_PROPERTY_CATEGORY) == (pFsJpeg->gifsFuncBtn))
            //if (iso9660_file[(pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry)].type == (pFsJpeg->gifsFuncBtn))
            {
                printf("\n### file FOUND---!!!!!!!!!!!\n");
                if (pFsJpeg->gifsFuncBtn == FS_FUNC_MP3)
                {//when playing MP3, must refresh GUI  
                    pFsJpeg->gifsState = FS_STATE_MP3;//after fs_MP3Mainloop, pFsJpeg->gifsState changed, must reset again.  
                    if (pFsJpeg->fsnav_dir_now == dir_real_index)//update GUI only when the dir in GUI is same with playing dir
			        {
                    	if ((info_mode == INFO_FULL) && (t_disp == 1))
                    		 show_info_banner_page();
			            else
			                FSGUI_OsdCmdUp();
			        }                    
                    FSGUI_ShowCurrentSelection((pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry));
                }
                break;
            }
           
        }while(1);
    }
    
    //change dir
    if (need_new_dir == TRUE)
    {
        printf("--------change dir----------------\n");
        do
        {
            if (top <= 0)
            {
                printf("############ all dir is played over --pFsJpeg->fsnav_trk_now:%d-\n",pFsJpeg->fsnav_trk_now);
                //top = 0;
                //pFsJpeg->fsnav_dir_now = 0;
                pFsJpeg->gbfsSlide = 0;
                sys_cmd = 0;
                pFsJpeg->gifsState = FS_STATE_LIST;
                //fsGUI_RefreshMenu(1); 
                done = 1;
                break;
            }
                
            top--;
            dir_real_index = dir_set[top];
            
            printf(" iso9660_dir[dir_real_index].type=%x, 0x01 << pFsJpeg->gifsFuncBtn :%d, pFsJpeg->gifsFuncBtn:%d, cnt :%d ,name :%s\n",iso9660_dir[dir_real_index].type, temp, pFsJpeg->gifsFuncBtn, dir_real_index, iso9660_dir[dir_real_index].name);
            //printf("Compare result ;%x",((iso9660_dir[dir_real_index].type)& temp));
            
            if (((iso9660_dir[dir_real_index].type) & (0x01 << pFsJpeg->gifsFuncBtn)))
            {
                dir_set_top = top;
                pFsJpeg->fsnav_dir_now = dir_real_index;
                CalcDirFirstPage(pFsJpeg->fsnav_dir_now);
                pFsJpeg->fsnav_trk_now = FSGUI_FindFirstFileForDir(pFsJpeg->gifsFuncBtn, pFsJpeg->fsnav_dir_now);
                //pFsJpeg->fsnav_trk_now = 0;
                if (pFsJpeg->gifsFuncBtn == FS_FUNC_MP3)//when playing MP3, must refresh GUI  
                {   
                    pFsJpeg->gifsState = FS_STATE_MP3; 
                    FSGUI_RefreshMenu(1);
                }          
                break; 
            }

        }while(1);

    }//if (need_new_dir == TRUE)

⌨️ 快捷键说明

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