stop.c
上传用户:poi891205
上传日期:2013-07-15
资源大小:9745k
文件大小:17k
- extern void VMG_Load_PTL_MAIT(void);
- #if defined(JPEG_STOP_KEY_SHOW_STOP) //yaowh modi 041123
- int is_stop_key;
- #endif
- #ifdef SUPPORT_WMA
- extern int fnWMAgotoPacket(UINT32 nPck);
- #endif
- #ifdef MP3_ONLY_STOP_TO_GUI//zhaoyanhua add 2004-1-5 16:52
- //for bbk,when MP3 ,stop has no PRE_STOP and stop at GUI.
- /*
- * Description:
- * clear some parameters to not excute ResumePlay.
- *
- */
- static inline void ClrMP3ResumePara(void)
- {
- if ( Is_MP3_STATE() )
- {
- resumeMSF = 0;
- disp_time = 0;
- FSNav_MP3Init(); //axel for cannot resume 1st mp3 2004/8/5
- #ifdef SUPPORT_WMA//zhaoyanhua add 2004-1-7 14:27
- if (GetCurrentFileType() == CDROM_WMA)
- {
- asf_resume_pck = asf_pck_current = 0;
- asf_resume_len = lba_st.len = 0;
- }
- #endif//SUPPORT_WMA
- }
- }
- #endif//MP3_ONLY_STOP_TO_GUI
- #if (defined(STOP_LOADER)||defined(SUPPORT_RECEIVER)) //huziqin 2004-2-26
- UINT8 pre_stop;
- void stop_loader(void)
- {
- if(pre_stop)
- {
- pre_stop=0;
- flush_atapi();//terry,0515,let data tranfer finish
- }else
- {
- abort_play();
- }
- }
- #endif
- /*
- ** ircmd stop
- */
- //#define PLAY_JPEG_STOP_USE_AS_RETURN
- #ifdef FALSE_POWER//zhuyanfeng 20041008
- extern BYTE j;
- #endif
- #ifdef USER_VERSION_INFORMATION//eastech
- extern BYTE custm_count;
- extern BYTE enter_display_flag;
- #endif
- #ifdef MP3_STOP_IN_GUI_AND_LOGO //linrc add 2004-8-2 10:40 for SHAPE DVD
- UINT8 Stop_StateForTwice = 0; //when play mp3,first enter stop,it stop to GUI, the twice enter stop to logo
- #endif //this parameter is the enter counter
- #ifdef STOP_15M_AUTO_POWEROFF
- UINT8 STOP_15M_STATE;
- extern unsigned short int sleep_counter;
- #endif
- void ircmd_stop(void)
- {
- int id;
- #ifdef PLAY_JPEG_STOP_RETURN
- if( (pFsJpeg->gbfsSlide != 0)||Is_JPEG_PLAY_STATE())
- {
- if(!(pFsJpeg->gbfsPictureCD))
- {
- ircmd_return();
- return;
- }
- }
- #endif
- #ifdef STOP_15M_AUTO_POWEROFF
- sleep_counter=15;
- STOP_15M_STATE=1;
- #endif
- //Maoyong 2004-10-25 15:51 for DVB Scan stop
- #ifdef DVB1000_OSD_MENU
- if(system_state == SYSTEM_TS)
- {
- if(ScanCompleted == 0)
- UserAbortScan = 1;
- return;
- }
- #endif
- #ifdef CONTINUOUS_NUM_KEY_SELECT
- if(ir_num_timer)
- ir_continuous_num_clr();
- #endif
- #ifdef SUPPORT_MIDIDISK_TITLE
- if (bIsPlayMidiTitle)//xlluo for midi title
- {
- invalid_key();
- return;
- }
- #endif
- #ifdef SUPPORT_SANJING_STOP //xlluo add 04-11-6 for sanjing request
- if (MenuState >= MENU_MULTI_INDEX_SEL)
- {
- invalid_key();
- return;
- }
- #endif
-
- #if defined(JPEG_MENU_DONT_PAUSE)&&defined(PORTABLE_DVD)//Jack 20041008 nono modify 20041009
- #ifdef JPEG_THUMBNAIL_MENU
- if((JPEG_THUMBNAIL_MODE == pFsJpeg->g_nJpegMode && pFsJpeg->gbfsSlide)/* && (pFsJpeg->gbfsSlide == 0)*/)
- pFsJpeg->g_nJpegMode = JPEG_NORMAL_MODE;
- #endif
- #endif
-
- if ( (Is_MP3_STATE()) && (adv_search_time!=0) ) //liumzh 2004-9-10 17:24
- adv_search_time = 0;
- //Maoyong 2004-8-13 0:45 stop should not do action in thumbnail menu for usage: stop key not return from 6 pic mode to GUI
- #if defined(JPEG_THUMBNAIL_MENU) && defined(MODIFY_KODAKBOOK_NO_GUI)
- if(JPEG_THUMBNAIL_MODE == pFsJpeg->g_nJpegMode)
- {
- invalid_key();
- return;
- }
- #endif //#ifdef JPEG_THUMBNAIL_MENU
- #ifdef MP3_STOP_IN_GUI_AND_LOGO //linrc add 2004-8-2 10:43
- if(play_state = VCD_STATE_NORMAL && play_state != VCD_STATE_MP3_FILELIST)
- {
- Stop_StateForTwice = 0;
- }
- if(cd_type_loaded==CDROM && Is_MP3_STATE())
- {
- Stop_StateForTwice++;
- }
- #endif
-
- #if defined(MP3_ONLY_STOP_TO_GUI)&&defined(MODIFY_MP3_ONLY_STOP_TO_GUI)//nono add 4-8-10 11:00
- if ( (Is_MP3_STATE())
- && (play_state == VCD_STATE_MP3_FILELIST) //only in FsMP3mainloop,can use "REPAB"
- )
- {
- invalid_key();
- return;
- }
- #endif
-
- #ifdef USER_VERSION_INFORMATION //eastech
- printf("enter ircmd_stop n");
- if( (play_state==VCD_STATE_OPEN)) //||(play_state==VCD_STATE_OPEN) )
- {
- custm_count=0;
- enter_display_flag=1;
- ClearOsdMsg(2);
- return;
- }
- #endif
- #ifdef MOVE_HIGH_LIGHT_IN_PROG_MODE
- if(cd_type_loaded == CDROM){ //wsf 2004-7-20 14:55 changed for cancel program when stop
- prog_cnt=0;
- prog_func_off();
- prog_func_clear();
- }
- #endif
- //#ifdef OP_UI
- // PrintOsdMsg(STR_OS_STOP,REGION1,0,0); //feeling 2004-05-26
- //#endif
- #ifdef AD_TCL
- DispFadeOut();
- #endif
- #if ((defined(SDRAM_16Mb_Mode)||defined(PLAY_JPEG_STOP_USE_AS_RETURN))&&!defined(JPG_EFFECT))
- if( Is_JPEG_STATE())//nonotestjpg
- {
- #ifdef PLAY_JPEG_STOP_USE_AS_RETURN_SHOW_STOP//yaowh add 04-12-22
- is_stop_key = 1 ;
- #endif
-
- ircmd_return();
- return;
- }
- else
-
- #endif//#ifdef SDRAM_16Mb_Mode
- {
- #ifdef NEW_STYLE_SETUP//terry,2003/8/20 10:01PM
- if(setup_state!=1)
- #endif
- #ifdef SDRAM_16Mb_Mode
- if( (prog_state!=1)&&(prog_state!=4) )
- #endif
- {
- if (play_state!=VCD_STATE_STOP) { //PRE-STOP shouldn't show invalid-key, Jeff 20020522
- if(UOP_check(UOP_STOP))
- {
- invalid_key();
- return;
- }
- }
- }
-
- #if !defined(SPHE1000)
- if((cd_type_loaded==CDROM)&&(Mp3ReadFinish==0)) //huo 2000/10/31
- #else
- if((cd_type_loaded==CDROM)&&(Mp3ReadFinish==0) && (system_state!=SYSTEM_FILESTREAM)) //MIKEY 2004.06.25 for stop
- #endif
- {
- invalid_key();
- return;
- }
-
- ircmd_cancel(C_ZOOM);
- #ifdef SUPPORT_WMA
- if (GetCurrentFileType() == CDROM_WMA) // Robert 2003/12/29
- AVD_SetMediaTimeout();
- #endif
-
- if(system_state!=SYSTEM_READ_TITLE)
- {
- //terry,clear vobu still
- Vobu_still=0;
- P_vobu=0;
- #if defined(IR_PLAY_RESUME) ||defined(IR_PLAY_RESUME_PAUSE)//nono 2-3-26 11:34 for fuss
- #ifdef SUPPORT_FILE_SYSTEM_MODE //to avoid bug when stop,gerry 3-1-26 17:39
- #if defined(SUPPORT_MP4)&&!defined(MODIFY_MP4_STOP_NOT_NEED_RESUME)//nono 4-8-10 22:47 for eastech
- if( GetCurrentFileType() == CDROM_MP4 ) // Robert 2003/12/29
- {
- #if defined(SUPPORT_CARD_STORAGE)||defined(SUPPORT_USB)||defined(SPHE8202_CARD_STORAGE)//liweihua 2004-4-28 15:09
- if(media_type == MEDIA_CARD)
- resumeMSF = 0;
- else
- #endif
- resumeMSF = GET_MP4_TIME();
- resumeTRK = pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry; // 2004/05/19 yltseng
- }
- else
- #endif
- if(((cd_type_loaded==CDROM)&&(!Is_MP3_STATE()))||(is_cdg_disc(1)))//wanghaoying 2003-9-12 17:11 to avoid CDG prestop
- {
- resumeMSF=0;
- }
- else
- {
- #endif
- if (cd_type_loaded != CDDVD)
- {
- #ifdef SDRAM_16Mb_Mode //sunzhh add for SEQ PLAY when press "setup" continuously 2004-10-21 23:50
- if((prog_state==4)||(prog_state == 1))
- resumeMSF = 0;
- #endif
- #ifdef RECORD_PER_SECOND
- if(play_state != VCD_STATE_STOP)
- resumeMSF=0 ; //for display PRE_STOP gerry 2-12-3 12:13
- #endif
- if ((resumeMSF == 0) && (play_state != VCD_STATE_STOP) && (Is_JPEG_STATE() == 0) &&
- #ifdef SUPPORT_NESGAME
- (Is_GAME_STATE() ==0 ) &&
- #endif
- #ifdef SUPPORT_FILE_SYSTEM_MODE
- (Is_OTHER_STATE() ==0 ) &&
- #endif
- (!is_menu()) && ((cd_trk_now >= cd_trk_lo_now) && (cd_trk_now <= cd_trk_hi)))//nono 2-6-7 11:36
- {
- #if defined(QISHENG_DVD)||defined(VTREK_DVD)||defined(DESAY_DVD)
- if (IsPBCOn())
- {
- ircmd_return();
- return;
- }
- #endif
- resumeMSF = ( is_svo_dvd() ) ? s_msf&0xffffffff : s_msf&0x00ffffff; //2004/01/13 yltseng for DVD disk containing data
- resumeTRK = cd_trk_now; //2002/3/12
- //Maoyong 2004.06.22 moved out
- #if defined(IR_PLAY_RESUME) && defined(POWER_RESUME) //yw 021003
- power_resumeflag = 1;
- #endif
- }
- else
- {
- resumeMSF = 0;//nono test
- resumeTRK = 0; //2002/3/12
- #ifdef SUPPORT_WMA
- if (GetCurrentFileType() == CDROM_WMA) // Robert 2003/12/29
- asf_resume_pck = asf_resume_len = 0;
- #endif
- }
- }else {
- resumeMSF = 0;
- }
- #ifdef SUPPORT_FILE_SYSTEM_MODE //to avoid bug when stop,gerry 3-1-26 17:39
- }
- #endif
- #else //defined(IR_PLAY_RESUME) ||defined(IR_PLAY_RESUME_PAUSE)
- if (cd_type_loaded == CDROM)
- {
- if ( Is_MP3_STATE() ) { //Jeff 20020518
- resumeMSF = s_msf;
- } else {
- resumeMSF = 0;
- }
- }
- else if(cd_type_loaded!=CDDVD)
- {
- resumeMSF=s_msf&0x00ffffff;
- }
-
- resumeTRK = cd_trk_now;
- #endif //defined(IR_PLAY_RESUME) ||defined(IR_PLAY_RESUME_PAUSE)
- //Maoyong 2004.06.22 move the part under IRC_RESUME & IRC_PLAY_RESUME definiton here
- #ifdef SUPPORT_WMA
- if (GetCurrentFileType() == CDROM_WMA) // Robert 2003/12/29
- {
- if(play_state == VCD_STATE_STOP){
- // clear resume packet and len and pck time
- asf_resume_pck = asf_resume_len = 0;
- resumeMSF = 0;
- }else{
- asf_resume_pck = asf_pck_current;
- #if defined(SUPPORT_CARD_STORAGE)||defined(SUPPORT_USB)||defined(SPHE8202_CARD_STORAGE)//liweihua 2004-4-13
- if(media_type == MEDIA_CARD)
- asf_resume_len = cardFile.iFileSize-(fnWMAgotoPacket(asf_resume_pck)-cardFile.stLBA);
- else
- #endif
- asf_resume_len = lba_st.len;
- }
- }
- #endif
- #ifdef SUPPORT_CDG //linrc add 2004-11-4 16:36
- #ifdef VCD_CDG_PLAY_CONTROL_BY_SETUPMENU //when "MNP" what define in setupmenu is on
- extern BYTE VcdControlFlag(); //VCD & CDG play one TRK in one time....
- if((VcdControlFlag())&&(is_cdg_disc(0)))
- {
- resumeMSF = 0;
- resumeTRK = 0;
- }
- #endif
- #endif
- #ifdef MP3_ONLY_STOP_TO_GUI//zhaoyanhua add 2004-1-5 16:52
- //for bbk,when MP3 ,stop has no PRE_STOP and stop at GUI.
- ClrMP3ResumePara(); //zhaoyanhua changed 2004-4-13 15:13
- #endif//MP3_ONLY_STOP_TO_GUI
-
-
- if(play_state != VCD_STATE_STOP)
- ircmd_post_func(CMD_FUNC | CMD_FUNC_STOP);
- #if defined(NEW_PARENTAL_GUI)||defined(MODIFY_PARENTAL_GUI)
- //when enter"STOP",clear this flag.
- //to show parental GUI when enter"PLAY" next time.
- //zhaoyanhua add 2003-11-29 9:26
- #ifdef TUNR_OFF_PARENTAL_LVL
- #ifndef NOT_SHOW_GUI_WHEN_PLAY_IN_STOP
- //when play parental disc,stop ->play not show parental GUI.
- //zhaoyanhua 2004-2-9 17:26
- bTurnOffParentalLVL = 0;
- #endif
- #endif
- //to avoid the bug :
- // first enter"ONE_KEY_PASS",then enter STOP,the following
- //PLAY will excute "ONE_KEY_PASS"
- #ifdef ONE_KEY_PASS
- one_key_pass_play = 0;
- #endif
- dvd_title = 0;
- #endif//#if defined(NEW_PARENTAL_GUI)||defined(MODIFY_PARENTAL_GUI)
- // alan 02-05-21 modified to fix '