📄 fmanager.c
字号:
// [8-4 Record the type of moving cursor across boundary.
BYTE __bFMAcrossDirType;
// [9] Keep the TOC of each file
// index 0~n store the starting sector for each file
// [G-3bytes]
//PENTRY_RANGE _pFMFileTOC;
// [10] Store the file number of each directory
//DVD_051Micky, reduce MP3 SRAM(sharing _pFMDirLoc)
// [G-3bytes]
//static WORD *_wFMFilesOfDir;
WORD *__pwFMFilesOfDir;
// [11] Total directories/ files within the playable CDROM
// [G-4bytes]
//WORD __wFMTotalDirs;
BYTE __bFMTotalDirs;
WORD __wFMTotalFiles;
// [12] For MP3 hang feature usage
// [G-8bytes]
// LLY2.80, It's seem un-necessary to give the initial value
// And, only need to initial it while starting to play a new item
DWORD dwPreTime; //=0;
DWORD dwPreRemain; //=0;
//Kevin1.22, WMA sample count
#ifdef SUPPORT_WMA
DWORD dwSample;
DWORD dwPreSample;
#endif //
// [13] Temp variables
// LLY2.80, re-adjust the temp variables
// [G-8bytes]
DWORD _dwFMTemp; //Kevin1.08
WORD _wFMTemp;
WORD _wFMTemp1;
BYTE _bFMTemp;
BYTE _bFMTemp1;
BYTE _bFMTemp2;
BYTE _bFMTemp3;
BYTE _bFMIdx;
//WORD *_pwFMPtr;
// [14] Keep JPG status, ex rotate/ flip/ playable -- LLY.274p-2
// [G-7bytes]
BYTE __bFMPlayable;
BYTE __bFMJPGStatus;
// [15] Keep trigger mechanism stage
// [G-1bytes]
BYTE __bFMStage;
// wyc1.24, some variable for JPG re-boot recover.
BYTE __bFMJPGNext;
DWORD __dwFMJPGNextGap;
BYTE __bShowFMWaitMessage;
extern WORD __wFMJPGPlayCount;
extern BYTE __bDoActionInStage;
// [16] Keep JPEG active frame -- LLY.274p-2
// [within 256 BYTE interanl data space]
BIT __btActiveFrame;
// [17] Keep the time while JPEG display ok
// [G-4bytes]
DWORD __dwTimeJPEGDisplay;
// [18] Keep JPEG decoding mode : 1st decode or re-decode -- LLY.276
// [G-1byte]
//BYTE __bDecodeMode; //--CoCo1.21, remove it because FM doesn't need to judge the JPEG decoding mode in CT908
// [19] Keep selection/ active cursor information -- LLY2.80
// [G-6bytes]
// LLY2.81, Support selection & active cursor together if enable this define.
// Otherwise, let selection same as active cursor
CURSOR_INFO __FMActiveCursor;
CURSOR_INFO __FMSelectCursor;
// wyc1.10, new variables to record the next position of select cursor when moving UP / DOWN / NEXT / PREV and across directories.
WORD __wNewCursorIndex;
// [20] Keep directory tree information -- LLY2.81
// [G-3bytes]
PTREE_INFO __pFMDirTree;
// [21] Keep the parent's ID of current active directory -- LLY0.83b-2
// [G-1bytes]
BYTE __bFMParentID;
// [22] Keep the info. while exist "UP_DIR" or not -- LLY0.83b-2
// [G-1byte]
BYTE __bFMExistUpDir;
// [23] Keep control button information -- LLY0.83b-2
// [G-6bytes]
#ifdef SUPPORT_FM_BUTTONS //CoCo1.21, for 4M flash
CTL_BUTTON __FMCtlBTNList[MAX_CTL_BTN_NO];
#endif //SUPPORT_FM_BUTTONS
// [24] Keep program item content, ex filename, only for CT908 UI reference -- LLY0.83b
// [G-3bytes]
PFILENAMEINFO __pProgContent;
// wyc0.87, a pointer for allocate memory from __bPool for dir files attribute.
BYTE * __pbDirExtAttr;
// [25] Keep JPEG decoding effect factor index -- LLY0.84
// Notice: it's different from __bJPEGEffect
// __bJPEGEffect: keep real desired JPEG decoding effect mode
// __bFMEffectIdx: keep index for accessing JPEG effect array
// Initial this value as zero within FM_Initial()
// So, the JPEG decoding effect always reset to zero while open/ close
// [G-1byte]
BYTE __bFMEffectIdx;
// wyc0.90
// [26] Record the current playing files, or the desired playing files. Another record the status of can last picture do effect ?
BYTE __wFMPlayItem;
BYTE __bFMLastPicEffect;
// wyc1.00, used for supporting parsing more files in one directory.
BYTE __bDirParseIdx, __bDumpPage;
BYTE __bFMJPGShowTime;
//WORD __wFMDirCursorSaved; //--CoCo1.21, __wFMDirCursorSaved is not used in the program
// wyc1.10, remove the define because CoCo don't cover this variable in define in OSDFM.C. It will cause compiler error when not define SUPPORT_FM_UI_ON_OFF.
BYTE __bFMHide;
// wyc1.25, add pointer to use FILE_RECORD in SRAM
PFILE_RECORD __pFMFileRecord;
PFILE_RECORD __pFMTOCRecord;
#endif // #ifndef NO_MP3
///////////////////////////////////////////////////////////
// ****** Extern Other Module's Variable Area ******
extern BIT __btInputProgram;
extern DWORD __dwPreGetTime; // VCD_071
// DVD_161Micky, support MP3 resume can play from track begin
extern DWORD __dwResumeTime;
extern BYTE __bResetRecover; // LLY.275a
#if defined(SUPPORT_JPEG_C3) || defined(SUPPORT_MP3_C3)
extern BYTE __bC3Retry;
#endif ///
///////////////////////////////////////////////////////////
#ifdef SUPPORT_FM_BUTTONS //CoCo1.21, for 4M flash
/////////////////////////////////////////////////////////////
// ***** Constant Code Define Area *****
// [1] Define control button list info.
// Notice: must add "CTL_BTN_END" at last item if total number < 6
BYTE code aNormal_CtlBTNList[MAX_CTL_BTN_NO]= // Control button list for normal mode
{
CTL_BTN_PREV, CTL_BTN_NEXT, CTL_BTN_PLAY,
#ifdef SUPPORT_FM_PROGRAM
CTL_BTN_PROG,
#endif
CTL_BTN_THUMB, CTL_BTN_END
};
BYTE code aProg_CtlBTNList[MAX_CTL_BTN_NO]= // Control button list for program mode
{
CTL_BTN_PREV, CTL_BTN_NEXT, CTL_BTN_PLAY,
CTL_BTN_RETURN,
#ifdef SUPPORT_FM_PROGRAM_LIST
CTL_BTN_PROG_LIST,
CTL_BTN_THUMB
#else
CTL_BTN_THUMB,
CTL_BTN_END
#endif
};
BYTE code aProgList_CtlBTNList[MAX_CTL_BTN_NO]= // Control button list for program list mode
{
CTL_BTN_PREV, CTL_BTN_NEXT, CTL_BTN_PLAY,
CTL_BTN_CLEAR_ALL, CTL_BTN_RETURN, CTL_BTN_END
};
#endif //SUPPORT_FM_BUTTONS
// [2] Define desired JPEG decoding effect list array -- LLY0.84
// Notice: user can arrange his favorite tiggle sequence and max number
#define MAX_JPEG_EFFECT_NO 12//13
BYTE code aJPEGEffect_List[MAX_JPEG_EFFECT_NO]=
{
HAL_JPEG_EFFECT_NO_EFFECT,
HAL_JPEG_EFFECT_COVER_UP,
HAL_JPEG_EFFECT_COVER_DOWN,
HAL_JPEG_EFFECT_UNCOVER_UP,
HAL_JPEG_EFFECT_UNCOVER_DOWN,
HAL_JPEG_EFFECT_SPLIT_HORIZONTAL_IN,
HAL_JPEG_EFFECT_SPLIT_HORIZONTAL_OUT,
HAL_JPEG_EFFECT_WIPE_UP,
HAL_JPEG_EFFECT_WIPE_DOWN,
HAL_JPEG_EFFECT_BLINDS_HORIZONTAL_UP,
HAL_JPEG_EFFECT_BLINDS_HORIZONTAL_DOWN,
HAL_JPEG_EFFECT_FADE_THROUGH_BLACK,
//HAL_JPEG_EFFECT_AUTO_PAN,
};
// *********************************************************************
// Function : FM_Trigger
// Description : Check PlayEnd if player is playing...
// Arguments : NONE
// Return : TRUE, the stage finish ok
// FALSE, the stage fail
// Side Effect :
// *********************************************************************
// LLY.274p-2, re-adjust the procedure to handle all playable CDROM title playing
// [1] MP3 bitstream
// . Error Concealment
// . Playing End checking
// [2] JPG bitstream
// . Pre-decoding stage
// . Decoding stage
// . Polling INT_IFSC stage
// . Display stage
// . Hang issue
//BYTE FM_Trigger(void)
void FM_Trigger(void) //CoCo1.21, modify the function prototype.
{
static DWORD dwTimeStamp;
// LLY.281, nothing need to do while
// [1] non-CDROM title, or
// [2] F/W is non-playing, or
// [3] non-Thumbnail mode
// wyc0.87, in pause mode we still need to make it enter FM_Trigger to display picture
// wyc0.87, modicy code to fix MP3 / JPG playing -> stop will auto issuing KEY_NEXT problem.
if (__bThumbnailMode)
//return ERR_ERROR;
return; //CoCo1.21
// wyc1.24, when issue JPG reset stage 1, then need to issue KEY_NEXT to force it continue to play.
if (((__bFMJPGNext>=1) && (__bFMJPGNext<=3)) && (__bAttrPlay == ATTR_JPG))
{
if ((UTL_GetSysTimer() - __dwFMJPGNextGap) > (COUNT_2_SEC*__bFMJPGNext))
{
// LLY2.37p, it's un-necessary to assign __bKeySource,
// Because, CC module will handle it while processing input key
//__bKeySource = KEY_FROM_ISR;
__bFMStage = STAGE_NEXT_ITEM;
__bFMJPGNext++;
__dwFMJPGNextGap = UTL_GetSysTimer();
}
}
/* --CoCo1.21
if( !(__wDiscType & CDROM_M1) || (!__btPlaying) || (__btPause) || __bThumbnailMode )
{
if ((!__bThumbnailMode) && (__btPause) && (__bAttrPlay == ATTR_JPG))
;
else
//return ERR_ERROR;
return;
}
*/
//CoCo1.21, replace the above code
if( !(__wDiscType & CDROM_M1) || (!__btPlaying) || __btPause)
{
if (__btPause && (__bAttrPlay == ATTR_JPG))
;
else
//return ERR_ERROR;
return;
}
//CoCo1.10, flash the icon of the playing file.
if ((__bFMMenuID != FM_MENU_NONE)
#ifdef SUPPORT_SIMPLE_FM_PROGRAM
&& (!__btInputProgram)
#endif //SUPPORT_SIMPLE_FM_PROGRAM
)
OSDFM_Update(OSDFM_MSG_FLASH_PLAYING_FILE);
// Enter stage loop
switch(__bFMStage)
{
// LLY.275a, prepare some info for FMANAGER module usage
case STAGE_PREPAREINFO:
#ifdef JPG_DEBUG_INFO
_printf("\n Parse header"); //CoCo1.22a, for JPEG debug
_FM_DebugInfo(); //CoCo1.22a, for JPEG debug
#endif //JPG_DEBUG_INFO
__bFMStage=STAGE_DECODE;
// LLY.276p-4, keep the time for parseing header time-out checking
__dwPreGetTime=UTL_GetSysTimer();
// LLY2.80, give the initial value while start to play a new item
// only use for JPG/ MP3 hang checking
dwPreTime=0xFFFFFFFF; // last time for checking audio remainder
// LLY0.85-2, give the initial value as large value
// last audio remainder for MP3 track
// RISC/ DSP decoding status for JPEG track
dwPreRemain=0xFFFFFFFF;
#ifdef SUPPORT_WMA //Kevin1.22, add
dwSample = 0xFFFFFFFF;
dwPreSample = 0xFFFFFFFF;
#endif //
if(__bAttrPlay==ATTR_JPG)
{
// LLY0.83b-2, specify display width/ height for RISC on CT908 mode
// Because, there are different setting between CT908 slide show & pre-view mode
// So, it can't set within UTL_SetPlayItemConfigure()
// wyc1.22, use define for user can change it more easily.
//CoCo2.37, Tune the display region for different JPEG buffer cases.
if (__bDVDROM)
{
__wHStart = (HAL_DISPLAY_DVD_JPEG_WIDTH - FM_DVD_JPEG_FRAME_WIDTH) >> 1;
__wVStart = (HAL_DISPLAY_DVD_JPEG_HEIGHT - FM_DVD_JPEG_FRAME_HEIGHT) >> 1;
__wWidth = FM_DVD_JPEG_FRAME_WIDTH;
__wHeight = FM_DVD_JPEG_FRAME_HEIGHT;
}
else
{
__wHStart = (HAL_DISPLAY_CD_JPEG_WIDTH - FM_CD_JPEG_FRAME_WIDTH) >> 1;
__wVStart = (HAL_DISPLAY_CD_JPEG_HEIGHT - FM_CD_JPEG_FRAME_HEIGHT) >> 1;
__wWidth = FM_CD_JPEG_FRAME_WIDTH;
__wHeight = FM_CD_JPEG_FRAME_HEIGHT;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -