📄 fmanager.h
字号:
/**************************************************************************
(C)Copyright Cheertek Inc. 2002-2003,
D300, all right reserved
Product : VCD / DVD Firmware
Date : 1999.7.19
Author : Winbond (D300 WWC)
Purpose : Provide the MP3 control
Sources : mp3.c
****************************************************************************/
#ifndef __FMANAGER_H__
#define __FMANAGER_H__
#ifdef __cplusplus
extern "C"{
#endif
//////////////////////////////////////////////////////////////////////////
// Must remove to other module information !!
// Notice: must check if it's suitable to declared them within OSDFM.H
// while support run-time selection action or not
// LLY0.83b-2, must define selection cursor while support run-time selection
#define OSDFM_MSG_UPDATE_SELECTION OSDFM_MSG_UPDATE_HIGHLIGHT
#define OSDFM_MSG_CLEAR_SELECTION OSDFM_MSG_CLEAR_HIGHLIGHT
#define OSDPL_MSG_UPDATE_SELECTION OSDPL_MSG_UPDATE_HIGHLIGHT
#define OSDPL_MSG_CLEAR_SELECTION OSDPL_MSG_CLEAR_HIGHLIGHT
/////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
// ***** The reference variables for a page display Area *****
// 1. To get the directory name or file name
// * Access __pFMNameList[n].cName.
// * The max. length of cName is FM_MAX_STRING_LENGTH,
// * or the cName is terminated with end of string character '\0'.
// 2. To decide the number of items to be displayed
// * The __bFMMenuPage.w1stID is used as the first index to access the __pFMNameList.
// * The __bFMMenuPage.wNOofItems is the max. number of items to be displayed.
// 3. To get current directory's name
// * Access __pFMDirNameList[__bFMActiveDir].cName
// 4. To decide which layer menu selection
// CT9928AF solution:
// * __bFMMenuID = FM_MENU_NONE, leave File Manager control menu
// * __bFMMenuID < FM_MENU_FILE, currently in directory selection list.
// * __bFMMenuID >= FM_MENU_FILE, currently in file selection list.
// CT908 solution:
// * __bFMMenuID = FM_MENU_NONE, leave File Manager control menu
// * __bFMMenuID = FM_MENU_NORMAL, within File Manager control menu
// * __bFMMenuID = FM_MENU_EDITPROG, within input program menu
// * __bFMMenuID = FM_MENU_PROGLIST, within program list menu
// 5. To get total files number
// * __wFMTotalFiles.
// 7. To get current time
// * gcShowStatus.wCurrentTime.
// 8. To get current track
// * gcShowStatus.wCurrentTrack.
////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
// ***** Global Definition Area *****
// **** If define it, cursor index/ playing item index will used disc view
// DISC_VIEW: index from 1 ~ total files within the disc
// DIR_VIEW: index from 1 ~ total files within the directory
// wyc1.07a, disable this define because in CT908 UI mode won't use it.
// #define DISC_VIEW
//CoCo1.24a, open this define to support JPEG full screen.
#define JPEG_FULL_SCREEN
// wyc1.07, add a define to supporting on/off FM UI.
#define SUPPORT_FM_UI_ON_OFF
// wyc1.10, new define to control show numner or "..." when detecting CDROM files.
//#define SUPPORT_SHOW_FILE_NUMBER_IN_DETECTION
// [0] If define it, F/W will save file relative information into DRAM
// Thus, we can support more 330 files within one title
/// Otherwise, it only support <= 330 files within one title
#define SAVE_FILE_INFO_IN_DRAM
// [1] Max directory number which F/W can support
// Modify this value to support more or less directory in a disc
#define FM_MAX_DIR_NO 150 // max. number of directory
// [2-1] Max file number which F/W can support
// Modify this value to support more or less files in a disc.
// but if exceed 256, need do more extra chage on some variables
// LLY2.80, enlarge the max file number within one title, 330 --> 1000
// wyc1.00 ,modify the max. supporting file to 9999
#ifdef SAVE_FILE_INFO_IN_DRAM
// wyc1.22
#define FM_MAX_FILE_NO_ONE_TITLE 2800 // max. number of files within one title
#define FM_MAX_PARSE_DIR_SECTORS (FM_MAX_FILE_NO_ONE_TITLE / 30)
#else // #ifdef SAVE_FILE_INFO_IN_DRAM
#define FM_MAX_FILE_NO_ONE_TITLE 330 // max. number of files within one title
#endif // #ifdef SAVE_FILE_INFO_IN_DRAM
// [2-2] The max file number for once time CDROM parsing(SRAM buffer issue)
// LLY2.81, reduce max file number of once time, 330 --> 200
// Because, we must reserve some SRAM space to store directory tree information
// Notice: will support multi-parsering of one directory
#ifdef SAVE_FILE_INFO_IN_DRAM
#define FM_MAX_FILE_NO_ONCE_TIME 150 // wyc1.00
#else // #ifdef SAVE_FILE_INFO_IN_DRAM
#define FM_MAX_FILE_NO_ONCE_TIME FM_MAX_FILE_NO_ONE_TITLE
#endif // #ifdef SAVE_FILE_INFO_IN_DRAM
// [2-3] When supporting more than 200 files, need to add some offset for showing correct file name when acrossing 200 boundary.
// This value also sholud be minimum OSDFM_MAX_ITEM_IN_FILE_WINDOW-1, but because we need to support thumbnail mode.
// So the FM_MAX_FILE_NO_ONCE_TIME + offset suggest can be divide by COLUMN_NUM*ROW_NUM. So suggest offset number is 0.
#define FM_MAX_FILE_NO_OFFSET 10
// [3] Max string length for directory/ file name
// The max directory name length = (max file name length + 1)
// Because, directory name will share the bExtID element space in FILENAMEINFO structure
// Notice: Must re-adjust the max string length if reserved DRAM space is larger (CT908)
// because, file relative info. will be saved in DRAM
// Max length for FILENAMEINFO structure
// wyc1.07, extend to 14 bytes
#define FILENAMEINFO_LENGTH 14//8 // size (cName+bExtID)
#define FM_MAX_STRING_LENGTH (FILENAMEINFO_LENGTH - 2) // decrease 2 is because one is for NULL and one is for extension ID.
#ifdef SUPPORT_UNICODE
#define FM_MAX_DIRNAME_LENGTH (FM_MAX_STRING_LENGTH - 1) // decrease 2 is because until now we support 6 chars in dir.
// Max length of DIRNAMEINFO structure
#define DIRNAMEINFO_LENGTH (FILENAMEINFO_LENGTH-1) // add 2 is because add NULL char and dir attribute
#else
#define FM_MAX_DIRNAME_LENGTH (FM_MAX_STRING_LENGTH - 2) // decrease 2 is because until now we support 6 chars in dir.
// Max length of DIRNAMEINFO structure
#define DIRNAMEINFO_LENGTH (FILENAMEINFO_LENGTH-2) // add 2 is because add NULL char and dir attribute
#endif
#define FM_MAX_FILENAME_LENGTH (FM_MAX_STRING_LENGTH) // support 8 chars in file name part.
// [4] Define the DRAM address for data saving -- LLY2.80
// Must share DRAM : 0x2400 ~ 0x3C00 = 6K DWORD
// Using max file <= 1000 in our suggestion
// Notice: must re-allocate the DRAM space if enlarge the max file number
// --> JPEG status (1K DWORD) : 1000 files * 3bytes = 0.75K DWORD
// --> File Name List (2K DWORD) : 1000 files * (6 char + 1 '\0' + 1 extension ID) = 2K DWORD
// --> File TOC info. (1.25K DWORD) : 1000 files * (3 "start sector" + 2 "length") = 1.25K DWORD
// --> Dir Name List (0.5K DWORD) : 150 directorys * (6 char + 1 '\0' + 1 entension ID) = 0.3K DWORD
// wyc1.10, add new mode for AE version IC.
// wyc2.27, re-define the DRAM allocation for FM user data.
#if (SDRAM_CONFIGURATION == SDRAM_32M) || (SDRAM_CONFIGURATION == SDRAM_32M_D) || (SDRAM_CONFIGURATION == SDRAM_16M) //wyc.230
// wyc1.22, modify the user data for FM in BE version to support playing VOB file.
#define FM_FILE_NAME_BUFFER_ADDR (W99AV_DRAM_ADDR_RESERVE_START_FM)
// wyc2.30, remove TOC because of file record have cover it, also add (DWORD) to avoid getting wrong address in DRAM.
#define FM_DIR_NAME_BUFFER_ADDR (FM_FILE_NAME_BUFFER_ADDR + (DWORD)(FM_MAX_FILE_NO_ONE_TITLE*FILE_RECORD_LENGTH/4))
#elif SDRAM_CONFIGURATION == SDRAM_64M
#define FM_JPG_BUFFER_ADDR (W99AV_DRAM_ADDR_RESERVE_START)
#define FM_FILE_NAME_BUFFER_ADDR (W99AV_DRAM_ADDR_RESERVE_START+2500)
#define FM_FILE_TOC_BUFFER_ADDR (W99AV_DRAM_ADDR_RESERVE_START+17500)
#define FM_DIR_NAME_BUFFER_ADDR (W99AV_DRAM_ADDR_RESERVE_START+23750)
#endif
// [5] Time-Out value for JPEG slide show
#define TIMEOUT_FOR_JPEG_SLIDE_SHOW ((DWORD)COUNT_5_SEC)
// [6] Debug infomation for JPEG playing
/* --CoCo1.22
#define PARSER_JPEG_HEADER_FAIL 7001
#define DECODE_JPEG_PROCEDURE_HANG 7002
#define DECODE_MP3_PROCEDURE_HANG 7003
#define DECODE_WMA_PROCEDURE_HANG 7004
*/
//CoCo1.22, modify the definition about error message.
#define FM_JPEG_PARSE_HEADER_FAIL 7001
#define FM_JPEG_PARSE_HEADER_UNFINISH 7002
#define FM_JPEG_PARSE_HEADER_UNSUPPORT 7003
#define FM_JPEG_DECODE_FAIL 7004
#define FM_JPEG_DECODE_HANG 7005
#define FM_MP3_DECODE_HANG 7101
#define FM_WMA_DECODE_HANG 7201
// [7] The max time for redecoding action while decoding error
#define REDECODE_COUNT_LIMIT 3 // LLY.275a
// [8] if define it, F/W will support file manager like UI (Only support for CT908)
// Otherwise, F/W will support file list menu UI (CT9928AF solution) -- LLY2.80
#undef DISC_VIEW
// [9] The max digit number usage
// wyc1.07, because CC will reference this define to control the 10+ or confirm key number selection restriction. So update it to make user can select more
// than 4 digits.
#define FM_MAX_NUMBER 9990
// [10] The max control button number
#define MAX_CTL_BTN_NO 6
//////////////////////////////////////////////////////////////
// ***** Structure Define Area *****
// [0] Menu Page info. structure
// LLY2.80, re-adjust the element structure
// (1) Reduce some variables unit from WORD to BYTE:
// ex. wNOofItems/ wTotalPages/ wPageIndex
// (2) Replace some variables with global variables:
// ex. wDirIndex
// (3) Remove __wHighLight/ __wSelection
typedef struct tagMENUPAGEINFO
{
// Index always from "0", ie. 0 means 1st directory/ file, 1 means 2nd directory/ file, ...
WORD w1stID; // 1st item index of current file list page
BYTE bNOofItems; // number of items to be display for current file list page
BYTE bTotalPages; // total page number of current directory/file menu page
BYTE bPageIndex; // the current page index of current directory/ file menu page
} MENUPAGEINFO, * PMENUPAGEINFO;
// [1] File name information structure
typedef struct tagFILENAMEINFO
{
// wyc2.36, add one bytes for unicode issue beause unicode string will have 00 bytes. So need to use 00 00 to represent end of string.
#ifdef SUPPORT_UNICODE
char cName[FM_MAX_STRING_LENGTH+2];
#else
char cName[FM_MAX_STRING_LENGTH+1];
#endif
BYTE bExtID;
} FILENAMEINFO, * PFILENAMEINFO;
// [3] DRAM location for File Relative Buffer -- LLY2.80
typedef struct tagDRAM_LOC
{
DWORD dwFileName; // starting DRAM address of file name buffer
DWORD dwFileTOC; // starting DRAM address of file TOC buffer
DWORD dwJPGStatus; // starting DRAM address of JPG status buffer
} DRAM_LOC, * PDRAM_LOC;
// [4] Directory name information structure -- LLY2.80
typedef struct tagDIRNAMEINFO
{
char cName[FM_MAX_DIRNAME_LENGTH+1]; // store directory name
BYTE bDirExtAttr; // keep if contains JPEG file
} DIRNAMEINFO, * PDIRNAMEINFO;
// [5] Directory location structure -- LLY2.80
typedef struct tagDIR_LOC
{
BYTE bSector[3]; // keep location (3 BYTE unit)
} DIR_LOC, * PDIR_LOC;
// Max length of DIR_LOC structure
#define DIR_LOC_LENGTH 3
// [6] Cursor information structure -- LLY2.80
typedef struct tagCURSOR_INFO
{
BYTE bPosition; // column position of cursor
WORD wIndex; // absolute index of current column
} CURSOR_INFO, * PCURSOR_INFO;
// The value of "bPosition" element
#define POS_DIR_LIST 0 // cursor on "left column"
#define POS_FILE_LIST 1 // cursor on "right column"
#define POS_BUTTON_LIST 2 // cursor on "bottom area"
#define POS_PROG_LIST 3 // cursor on "program list"
#define POS_UNEXIST 4 // don't exist this cursor
// [7] Control Button Area structure -- LLY2.80
typedef struct tagCTL_BUTTON
{
BYTE bButtonID; // keep control button ID
BYTE bStatus; // disable/ enable status of the control button
} CTL_BUTTON, * PCTL_BUTTON;
// The value of "bButton" element
#define CTL_BTN_NEXT 1 // "Next" button
#define CTL_BTN_PREV 2 // "Previous" button
#define CTL_BTN_PROG 3 // "Program" button
#define CTL_BTN_THUMB 4 // "Thumbnail" button
#define CTL_BTN_RETURN 5 // "Return" button
#define CTL_BTN_PROG_LIST 6 // "Program List" button
#define CTL_BTN_CLEAR_ALL 7 // "Clear All" button
#define CTL_BTN_PLAY 8 // Start the playing action
#define CTL_BTN_END 9 // The end of control button
// The value of "bStatus" element
#define BTN_DISABLE 0x0 // button is disabled
#define BTN_ENABLE 0x1 // button is enabled
// [9] The structures of TREE record.
typedef struct tagTREE_INFO
{
BYTE bParentID; // parent ID
BYTE b1stSubDirID; // 1st sub-directory ID
BYTE bNoOfSubDir; // total number of sub-directory
} TREE_INFO, * PTREE_INFO;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -