- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
UiVideoFileList.c
资源名称:SDK_M5661.rar [点击查看]
上传用户:hjhsjcl
上传日期:2020-09-25
资源大小:11378k
文件大小:18k
源码类别:
压缩解压
开发平台:
C++ Builder
- /*==========================================================================
- Copyright (c) 2004 ALi Corporation. All Rights Reserved
- File: UiVideo.c
- content: user interface for play module
- History: Created by Walace 2005/11/16
- ==========================================================================*/
- #define _UI_VIDEO_FILE_H_ //Walace060926#1 VideoResume
- #include <DP8051XP.H>
- #include "TypeDef.h"
- #include "Const.h"
- #include "Reg5661.h"
- #include "Common.h"
- #include "Key.h"
- #include "SaveSetting.h"
- #include "NandFlash.h"
- #include "Idma.h"
- #include "FileSystem.h"
- #include "UiCommon.h"
- #include "OLED.h"
- #include "IconDefine.h"
- #include "SysStrDef.h"
- #include "UiSysStr.h"
- #include "OledString.h"
- #include "UiPlayCommon.h"
- #include "UiVideoCommon.h"
- #include "UiVideoFileList.h"
- #include "Video.h" //Walace060926#1 VideoResume
- #if(UI_USE_CLASS_LIST)
- #include "ClassDataBase.h"
- #endif
- #include "VideoDsp.h" //Walace070329#1
- #define gxbUiVideoMainState gxbUiMenuMainStates
- #define gxbUiVideoSubState gxbUiMenuSubStates
- #define UI_VIDEO_DEL_MENU UI_DEL_YES_NO_MENU //Walace060806#2
- #define UI_VIDEO_FILE_LIST UI_FILE_LIST_MENU
- void UiVideoFileListInit(void);
- void UiVideoFileBrowseCtrl(BYTE bKey);
- BOOL UiSelectFileOrFolder(void);
- //void UiDispDelYesNoMenu(void) large;
- void UiDelMenuCtrl(BYTE bKey) large;
- //Walace060926#1 VideoResume start
- BOOL VideoFileInit(void);
- void VideoCheckResumeRequire(void);
- void VideoGotoResumeFile(void);
- void VideoReadSettingValue(void);
- void SwicthToSaveSetting(void) large;
- void VideoSaveLastPlayInfo(void);
- //Walace060926#1 VideoResume end
- main(void)
- {
- BYTE bKey;
- #if(ICE_REAL_MODE) //vicky061001#2 Debug Play
- EnableTimer0();
- IE=0x83;
- #endif
- UiVideoFileListInit();
- bKey = KEY_INVALID;
- while(TRUE)
- {
- UiNormalCheck();
- KeyGet(bKey);
- UiCheckBackLight(bKey);
- UiVideoNormalCheck();
- switch(gxbUiVideoMainState)
- {
- case UI_VIDEO_FILE_LIST:
- UiVideoFileBrowseCtrl(bKey);
- break;
- case UI_VIDEO_DEL_MENU:
- UiDelMenuCtrl(bKey);
- break;
- }
- //Nick061120 start //NandRestore start //Walace061218#1
- #if(NAND_ECC_DEBUG) //vicky070105#3
- if((gxwTimeToScanPM > SCAN_PM_DURATION)&&gfMLCMode)
- #else
- if(gxbRestoreBlkNum || (gxwTimeToScanPM > SCAN_PM_DURATION)&&gfMLCMode)
- #endif
- {
- gxbModuleState=MODULE_VIDEO_FLIST;
- //Nick061204 start
- if(gxwTimeToScanPM > SCAN_PM_DURATION)
- gxbRestoreCMD |= PM_SCAN;
- else
- gxbRestoreCMD = FullStep;
- //Nick061204 end
- LoadProgram(PM_PLAY_DATA_RTN_RESTORE, BASIC_CODE_ONLY);
- }
- //Nick061120 end //NandRestore end //Walace061218#1
- }
- } // main(1)
- #if(1) //Walace060926#1 VideoResume start
- void UiVideoFileListInit(void)
- {
- #if(SETTING_FOR_ICE_START)
- UiVideoICEInit();
- #endif
- VideoCommonInitial();
- //NandRestore start //Walace061218#1
- if((gxbModuleState&MODULE_SUB)==MODULE_NAND_RTN_RESOTRE) //Nick061120
- {
- gxbModuleState=MODULE_OTHERS;
- return;
- }
- //NandRestore end //Walace061218#1
- switch(gxbModuleState)
- {
- case MODULE_FILE_DEL:
- gfDelFile = TRUE;
- gxbModuleState=MODULE_OTHERS;
- SET_VD_MODULE_FLOW(VIDEO_TO_FLIST_INIT);
- break;
- case MODULE_INITIAL:
- gfDspCtrlCdc=FALSE;
- gfCdcAlreadyInit=FALSE;
- gxbModuleState=MODULE_OTHERS;
- SET_VD_MODULE_FLOW(VIDEO_TO_FLIST_INIT);
- break;
- }
- switch(GET_VD_MODULE_FROM())
- {
- case VIDEO_FROM_PLAY:
- VideoSaveLastPlayInfo();
- break;
- case VIDEO_FROM_MENU:
- case VIDEO_FROM_FLIST:
- case VIDEO_FROM_FLIST_INIT:
- case VIDEO_FROM_SAVE:
- default:
- break;
- }
- switch(GET_VD_MODULE_TO())
- {
- case VIDEO_TO_FLIST_INIT:
- //vicky070103#3
- #if(USE_ERR_MSG_DISPLAY)
- if(!gbFsUnableUse)
- #endif
- {
- UiShowWaitMsg(UI_SHOW_WAIT_START);
- }
- VideoReadSettingValue();
- if(!VideoFileInit())
- {
- //vicky070103#3
- if(gbFsUnableUse)
- {
- gxbSettingBuffer[SETTING_NEXT_MODE]=SAVE_AND_SEL_MODE;
- gxbSettingBuffer[SETTING_DISPLAY_SWAPING]=TRUE;
- gxbLastErrCode=ERR_NO_ERROR;
- }
- //End
- SwicthToSaveSetting();
- }
- UiRndPlayInit();
- UiShowWaitMsg(UI_SHOW_WAIT_TIME_OUT);
- break;
- case VIDEO_TO_MENU:
- UiVideoSwitchModule(VIDEO_TO_MENU);
- break;
- case VIDEO_TO_SAVE:
- SwicthToSaveSetting();
- break;
- }
- // WHH #8 301_061226(start)
- UiShowLargeBackground(5,IM_BROWSER_BG_S1); //tne 2007/01/10 #2
- // WHH #8 301_061226(end)
- UiGoFileList();
- gxbUiVideoMainState = UI_VIDEO_FILE_LIST;
- }
- #else
- void UiVideoFileListInit(void)
- {
- #if(SETTING_FOR_ICE_START)
- UiVideoICEInit();
- #endif
- VideoCommonInitial();
- switch(gxbModuleState)
- {
- case MODULE_FROM_PLAYBACK:
- break;
- case MODULE_FROM_PLAYDEL:
- VideoFileInit();
- gfDelFile = TRUE; //It would be better that gfDelFile was be maintained by PlayDel target
- break;
- case MODULE_FROM_PLAY_MENU:
- break;
- }
- UiGoFileList();
- gxbUiVideoMainState = UI_VIDEO_FILE_LIST;
- }
- #endif
- //Walace060926#1 VideoResume end
- //Walace060926#1 VideoResume start
- //#define RESUME_TIME_COL SEG7
- //#define RESUME_TIME_ROW PAGE3
- #define RESUME_TIME_COL 70
- #define RESUME_TIME_ROW 98
- void UiConfirmResumeMenu(void)
- {
- BYTE bKey;
- WORD wTemp;
- // WHH 070109
- /*OLED_CLEAR_ALL();
- OledShowIcon(ICON_SEARCH_TO,SEG1,PAGE1);
- OledShowIcon(ICON_COLON,RESUME_TIME_COL+16,RESUME_TIME_ROW+4) ; //Icon Slash */
- OledShowIconNew(2,IM_BG_CLEAR_TO_BLACK,0,0);
- //OledShowIcon(ICON_SEARCH_TO,SEG1,PAGE1);
- OledShowIconNew(1,IM_MOVIE_ICON_PLAYBACK,RESUME_TIME_COL,RESUME_TIME_ROW);
- //OledShowIcon(ICON_COLON,RESUME_TIME_COL+8,RESUME_TIME_ROW+24) ;
- OledShowIconNew(1,IM_MOVIE_RESUME_COLON,RESUME_TIME_COL+16,RESUME_TIME_ROW+36);
- bKey = KEY_RIGHT_BREAK;
- gfFirstResume=FALSE;
- while(TRUE)
- {
- switch(bKey)
- {
- case KEY_RIGHT_BREAK:
- case KEY_LEFT_BREAK:
- gfFirstResume=!gfFirstResume;
- if(gfFirstResume)
- wTemp=gxwVideoLastPlayTime;
- else
- wTemp=0;
- OledShowBigNumber(wTemp/60,RESUME_TIME_COL,RESUME_TIME_ROW+36,2);
- OledShowBigNumber(wTemp%60,RESUME_TIME_COL+24,RESUME_TIME_ROW+36,2);
- //OledShowIcon(ICON_COLON,RESUME_TIME_COL+16,RESUME_TIME_ROW+4) ; //Icon Slash
- break;
- case KEY_UP_BREAK:
- //WHH 070109
- //OLED_CLEAR_ALL();
- OledShowIconNew(2,IM_BG_CLEAR_TO_BLACK,0,0);
- return;
- }
- bKey = KEY_INVALID;
- UiNormalCheck();
- KeyGet(bKey);
- UiCheckBackLight(bKey);
- UiVideoNormalCheck();
- }
- }
- #undef RESUME_TIME_COL
- #undef RESUME_TIME_ROW
- //Walace060926#1 VideoResume end
- void UiVideoFileBrowseCtrl(BYTE bKey)
- {
- if(gfScrollFlag) //Walace060213#3
- {
- if( (gxbLcdCounter>=UI_SCROLL_DELAY_TIME)&&(gxwFileNumInFileList!=0) )
- {
- //WHH #8 301_061226
- //LcdScrollFileList(&stUiFileListData,gxbUiMenuSubStates<<1,TRUE);
- LcdScrollFileList(&stUiFileListData,gxbUiMenuSubStates,TRUE);
- gxbLcdCounter=0;
- }
- }
- switch(bKey)
- {
- case KEY_LEFT_BREAK:
- case KEY_LEFT_LONG: // Jeff070125#5
- UiShowFileList(UI_FILE_LIST_UP);
- break;
- case KEY_RIGHT_BREAK:
- case KEY_RIGHT_LONG: // Jeff070125#5
- UiShowFileList(UI_FILE_LIST_DOWN);
- break;
- case KEY_UP_BREAK:
- if(UiSelectFileOrFolder())
- {
- //Walace060926#1 VideoResume start
- VideoCheckResumeRequire();
- if(gfFirstResume)
- {
- UiConfirmResumeMenu();
- }
- UiVideoSwitchModule(VIDEO_TO_PLAY);
- //Walace060926#1 VideoResume end
- }
- break;
- #if(UI_VIDEO_USE_MENU)
- //case KEY_FUNC_BREAK:
- case KEY_FUNC_LONG_BREAK: //Walace060803#5
- UiVideoSwitchModule(VIDEO_TO_MENU); //Walace060926#1 VideoResume
- break;
- #endif
- case KEY_FUNC_BREAK: //Walace060803#5 start
- if(stUiFileListData.bPathDepth==0)
- {
- gxbSettingBuffer[SETTING_NEXT_MODE]=SAVE_AND_SEL_MODE;
- UiVideoSwitchModule(VIDEO_TO_SAVE);
- }//Walace060926#1 VideoResume
- else
- {
- //gxbPhotoProcState = PHO_ENG_STOP;
- gxwFileNumInFileList=0;
- UiSelectFileOrFolder();
- }
- break; //Walace060803#5 end
- //tne 2005/12/17
- #if(!FIVEKEY)
- case KEY_REC_BREAK:
- #else
- case KEY_VOL_BREAK:
- #endif
- if(gxwFileNumInFileList>0)
- {
- UiDrawSubMenu(SYS_STR_TOOLS_DEL);
- gxbUiVideoMainState=UI_VIDEO_DEL_MENU;
- gxbUiMenuSubStates=FALSE;
- UiDispYesNoMenu();
- }
- break;
- //case KEY_MODE_BREAK:
- case KEY_FUNC_LONG: // WHH 070110 NEW UI KEY
- gxbSettingBuffer[SETTING_NEXT_MODE]=SAVE_AND_SEL_MODE;
- UiVideoSwitchModule(VIDEO_TO_SAVE); //Walace060926#1 VideoResume start
- break;
- default:
- break;
- }
- }
- #if(UI_USE_ALARM_DISPLAY)
- //tne 2007/01/15 #1 move to UiCommon.c
- //void UiShowWakeUp() large
- #endif
- BOOL UiSelectFileOrFolder(void)
- {
- if(gxwFileNumInFileList<=gxwTotalDirInDir)
- {
- gpstFileIndex=&stUiFileListData;
- if(gxwFileNumInFileList==0)
- {
- //tne 2005/12/29 #4
- if(stUiFileListData.bPathDepth>0)
- {
- FsChangeDir(RESTORE_DIR);
- gxwFileNumInFileList=UiGetBackDirNum();
- }
- }
- else
- {
- FsChangeDir(ENTER_DIR);
- gxwFileNumInFileList=0;
- }
- UiGetFileListNum();
- UiGoFileList();
- return FALSE;
- }
- else
- {
- gxbFileNumSearchMode=FNUM_SEARCH_RESET_MODE;
- UiCountCurtFileNum(&stPhoFileInf,&stUiFileListData);
- return TRUE;
- }
- }
- //tne 2005/12/17
- /* tne 2007/01/14 #1
- void UiDispDelYesNoMenu(void) large
- {
- UiShowSubMenuNum(gxbUiMenuSubStates+1,2);
- UI_CLEAR_MENU_TAG_AREA();
- StrShowSysString(cwStringSysYesNoList[gxbUiMenuSubStates],LCD_AUTO_CENTER_COL,OLED_TAG_ROW);
- }
- */
- //tne 2005/12/17
- void UiDelMenuCtrl(BYTE bKey) large
- {
- switch(bKey)
- {
- case KEY_LEFT_BREAK:
- case KEY_RIGHT_BREAK:
- gxbUiMenuSubStates ^= 0x01;
- UiDispYesNoMenu();
- break;
- case KEY_UP_BREAK:
- if(gxbUiMenuSubStates==TRUE) //del file
- {
- //OLED_CLEAR_ALL(); //Walace060806#2
- //StrShowSysString(SYS_STR_HOST_WORKING_DEL,LCD_AUTO_CENTER_COL,PAGE3);
- SetSysSpeed(0x02);
- gxbModuleState=MODULE_VIDEO_FLIST; //Walace060926#1 VideoResume
- if(gxwFileNumInFileList>gxwTotalDirInDir) //select a file //tne dir del
- {
- LoadProgram(PM_PLAY_DEL,NORMAL_CODE);
- //gxbSettingBuffer[SETTING_NEXT_MODE]=SAVE_AND_FILE_DEL; //Tne05122#Video
- }
- else
- {
- LoadProgram(PM_DIR_DEL,NORMAL_CODE);
- //gxbSettingBuffer[SETTING_NEXT_MODE]=SAVE_AND_DIR_DEL;//Tne05122#Video
- }
- /*
- gxbSettingBuffer[SETTING_DISPLAY_SWAPING]=FALSE;
- gxbLastErrCode=ERR_NO_ERROR;
- SaveSetting();
- */
- }
- case KEY_FUNC_BREAK:
- UiGoFileList();
- gxbUiMenuMainStates = UI_FILE_LIST_MENU;
- break;
- }
- }
- //Walace060926#1 VideoResume start
- void FsStructInit(struct FILE_INF_DATA xdata* pFsStruct )
- {
- pFsStruct->pbFileName=gxbFileName;
- pFsStruct->pbLongFileName=gxbLongFileName;
- pFsStruct->bPathDepth=0;
- pFsStruct->dwDirStartSec=gxdwRoot;
- pFsStruct->dwDirSec[0]=gxdwRoot;
- pFsStruct->wDirOffset[0]=0;
- }
- void VideoCheckResumeRequire(void)
- {
- BYTE bI;
- gfFirstResume=FALSE;
- if(gxwVideoLastPlayTime==0)
- return;
- stPhoFileInf=stUiFileListData;
- gpstFileIndex = &stUiFileListData;
- if(gpstFileIndex->bPathDepth!=gxbLastFileDepth)
- goto COMPARE_END;
- for(bI=0;bI<11;bI++)
- {
- if(gxbLastFileName[bI]!=gpstFileIndex->pbFileName[bI])
- goto COMPARE_END;
- }
- while(gpstFileIndex->bPathDepth>0)
- {
- FsChangeDir(RESTORE_DIR);
- FsOpenFile(RELOAD_DIR_NAME); //stUiFileListData
- for(bI=0;bI<11;bI++)
- {
- if(gxbLastFilePath[(gpstFileIndex->bPathDepth)*11+bI]!=gpstFileIndex->pbFileName[bI])
- {
- goto COMPARE_END;
- }
- }
- }
- gfFirstResume=TRUE;
- COMPARE_END:
- stUiFileListData=stPhoFileInf;
- FsOpenFile(RELOAD_FILE_NAME);
- return;
- }
- void VideoGotoResumeFile(void)
- {
- BYTE bI,bDepth;
- gpstFileIndex=&stUiFileListData;
- for(bDepth=1;bDepth<=gxbLastFileDepth;bDepth++)
- {
- if(UiSearchFile(ALL_DIR_IN_DIR,(PBYTE)(gxbLastFilePath+(bDepth-1)*11)))
- {
- FsChangeDir(ENTER_DIR);
- }
- else
- {
- goto FIRST_VIDEO_FILE;
- }
- }
- //search last play file
- gpstFileIndex=&stPhoFileInf;
- FsOpenFile(FIRST_PLAYBACK);
- gxwCurtFileInAll=1;
- gxwCurtFileInDir=0;
- while(1)
- {
- //check the same dir
- if(stPhoFileInf.dwDirStartSec==stUiFileListData.dwDirStartSec)
- {
- gxwCurtFileInDir++;
- for(bI=0;bI<11;bI++)
- {
- if(gxbLastFileName[bI]!=gxbFileName[bI])
- break;
- }
- if(bI==11) //find the same file
- {
- //gfFirstResume=TRUE; //tne 2005/08/19
- break;
- }
- }
- if(gxwCurtFileInAll>=gxwTotalFileInAll) //not found the same file
- {
- stPhoFileInf=stUiFileListData;
- goto FIRST_VIDEO_FILE;
- }
- FsOpenFile(NEXT_PLAYBACK);
- gxwCurtFileInAll++;
- }
- return;
- FIRST_VIDEO_FILE:
- gpstFileIndex=&stPhoFileInf;
- FsOpenFile(FIRST_PLAYBACK);
- gxwCurtFileInAll=1;
- gxwCurtFileInDir=1;
- return;
- }
- BOOL VideoFileInit(void)
- {
- if(gbFsUnableUse)
- {
- OLED_CLEAR_ALL();
- gxbLastErrCode=ERR_INIT_FS_ERR;
- #if(USE_ERR_MSG_DISPLAY)
- UiCheckIniErr();
- #endif
- return FALSE;
- }
- FsStructInit(&stUiFileListData);
- FsStructInit(&stPhoFileInf);
- gxbFileMode = VIDEO_FILE;
- gxbLongFileName[0]=STRING_TYPE_UNICODE;
- gfDelFile = FALSE;
- gdwFileSector=0;
- gfFirstResume=FALSE;
- #if(DRM_MODE_EN)
- UiSearchMtpPropFile();
- #else
- gxbExceptFileAttrib=(FILE_ATTR_LABEL|FILE_ATTR_SYSTEM|FILE_ATTR_HIDDEN);
- #endif
- //4 ==== Get "gxwTotalFileInAll" ====
- gxwTotalFileInAll=UiCountFileInDir(COUNT_ALL_PLAYBACK);
- FsStructInit(&stUiFileListData);
- //4 ==== Get "gxwCurtFileInAll , gxwCurtFileInDir , gxwTotalDirInDir, gxwTotalFileInDir " ===
- if(gxwTotalFileInAll==0)
- {
- gxwCurtFileInAll=0;
- gxwCurtFileInDir=0;
- gxwTotalDirInDir=UiCountFileInDir(COUNT_DIR_IN_DIR);
- gxwTotalFileInDir=0;
- }
- else
- {
- VideoGotoResumeFile();
- stUiFileListData=stPhoFileInf; //all point to playback file
- UiGetFileListNum();
- FsOpenFile(RELOAD_FILE_NAME);
- }
- //4 ==== Get "gxwNumTotalFiles" , "gxwCurrentFileNum","gxwFileNumInFileList" ====
- if(gfPlayAutoSearchFile)
- {
- gxwNumTotalFiles=gxwTotalFileInAll;
- gxwCurrentFileNum=gxwCurtFileInAll;
- }
- else
- {
- gxwNumTotalFiles=gxwTotalFileInDir;
- gxwCurrentFileNum=gxwCurtFileInDir;
- }
- gxwFileNumInFileList=gxwCurtFileInDir+gxwTotalDirInDir;
- return TRUE;
- }
- //Walace051218
- void VideoReadSettingValue(void)
- {
- BYTE bI;
- PBYTE pbFsData;
- NandPrivateEn();
- ReadSettingData(FS_DATA_0_0);
- pbFsData = (gxbFsData+gxwOffsetDataSec);
- gxbRepeatMode=*(pbFsData+SRAM_VIDEO_REPEAT_MODE);
- gfPlayAutoSearchFile = ((gxbRepeatMode & REPEAT_SETTING_DIR_FLAG_J)>>7);
- gxbRepeatMode&=REPEAT_SETTING_MODE;
- gxbVolume=*(pbFsData+SRAM_VOLUME);
- gxbLastFileDepth=*(pbFsData+SRAM_VIDEO_PATH_DEPTH);
- for(bI=0;bI<(gxbLastFileDepth*11);bI++)
- gxbLastFilePath[bI]=*(pbFsData+SRAM_VIDEO_PATH_START+bI);
- for(;bI<(MAX_PATH_DEPTH-1)*11;bI++)
- gxbLastFilePath[bI]=0;
- for(bI=0;bI<11;bI++)
- gxbLastFileName[bI]=*(pbFsData+SRAM_LAST_VIDEO_FILE+bI);
- gxdwLastPlayFileSector=*((PDWORD)(pbFsData+SRAM_VIDEO_LAST_FILESECTOR));
- gxwVideoLastPlayTime=*((PWORD)(pbFsData+SRAM_VIDEO_LAST_PLAY_TIME));
- NandPrivateDis();
- }
- void SwicthToSaveSetting(void) large
- {
- MCU_ACCESS_CODEC_I2S_EN(); //Renshuo050216#A
- obALGPAREG |= 0x04; //power down PDY
- obALGPAREG |= 0x01; //power down PD
- obALGPAREG |= 0x02; //power down PDX
- MCU_ACCESS_CODEC_I2S_DIS(); //Renshuo050216#A
- gfCdcAlreadyInit = FALSE;
- gxbTargetVolume = FADEOUT_VOL;
- gxbLastVolume = FADEOUT_VOL;
- //gxbSettingBuffer[SETTING_DISPLAY_SWAPING]=TRUE;
- //gxbSettingBuffer[SETTING_NEXT_MODE]=SAVE_AND_SEL_MODE;
- gxbLastErrCode=ERR_NO_ERROR;
- SaveSetting();
- }
- /*
- #define AVI_H_SUPPORT_VERSION 0x01 //Walace060912#1
- #define AVI_H_SUPPORT_SYNC 0xFF //0xFF for old sync word, 0xEE for new sync word //Walace060912#1
- #define AVI_H_SYC_WORD 0x00 //LEN 6 bytes //Sync. word ALiAVI 0x414c49415649
- #define AVI_H_PACKET_SEQ 0x06 //LEN 2 bytes //Packet sequcence
- #define AVI_H_PACKET_COUNT 0x0A //LEN 2 bytes // Packet count //Horry060313#1 start
- #define AVI_H_PACKET_SIZE 0x0E //LEN 2 bytes // Packet size (include Header size)
- #define AVI_H_FRAME_RATE 0x10 //LEN 1 bytes // Video frame rate //1,5,10,20 //Horry060313#1 start
- #define AVI_H_SAMPLE_RATE 0x11 //LEN 1 bytes // Audio sample rate //Horry060313#1
- #define AVI_H_IMAGE_INFO 0x13 //Walace060912#1 start
- #define AVI_H_IMAGE_FRAME_COUNT_MASK 0xF0
- #define AVI_H_IMAGE_SIZE_MASK 0x0F //Walace060912#1 end
- #define AVI_H_VIDEO_VERSION 0x14 //Walace060912#1
- */
- void VideoSaveLastPlayInfo(void)
- {
- BYTE bI;
- if(gxwCurrentPlayTime==gxwTotalPlayTime)
- {
- gxwCurrentPlayTime=0;
- gdwFileSector=0;
- }
- stUiFileListData=stPhoFileInf;
- gpstFileIndex=&stUiFileListData;
- for(bI=0;bI<11;bI++)
- gxbLastFileName[bI]=gxbFileName[bI];
- gxbLastFileDepth=gpstFileIndex->bPathDepth;
- while(gpstFileIndex->bPathDepth>0)
- {
- FsChangeDir(RESTORE_DIR);
- FsOpenFile(RELOAD_DIR_NAME);
- for(bI=0;bI<11;bI++)
- gxbLastFilePath[(gpstFileIndex->bPathDepth)*11+bI]=gxbFileName[bI];
- }
- stUiFileListData=stPhoFileInf;
- gxdwLastPlayFileSector = gdwFileSector;
- gxwVideoLastPlayTime= gxwCurrentPlayTime;
- if(gxbVideoFormat==VIDEO_TYPE_MP3_V1) //Walace070329#1
- {
- gxwVideoLastPlayTime=0;
- gxdwLastPlayFileSector=0;
- }
- }
- //Walace060926#1 VideoResume end