- 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源码
UiPlayMenu.c
资源名称:SDK_M5661.rar [点击查看]
上传用户:hjhsjcl
上传日期:2020-09-25
资源大小:11378k
文件大小:23k
源码类别:
压缩解压
开发平台:
C++ Builder
- /*==========================================================================
- Copyright (c) 2004 ALi Corporation. All Rights Reserved
- File: UiPlayMenu.c
- content: music menu in playback module
- History: Created by TNE 2005/6/6
- ==========================================================================*/
- #define _UI_MENU_H_
- #include <DP8051XP.H>
- #include "TypeDef.h"
- #include "Const.h"
- #include "Reg5661.h"
- #include "Common.h"
- #include "UiCommon.h"
- #include "SysStrDef.h"
- #include "UiSysStr.h"
- #include "OledString.h"
- #include "Key.h"
- #include "SaveSetting.h"
- #include "Playback.h"
- #include "NandFlash.h"
- #include "Idma.h"
- #include "FileSystem.h"
- #include "ExtCodec.h"
- #include "IntCodec.h"
- #include "UiPlayCommon.h"
- #include "UiFileList.h"
- #include "UiPlayMenu.h"
- #include "ClassDataBase.h"
- #include "IconDefine.h"
- #include "OLED.h"
- void UiErrHandle(void) large;
- void UiEnterMenuItem(void) large;
- void UiBackMenuItem(void) large;
- void UiMusicMenuEnter(void) large;
- void UiRepeatMenuEnter(void) large;
- void UiEqMenuEnter(void) large;
- void Ui3DMenuEnter(void) large;
- void UiPlayRateMenuEnter(void) large;
- void UiId3TagMenuEnter(void) large;
- void UiIntroMenuEnter(void) large;
- void UiDrawIntro(void) large;
- void UiResumeMenuEnter(void) large;
- void UiWorkBackMenu(void) large;
- void UiUserEqMenuEnter(void) large;
- void UiPlayGoFileList(void);
- void UiPlayMenuDispCtrl(BYTE gxbPeDispCmd); //Walace060606#PlayProcess
- code CWORD *pcbMenuListStr[]=
- {
- cwStringMusicList,
- cwStringRepeatList,
- cwStringEQList,
- cwStringOffOnList,
- cwStringPlaybackRateList,
- 0, //File List, Dummy //tne 2007/01/06 #1
- //0, //Class List, Dummy //tne 2007/01/24 #2
- cwStringSlideList, //Walace060220#1 //tne 2007/01/06 #1
- 0, //User EQ, Dummy
- };
- CBYTE cbMenuMaxItemNum[]=
- {
- MENU_MUSIC_MAX_ITEM_NUM,
- MENU_REPEAT_MAX_ITEM_NUM,
- MENU_EQ_MAX_ITEM_NUM,
- MENU_3D_MAX_ITEM_NUM,
- MENU_PLAY_RATE_MAX_ITEM_NUM,
- 0, //File List, Dummy //tne 2007/01/06 #1
- // 0, //Class List, Dummy //tne 2007/01/24 #2
- //MENU_INTRO_MAX_ITEM_NUM, //tne 2007/01/06 #1
- MENU_SLIDE_SHOW_ITEM_NUM,
- MENU_USER_EQ_MAX_ITEM_NUM,
- };
- CBYTE cbMenuTitleStr[]=
- {
- SYS_STR_MENU,
- SYS_STR_MENU_REPEAT,
- SYS_STR_SMP_TITLE_EQ,
- SYS_STR_MENU_3D,
- SYS_STR_SMP_TITLE_PRATE,
- SYS_STR_SEL_FILE_BROWSE, //tne 2007/01/06 #1
- //SYS_STR_SEL_CLASSIFICATION, //tne 2007/01/24 #2
- //SYS_STR_MENU_INTRO, //tne 2007/01/06 #1
- SYS_STR_SMP_TITLE_SSHOW,
- SYS_STR_MENU_EQ_CUSTOM
- };
- CBYTE cbSlsTimeTable[]={0,5,10,15,30,60};
- //#endif //tne 2006/01/16
- ////////////////////////////////////////////////////////////////////////////////////
- ///////////////////////////////// Ui Header End ///////////////////////////////////
- ////////////////////////////////////////////////////////////////////////////////////
- void main(void)
- {
- BYTE bKey,bPeCommand;
- //Walace060607#1 PlayProcess
- if((gxbModuleState&MODULE_SUB)==MODULE_PRC_EOF_CTRL||
- (gxbModuleState&MODULE_SUB)==MODULE_NAND_RTN_RESOTRE) //NandRestore
- KeepMemory(RESTORE_MEMORY);
- EA = 1;
- ET0=1;
- #if(ICE_REAL_MODE) //vicky061001#2 Debug Play
- EnableTimer0();
- IE=0x83;
- #endif
- bKey=KEY_INVALID;
- bPeCommand=P_NOP;
- //gxbMenuDispLine=0; //tne 2007/01/06 #1 // Jeff070215#3
- //tne 2007/01/08 #1
- if(gxwTotalFileInAll>0)
- {
- //gpstFileIndex=&stUiFileListData;//Vicky050321#2 //tne 2005/11/21 #2
- //FsOpenFile(RELOAD_FILE_NAME); //stUiFileListData //tne 2005/11/21 #2
- gxwFileNumInFileList=gxwCurtFileInDir+gxwTotalDirInDir;
- }
- else
- {
- gxwFileNumInFileList=0;
- gxbLastErrCode=ERR_FS_NO_FILE_FOUND;
- }
- SetSysSpeed(0x08);
- #if(_PM_PLAY_)
- PeFillDspBuf() ;
- #endif
- if((gxbModuleState&MODULE_SUB)==MODULE_PRC_EOF_CTRL)
- {
- gxbModuleState=MODULE_PLAY_MENU;
- goto ERROR_HANDLE;
- }
- //NandRestore start
- else if((gxbModuleState&MODULE_SUB)==MODULE_NAND_RTN_RESOTRE) //Nick061120
- {
- gxbModuleState=MODULE_PLAY_MENU;
- goto RETURN_FROM_NANDRESTORE;
- }
- //NandRestore end
- else
- {
- gxbMenuDispLine=0; //tne 2007/01/06 #1 // Jeff070215#3
- }
- gxbModuleState=MODULE_PLAY_MENU;
- OLED_DISP_MASK_INIT(); //Walace070108#1
- //set default value
- gxfSourceUnicode=STRING_TYPE_ASCII;
- gxbCheckBattCounter=0;
- gxbBtyReTestNum=0;
- gxbBtyLowNum=0;
- gxbPwOffCounter=0;
- gpstFileIndex=&stFsFileInf;
- #if(UI_PLAY_USER_EQ_EDIT)
- gxbSelUserDefEq=5;
- #endif
- #if(SYS_USE_KEY_HOLD)
- gfLastKeyLocked=KEY_UNLOCK;
- #endif
- UiFileListFileType=UI_FILE_LIST_PLAYBACK;
- gfPwOffStop=FALSE;
- gxbLcdLimitCol=MAX_COLNUM; //tne lcd scroll2
- gbKeyCnt=0; // Larry070310#4
- #if(UI_USE_CHK_CARD)
- if(gxbStorage!=STOR_NAND)
- UiCheckCardRemoved();
- #endif
- UiDrawBasicMusicMenu();
- UiShowMusicMenuText();
- goto ERROR_HANDLE;
- while(1)
- {
- KeyGet(bKey);
- UiCheckBackLight(bKey);
- UiNormalCheck();
- #if(USE_LYRIC_DISPLAY)
- UiPlayLyricControl();
- #endif
- bPeCommand=P_NOP;
- #if(!EXT_ADC | !EXT_DAC | !EXT_PA)
- if(gxbMusicProcState==MUSIC_PROC_BODY) //Renshuo050603#A
- {
- //IntCdcSetPaGainTask(FALSE); //Renshuo041203#A //Ren050312#1
- CdcSetPaGainTask(PA_TASK_UNIMMEDIATE|PA_TASK_DELAY); //Walace060525#4 //tne 2006/12/26 #1
- }
- #endif
- switch(bKey)
- {
- case KEY_LEFT_LONG:
- case KEY_LEFT_BREAK:
- if(bKey==KEY_LEFT_LONG&&gbKeyCnt!=2)// Larry070310#4START
- {
- gbKeyCnt++;
- break;
- }// Larry070310#4END
- UiPrevMenuItem();
- gbKeyCnt=0;// Larry070310#4
- break;
- case KEY_RIGHT_LONG:
- case KEY_RIGHT_BREAK:
- if(bKey==KEY_RIGHT_LONG&&gbKeyCnt!=2)// Larry070310#4START
- {
- gbKeyCnt++;
- break;
- }// Larry070310#4END
- UiNextMenuItem();
- gbKeyCnt=0;// Larry070310#4
- break;
- #if(UI_PLAY_USER_EQ_EDIT)
- //tne 2007/01/06 #1 start
- #if(FIVEKEY)
- case KEY_VOL_BREAK:
- #else
- case KEY_REC_BREAK:
- #endif
- if(gxbUiMenuMainStates==UI_USER_EQ_MENU)
- {
- gfUserEqStartEdit = (!gfUserEqStartEdit);
- UiShowUDefEqSel();
- }
- break;
- /*
- case KEY_VOL_UP_LONG:
- case KEY_VOL_UP_BREAK:
- if(gxbUiMenuMainStates==UI_USER_EQ_MENU)
- {
- if(gxbSelUserDefEq==5)
- UiEditUdefEq(UI_EDIT_ALL_EQ_UP);
- else
- UiEditUdefEq(UI_EDIT_EQ_UP);
- }
- break;
- case KEY_VOL_DOWN_LONG:
- case KEY_VOL_DOWN_BREAK:
- if(gxbUiMenuMainStates==UI_USER_EQ_MENU)
- {
- if(gxbSelUserDefEq==5)
- UiEditUdefEq(UI_EDIT_ALL_EQ_DOWN);
- else
- UiEditUdefEq(UI_EDIT_EQ_DOWN);
- }
- break;
- */
- #endif
- case KEY_UP_BREAK:
- UiEnterMenuItem();
- break;
- case KEY_FUNC_BREAK:
- case KEY_MODE_BREAK:
- UiBackMenuItem();
- break;
- }
- #if(PLAY_ERR_THEN_NEXT_MUSIC) //Walace061024#2
- EOF_CTRL_PROC:
- #endif
- //End of file control
- #include "EOF_Ctrl.h"
- gpstFileIndex=&stFsFileInf; //Vicky050321#2
- PlayEngine(bPeCommand);
- ERROR_HANDLE:
- if(gxbErrCode!=ERR_NO_ERROR)
- {
- #if(PLAY_ERR_THEN_NEXT_MUSIC) //Walace061024#2
- if(gxbErrCode==ERR_PE_UNSUPPORT_FORMAT||gxbErrCode==ERR_PE_NO_AUTHORITY)
- {
- bPeCommand=P_NEXT;
- gxbErrCode = ERR_NO_ERROR;
- goto EOF_CTRL_PROC;
- }
- else
- {
- PlayEngine(P_STOP); //Walace061024#2
- }
- #else
- PlayEngine(P_STOP); //Walace061024#2
- #endif
- }
- UiPlayMenuDispCtrl(gxbPeDispCmd);
- gxbPeDispCmd=UI_PE_NOP;
- #if(1)
- //vicky070105#3 remove to function
- #if(_PM_DVR_)
- UiCheckNandRestore(MODULE_DVR_MENU);
- #else
- UiCheckNandRestore(MODULE_PLAY_MENU);
- #endif
- #else
- //Nick061120 start //NandRestore start
- if((gxbRestoreBlkNum || (gxwTimeToScanPM > SCAN_PM_DURATION)) &&
- (gfChangeMusic || gxbSysState==S_PE_PAUSE||gxbSysState==S_PE_WAIT)&&gfMLCMode) //Nick061204
- {
- //LCD_CTRL_DIS(); //Walace061126#1
- #if(_PM_DVR_)
- gxbModuleState=MODULE_DVR_MENU;
- #else
- gxbModuleState=MODULE_PLAY_MENU;
- #endif
- //Nick061204 start
- if(gxwTimeToScanPM > SCAN_PM_DURATION)
- gxbRestoreCMD |= PM_SCAN;
- else
- gxbRestoreCMD = FullStep;
- //Nick061204 end
- KeepMemory(KEEP_MEMORY) ;
- LoadProgram(PM_PLAY_DATA_RTN_RESTORE, BASIC_CODE_ONLY);
- }
- #endif
- RETURN_FROM_NANDRESTORE:
- //Nick061120 end //NandRestore end
- if(gfChangeMusic)
- {
- gxdwLastFileSize=0;
- if( (gxbIntroMode) && (gfIntroPlaying!=INTRO_PLAY) )
- {
- UiGoIntroMode();
- UiGoNoMenu();
- }
- gfChangeMusic=FALSE;
- }
- }
- }
- API void UiFsDispCtrl(BYTE bStatus) large //tne play 320 music
- {
- switch(bStatus)
- {
- default:
- case UI_FS_OPENING_FILE:
- //PeFillDspBuf(); //not need
- break;
- }
- }
- //Walace060606#1 PlayProcess start
- API void UiPlayMenuDispCtrl(BYTE bStatus)
- {
- bStatus=bStatus; //tne 2007/01/14 #3
- #if(USE_ERR_MSG_DISPLAY)
- if(gxbErrCode!=ERR_NO_ERROR)
- {
- UiErrHandle();
- return;
- }
- #endif
- }
- //Walace060606#1 PlayProcess end
- #if(0) //Walace060606#1 PlayProcess
- API void UiDispCtrl(BYTE bStatus)
- {
- // #if(!_PM_DVR_) //tne 2006/01/16
- WORD wDspVal=gxbUiMenuSubStates;
- //#endif //tne 2006/01/16
- #if(USE_ERR_MSG_DISPLAY)
- if(gxbErrCode!=ERR_NO_ERROR)
- {
- UiErrHandle();
- return;
- }
- #endif
- if(bStatus==UI_PE_START_END)
- {
- gxbLastErrCode=ERR_NO_ERROR;
- //UiCountCurtFileNum(&stUiFileListData,&stFsFileInf);
- //Walace060127#2 start
- /*
- #if(!UI_EQ_CUSTOM) // Jeff_051116
- IdmaPioDmxW(&gxwEqMode,DSP_EQ_ADDR,1,DSP_W16);
- #else
- UiSetEqGain();
- #endif
- //chun_chi 060105
- #if(UI_USE_USER_EQ)
- if(gxwEqMode==EQ_USER)
- UiSetEqGain(EQ_USER);
- #endif
- IdmaPioDmxW(&gxw3DMode,DSP_3D_ADDR,1,DSP_W16);
- */
- IdmaPioDmxW(&gxw3DMode,DSP_3D_ADDR,1,DSP_W16);
- if((gxbUiMenuMainStates!=UI_EQ_MENU)||(gxbUiMenuMainStates!=UI_USER_EQ_MENU)) //Walace060402#1
- UiSetEqGain(gxwEqMode);
- //Walace060127#2 end
- #if(USE_LYRIC_DISPLAY)
- gxbLcdLyricStatus=LCD_LYRIC_SCROLL_DONE; // set done to show first lyric
- gxbLastLyrcBuf[1]=0; //tne 2005/08/11
- #endif
- switch(gxbUiMenuMainStates)
- {
- //#if(!_PM_DVR_) //tne 2006/01/16
- case UI_EQ_MENU: //Walace060402#1
- case UI_USER_EQ_MENU: //Walace060402#1
- //Walace060127#2 start
- /*
- #if(!UI_EQ_CUSTOM) // Jeff_051116
- IdmaPioDmxW(&gxwEqMode,DSP_EQ_ADDR,1,DSP_W16);
- #else
- UiSetEqGain();
- #endif
- //chun_chi 060105
- #if(UI_USE_USER_EQ)
- if(gxwEqMode==EQ_USER)
- UiSetEqGain(EQ_USER);
- #endif
- IdmaPioDmxW(&gxw3DMode,DSP_3D_ADDR,1,DSP_W16);
- */
- UiSetEqGain(wDspVal);
- //Walace060127#2 end
- break;
- case UI_3D_MENU:
- //Vicky060303#1
- DetermineDspClock(gxbPlaybackRate, wDspVal);
- IdmaPioDmxW(&wDspVal,DSP_3D_ADDR,1,DSP_W16);
- /*
- //Vicky060106#1
- if(gxwSampleRate > 24000) //for low Fs, don't raise clk, or DSP<->CODEC will halt //Renshuo050218#Y
- obCLKDSPDIVF = 0x01; //raise DSP clock
- if(
- (gxbPlaybackRate == 2)
- &&((gxbMusicType&M_MAIN_TYPE) == M_MP3)
- &&( ((gxwByteRate*2/25)>160) || (gxbMusicFeature&MF_VBR) )
- && (gxwSampleRate >= 44100)
- //&&(gxw3DMode == SOUND_3D_ON)
- )
- obCLKDSPDIVF=0x00; //48Khz:73Mhz,,44.1Khz:67Mhz
- //End
- */
- /* //Walace060317#3
- #if(UI_USE_USER_EQ)
- UiSetEqGain(EQ_USER);
- #endif
- */
- break;
- //#endif //tne 2006/01/16
- case UI_PLAYBACK_RATE_MENU:
- PeSetPlaybackRate(gxbUiMenuSubStates);
- break;
- }
- #if(!_PM_DVR_)
- UiCheckTag(); //tne 2005/11/07
- #endif
- gxwCurrentPlayTime=0; //set 0 for intro mode
- // gxdwCurrentLrcTime=0; //tne 2006/02/10 #1 //Walace060226#Remove
- gfFillDspBufEn=TRUE;
- }
- else if(bStatus==UI_PE_START_START) //tne 2005/08/10
- {
- LoadExtendMemCode();
- gfFillDspBufEn=FALSE;
- UiCountCurtFileNum(&stUiFileListData,&stFsFileInf);
- #if(UI_DISP_DIR_NAME)
- UiGetCurtDirName();
- #endif
- }
- else if(bStatus==UI_PE_STOP)
- {
- if(!gfPwOffStop) //tne 2005/11/21 #2
- {
- UiRndPlayInit();
- gxwCurrentPlayTime=0;
- // gxdwCurrentLrcTime=0; //tne 2006/02/10 #1 //Walace060226#Remove
- }
- }
- }
- #endif
- void UiErrHandle(void) large
- {
- #if(USE_ERR_MSG_DISPLAY)
- if(gxbErrCode!=ERR_NO_ERROR)
- gxbLastErrCode=gxbErrCode;
- #endif
- }
- //tne 2007/01/06 #1 move to UiPlayCommon.c
- //void UiShowMusicMenuText(void) large
- //function modify by tne 2007/01/06 #1
- void UiEnterMenuItem(void) large
- {
- switch(gxbUiMenuMainStates)
- {
- case UI_MUSIC_MENU:
- UiMusicMenuEnter();
- break;
- case UI_REPEAT_MENU:
- UiRepeatMenuEnter();
- gxbUiMenuMainStates=UI_MUSIC_MENU;
- gxbUiMenuSubStates=UI_MUSIC_REPEAT_MENU;
- break;
- // #if(!_PM_DVR_) //tne 2006/01/16
- case UI_EQ_MENU:
- UiEqMenuEnter();
- if(gxbUiMenuMainStates!=UI_USER_EQ_MENU)
- {
- gxbUiMenuMainStates=UI_MUSIC_MENU;
- gxbUiMenuSubStates=UI_MUSIC_EQ_MENU;
- }
- break;
- #if(UI_PLAY_USER_EQ_EDIT)
- case UI_USER_EQ_MENU:
- UiUserEqMenuEnter();
- gxbUiMenuMainStates=UI_MUSIC_MENU;
- gxbUiMenuSubStates=UI_MUSIC_EQ_MENU;
- UiDrawBasicMusicMenu();
- UiShowMusicMenuText();
- break;
- #endif
- case UI_3D_MENU:
- Ui3DMenuEnter();
- gxbUiMenuMainStates=UI_MUSIC_MENU;
- gxbUiMenuSubStates=UI_MUSIC_3D_MENU;
- break;
- // #endif //tne 2006/01/16
- /* //tne 2007/01/06 #1
- case UI_INTRO_MENU:
- UiIntroMenuEnter();
- break;
- */
- case UI_PLAYBACK_RATE_MENU:
- UiPlayRateMenuEnter();
- gxbUiMenuMainStates=UI_MUSIC_MENU;
- gxbUiMenuSubStates=UI_MUSIC_PLAYBACK_RATE_MENU;
- break;
- #if(!_PM_DVR_)
- case UI_SLIDE_SHOW:
- //UiSlideShowMenuEnter();
- //gfSlideShow=(BOOL)gxbUiMenuSubStates; //Walace060220#1
- gxbSlideShowSet=cbSlsTimeTable[gxbUiMenuSubStates]; //Walace060220#1 start //tne 2007/01/06 #1
- gxbUiMenuMainStates=UI_MUSIC_MENU;
- gxbUiMenuSubStates=UI_MUSIC_SLIDE_SHOW;
- break;
- #endif
- }
- UiShowMusicMenuText();
- //UiGoNoMenu();
- }
- void UiBackMenuItem(void) large
- {
- UiWorkBackMenu();
- #if(UI_PLAY_USER_EQ_EDIT)
- if(gxbUiMenuMainStates==UI_USER_EQ_MENU)
- gxbUiMenuMainStates=UI_EQ_MENU;
- else
- #endif
- gxbUiMenuMainStates=UI_MUSIC_MENU;
- UiShowMusicMenuText();
- }
- void UiWorkBackMenu(void) large
- {
- #if(UI_PLAY_USER_EQ_EDIT)
- BYTE bI;
- #endif
- switch(gxbUiMenuMainStates)
- {
- case UI_MUSIC_MENU:
- UiGoNoMenu();
- break;
- case UI_REPEAT_MENU:
- gxbUiMenuSubStates=UI_MUSIC_REPEAT_MENU;
- break;
- //#if(!_PM_DVR_) //tne 2006/01/16
- case UI_EQ_MENU:
- gxbUiMenuSubStates=UI_MUSIC_EQ_MENU; //tne 2006/01/14 #3
- //Walace060127#2 start
- /*
- #if(!UI_EQ_CUSTOM) // Jeff_051116
- IdmaPioDmxW(&gxwEqMode,DSP_EQ_ADDR,1,DSP_W16);
- #else
- UiSetEqGain();
- #endif
- //chun_chi 060105
- #if(UI_USE_USER_EQ)
- if(gxwEqMode==EQ_USER)
- UiSetEqGain(EQ_USER);
- #endif
- */
- UiSetEqGain(gxwEqMode);
- //Walace060127#2 end
- break;
- #if(UI_PLAY_USER_EQ_EDIT)
- case UI_USER_EQ_MENU:
- UiDrawBasicMusicMenu();
- gxbUiMenuSubStates=EQ_USER;
- //restore old user def eq value
- for(bI=0;bI<=5;bI++)
- gxbUserDefEq[bI]=gxbOldUserDefEq[bI];
- UiSetEqGain(EQ_USER);
- break;
- #endif
- case UI_3D_MENU:
- gxbUiMenuSubStates=UI_MUSIC_3D_MENU;
- DetermineDspClock(gxbPlaybackRate, gxw3DMode); //Vicky060303#1
- IdmaPioDmxW(&gxw3DMode,DSP_3D_ADDR,1,DSP_W16);
- break;
- //#endif //tne 2006/01/16
- /* tne 2007/01/06 #1
- case UI_INTRO_MENU:
- UiDrawBasicMusicMenu();
- gxbUiMenuSubStates=UI_MUSIC_INTRO_MENU;
- #if(MAX_VOL_OUTPUT_POWER_TUNE) //Walace060301
- obDCVARRD = 0x09;
- obDCVWRDATA=0x00;
- #endif
- break;
- */
- case UI_SLIDE_SHOW: //Walace060220#1
- UiDrawBasicMusicMenu();
- gxbUiMenuSubStates=UI_MUSIC_SLIDE_SHOW;
- break;
- case UI_PLAYBACK_RATE_MENU:
- gxbUiMenuSubStates=UI_MUSIC_PLAYBACK_RATE_MENU;
- PeSetPlaybackRate(gxbPlaybackRate);
- break;
- }
- }
- void UiMusicMenuEnter(void) large
- {
- switch(gxbUiMenuSubStates)
- {
- case UI_MUSIC_REPEAT_MENU:
- gxbUiMenuMainStates=UI_REPEAT_MENU;
- gxbUiMenuSubStates=gxbRepeatMode;
- if(!gfPlayAutoSearchFile) //dir repeat
- {
- switch(gxbRepeatMode)
- {
- case NO_REPEAT:
- gxbUiMenuSubStates=UI_REPEAT_DIR_MENU;
- break;
- case ALL_REPEAT:
- gxbUiMenuSubStates=UI_REPEAT_ALL_DIR_MENU;
- break;
- case RND_ALL_REPEAT:
- gxbUiMenuSubStates=UI_REPEAT_RND_ALL_DIR_MENU;
- break;
- }
- }
- break;
- //#if(!_PM_DVR_) //tne 2006/01/16
- case UI_MUSIC_EQ_MENU:
- gxbUiMenuMainStates=UI_EQ_MENU;
- gxbUiMenuSubStates=gxwEqMode;
- break;
- case UI_MUSIC_3D_MENU:
- gxbUiMenuMainStates=UI_3D_MENU;
- gxbUiMenuSubStates=gxw3DMode;
- break;
- //#endif //tne 2006/01/16
- /* tne 2007/01/06 #1 start
- case UI_MUSIC_INTRO_MENU:
- OledClearArea(14,LINE1,25,LINE1) ;
- UI_CLEAR_MENU_TAG_AREA();
- OledClearArea(SEG2,LINE0,OLED_MAX_COL-WORD2,LINE1) ; //Walace060220#1
- StrShowSysString(SYS_STR_MENU_INTRO,SEG2,PAGE0);
- gxbUiMenuMainStates=UI_INTRO_MENU;
- gxbUiMenuSubStates=gxbIntroMode;
- break;
- */
- // case UI_MUSIC_ENTER_CLIST_MENU: //tne 2007/01/24 #2
- case UI_MUSIC_ENTER_FLIST_MENU:
- if((!gbFsUnableUse)&&(gxbLastErrCode!=ERR_FS_NO_FILE_FOUND))
- UiPlayGoFileList();
- break;
- case UI_MUSIC_PLAYBACK_RATE_MENU:
- gxbUiMenuMainStates=UI_PLAYBACK_RATE_MENU;
- gxbUiMenuSubStates=gxbPlaybackRate;
- break;
- #if((!_PM_DVR_)&UI_USE_SLIDE_SHOW)
- case UI_MUSIC_SLIDE_SHOW: //Walace060220#1
- /* //tne 2007/01/06 #1
- OledClearArea(14,LINE1,25,LINE1) ;
- UI_CLEAR_MENU_TAG_AREA();
- OledClearArea(SEG2,LINE0,OLED_MAX_COL-WORD2,LINE1) ;
- StrShowSysString(SYS_STR_MENU_SLIDE,SEG2,PAGE0);
- */
- gxbUiMenuMainStates=UI_SLIDE_SHOW;
- //tne 2007/01/06 #1
- for(gxbUiMenuSubStates=0;gxbUiMenuSubStates<MENU_SLIDE_SHOW_ITEM_NUM;gxbUiMenuSubStates++)
- {
- if(cbSlsTimeTable[gxbUiMenuSubStates]==gxbSlideShowSet)
- break;
- }
- break;
- #endif
- }
- //UiShowMusicMenuText(); //tne 2007/01/07 #1
- }
- void UiRepeatMenuEnter(void) large
- {
- if(gxbUiMenuSubStates>=UI_REPEAT_DIR_MENU)
- {
- gfPlayAutoSearchFile=FALSE;
- switch(gxbUiMenuSubStates)
- {
- case UI_REPEAT_DIR_MENU:
- gxbRepeatMode=NO_REPEAT;
- break;
- case UI_REPEAT_ALL_DIR_MENU:
- gxbRepeatMode=ALL_REPEAT;
- break;
- case UI_REPEAT_RND_ALL_DIR_MENU:
- gxbRepeatMode=RND_ALL_REPEAT;
- break;
- }
- gxwNumTotalFiles=gxwTotalFileInDir; //=gxwTotalFileInClass
- gxwCurrentFileNum=gxwCurtFileInDir; //=gxwCurtFileInClass
- }
- else
- {
- gfPlayAutoSearchFile=TRUE;
- gxbRepeatMode=gxbUiMenuSubStates;
- //UI for class
- if(gxbPlayClassMode==P_CLASS_MODE_FILE)
- gxwNumTotalFiles=gxwTotalFileInAll;
- else
- gxwNumTotalFiles=gxwTotalFileInAllClass;
- gxwCurrentFileNum=gxwCurtFileInAll; //gxwCurtFileInAllClass
- }
- #if(UI_USE_PLAY_LIST_EN)
- if((gxbRepeatMode==RND_ALL_REPEAT)||(gxbRepeatMode==RND_REPEAT))
- #else
- if(gxbRepeatMode>=RND_ALL_REPEAT)
- #endif
- UiRndPlayInit();
- }
- //#if(!_PM_DVR_) //tne 2006/01/16
- void UiEqMenuEnter(void) large
- {
- #if(UI_PLAY_USER_EQ_EDIT)
- WORD wI;
- if(gxbUiMenuSubStates==EQ_USER)
- {
- //enter user define EQ
- gxbUiMenuMainStates=UI_USER_EQ_MENU;
- gxbUiMenuSubStates=gxbSelUserDefEq;
- UiSetEqGain(EQ_USER);
- wI=EQ_USER;
- IdmaPioDmxW(&wI,DSP_EQ_ADDR,1,DSP_W16);
- //saev old user define eq value
- for(wI=0;wI<=5;wI++)
- gxbOldUserDefEq[wI]=gxbUserDefEq[wI];
- /* //tne 2007/01/06 #1 start
- OLED_CLEAR_ALL();
- //OledShowIcon(ICON_LAB_MUSIC,SEG0,LINE0); //tne 2006/12/26 #2
- #if(SYS_USE_KEY_HOLD)//Nick061120
- //UiShowKeyHold(); //Walace060915#2 //tne 2006/12/26 #2
- #endif
- StrShowSysString(SYS_STR_MENU_EQ_CUSTOM,LCD_AUTO_CENTER_COL,PAGE0);
- UiDrawUserDefEq();
- */
- gfUserEqStartEdit=FALSE;
- //tne 2007/01/06 #1 end
- }
- else
- #endif
- {
- gxwEqMode=gxbUiMenuSubStates;
- }
- }
- //#endif //tne 2006/01/16
- #if(UI_PLAY_USER_EQ_EDIT) //tne 2006/01/16
- void UiUserEqMenuEnter(void) large
- {
- gxwEqMode=EQ_USER;
- }
- #endif
- //#if(!_PM_DVR_) //tne 2006/01/16
- void Ui3DMenuEnter(void) large
- {
- gxw3DMode=gxbUiMenuSubStates;
- }
- //#endif //tne 2006/01/16
- /* //tne 2007/01/06 #1
- void UiIntroMenuEnter(void) large
- {
- gxbIntroMode=gxbUiMenuSubStates;
- if(gxbIntroMode==0)
- gfIntroPlaying=INTRO_NOP;
- else if( (gxbSysState==S_PE_STOP) || (gxbSysState==S_PE_WAIT) )
- gfIntroPlaying=INTRO_WAIT;
- #if(MAX_VOL_OUTPUT_POWER_TUNE) //Walace060301
- OledShowNumber(99,WORD0,LINE0,2);
- obDCVARRD = 0x09;
- obDCVWRDATA=0x00;
- #endif
- }
- */
- /* //tne 2007/01/06 #1
- void UiDrawIntro(void) large
- {
- #if(MAX_VOL_OUTPUT_POWER_TUNE) //Walace060301
- BYTE bDelay;
- #endif
- CLEAR_MENU_NUM_AREA();
- OledShowNumber(gxbUiMenuSubStates,18,PAGE3,2);
- #if(UI_USE_PROGRESS_BAR)
- ShowProgress(11,38,((WORD)gxbUiMenuSubStates*PROGRESS_MAX)/15);
- #endif
- #if(MAX_VOL_OUTPUT_POWER_TUNE) //Walace060301
- if(gxbUiMenuSubStates<=7)
- {
- OledShowNumber(gxbUiMenuSubStates,WORD0,LINE1,2);
- GPIOC_ON(2);
- obDCVARRD = 0x09;
- obDCVWRDATA=((gxbUiMenuSubStates<<4)|0x00);
- bDelay=80; //about 400us
- while(bDelay--){};
- GPIOC_OFF(2);
- }
- #endif
- }
- */
- void UiPlayRateMenuEnter(void) large
- {
- gxbPlaybackRate=gxbUiMenuSubStates;
- }
- #if(_PM_MENU_==1)
- void UiSelectItemControl(void) large
- {
- WORD wDspVal;
- wDspVal=gxbUiMenuSubStates;
- switch(gxbUiMenuMainStates)
- {
- //#if(!_PM_DVR_) //tne 2006/01/16
- case UI_EQ_MENU:
- //Walace060127#2 start
- /*
- #if(!UI_EQ_CUSTOM) // Jeff_051116
- IdmaPioDmxW(&gxwEqMode,DSP_EQ_ADDR,1,DSP_W16);
- #else
- UiSetEqGain();
- #endif
- //chun_chi 060105
- #if(UI_USE_USER_EQ)
- if(gxwEqMode==EQ_USER)
- UiSetEqGain(EQ_USER);
- #endif
- */
- UiSetEqGain(wDspVal);
- //Walace060127#2 end
- break;
- case UI_USER_EQ_MENU:
- break;
- case UI_3D_MENU:
- //Vicky060303 Update#1
- DetermineDspClock(gxbPlaybackRate,wDspVal); //determine DSP clock by global setting
- IdmaPioDmxW(&wDspVal,DSP_3D_ADDR,1,DSP_W16);
- break;
- //#endif //tne 2006/01/16
- /* tne 2007/01/06 #1
- case UI_INTRO_MENU:
- //Intro control
- break;
- */
- case UI_PLAYBACK_RATE_MENU:
- PeSetPlaybackRate(gxbUiMenuSubStates);
- break;
- case UI_REPEAT_MENU:
- case UI_MUSIC_MENU:
- default:
- //do nothing
- break;
- }
- }
- #endif
- void UiGoNoMenu(void)
- {
- DetermineDspClock(gxbPlaybackRate,gxw3DMode); //Vicky060303#1
- PeFillDspBuf();
- //speed up to download code
- SetSysSpeed(0x02);
- gxbModuleState=MODULE_PLAY_MENU; //Walace060607#1 PlayProcess
- #if(_PM_DVR_)
- LoadProgram(PM_PLAY_DVR,BASIC_CODE_ONLY);
- #else
- LoadProgram(PM_PLAY_FAT_LARGE,BASIC_CODE_ONLY);
- #endif
- }
- //tne 2007/01/06 #1
- void UiPlayGoFileList(void)
- {
- PeFillDspBuf();
- SetSysSpeed(0x02);
- gxbModuleState=MODULE_PLAY_MENU; //Walace060607#1 PlayProcess
- #if(_PM_DVR_)
- LoadProgram(PM_DVR_FILE_LIST,BASIC_CODE_ONLY);
- #else
- //if(gxbPlayClassMode==P_CLASS_MODE_FILE)
- if(gxbUiMenuSubStates==UI_MUSIC_ENTER_FLIST_MENU) //tne 2007/01/24 #2
- LoadProgram(PM_PLAY_FILE_LIST,BASIC_CODE_ONLY);
- else
- LoadProgram(PM_CLASS_LIST,BASIC_CODE_ONLY);
- #endif
- }