stop.c
上传用户:poi891205
上传日期:2013-07-15
资源大小:9745k
文件大小:17k
源码类别:

DVD

开发平台:

C/C++

  1. extern void VMG_Load_PTL_MAIT(void);
  2. #if defined(JPEG_STOP_KEY_SHOW_STOP)   //yaowh modi 041123
  3. int is_stop_key;
  4. #endif
  5. #ifdef SUPPORT_WMA
  6.     extern int fnWMAgotoPacket(UINT32 nPck);
  7. #endif
  8. #ifdef  MP3_ONLY_STOP_TO_GUI//zhaoyanhua add 2004-1-5 16:52
  9. //for bbk,when MP3 ,stop has no PRE_STOP and stop at GUI.
  10. /*
  11.  * Description:
  12.  *   clear some parameters to not excute ResumePlay.
  13.  *
  14.  */
  15. static inline void ClrMP3ResumePara(void)
  16. {
  17. if ( Is_MP3_STATE() ) 
  18. {
  19.     resumeMSF = 0;
  20. disp_time = 0;
  21.             FSNav_MP3Init(); //axel for cannot resume 1st mp3 2004/8/5 
  22.     #ifdef SUPPORT_WMA//zhaoyanhua add 2004-1-7 14:27
  23. if (GetCurrentFileType() == CDROM_WMA)
  24. {
  25. asf_resume_pck = asf_pck_current = 0;
  26. asf_resume_len = lba_st.len = 0;
  27. }
  28.     #endif//SUPPORT_WMA
  29. }
  30. }
  31. #endif//MP3_ONLY_STOP_TO_GUI
  32. #if (defined(STOP_LOADER)||defined(SUPPORT_RECEIVER))  //huziqin 2004-2-26
  33. UINT8 pre_stop;
  34. void stop_loader(void)
  35. {
  36.     if(pre_stop)
  37.     {
  38.         pre_stop=0;
  39.         flush_atapi();//terry,0515,let data tranfer finish
  40.     }else
  41.     {
  42.         abort_play();
  43.     }
  44. }
  45. #endif
  46. /*
  47. ** ircmd stop
  48. */
  49. //#define PLAY_JPEG_STOP_USE_AS_RETURN
  50. #ifdef FALSE_POWER//zhuyanfeng 20041008
  51. extern BYTE j;
  52. #endif
  53. #ifdef  USER_VERSION_INFORMATION//eastech
  54. extern BYTE custm_count;
  55. extern BYTE enter_display_flag;
  56. #endif
  57. #ifdef MP3_STOP_IN_GUI_AND_LOGO //linrc add 2004-8-2 10:40 for SHAPE DVD 
  58. UINT8 Stop_StateForTwice = 0;   //when play mp3,first enter stop,it stop to GUI, the twice enter stop to logo
  59. #endif                          //this parameter is the enter counter
  60. #ifdef STOP_15M_AUTO_POWEROFF
  61.  UINT8 STOP_15M_STATE;
  62.  extern unsigned short int sleep_counter;
  63.  #endif 
  64. void    ircmd_stop(void)
  65. {
  66. int id;
  67.     #ifdef   PLAY_JPEG_STOP_RETURN
  68.     if( (pFsJpeg->gbfsSlide != 0)||Is_JPEG_PLAY_STATE())
  69. {
  70. if(!(pFsJpeg->gbfsPictureCD))
  71. {
  72. ircmd_return();
  73. return;
  74.      }
  75.      }
  76.     #endif
  77. #ifdef STOP_15M_AUTO_POWEROFF
  78.   sleep_counter=15;
  79.                 STOP_15M_STATE=1;
  80. #endif
  81.     //Maoyong 2004-10-25 15:51 for DVB Scan stop
  82.     #ifdef DVB1000_OSD_MENU
  83.     if(system_state == SYSTEM_TS)
  84.     {
  85.     if(ScanCompleted == 0)
  86.         UserAbortScan = 1;
  87.     return;
  88. }
  89.     #endif
  90. #ifdef CONTINUOUS_NUM_KEY_SELECT
  91.     if(ir_num_timer)
  92.       ir_continuous_num_clr();
  93. #endif
  94. #ifdef SUPPORT_MIDIDISK_TITLE
  95.         if (bIsPlayMidiTitle)//xlluo for midi title
  96.         {
  97. invalid_key();
  98. return;
  99.         }
  100. #endif
  101. #ifdef  SUPPORT_SANJING_STOP    //xlluo add 04-11-6 for sanjing request
  102.         if (MenuState >= MENU_MULTI_INDEX_SEL)
  103.         {
  104. invalid_key();
  105. return;
  106.         }
  107. #endif
  108.    
  109.     #if defined(JPEG_MENU_DONT_PAUSE)&&defined(PORTABLE_DVD)//Jack 20041008 nono modify 20041009
  110.     #ifdef JPEG_THUMBNAIL_MENU
  111.     if((JPEG_THUMBNAIL_MODE == pFsJpeg->g_nJpegMode && pFsJpeg->gbfsSlide)/* && (pFsJpeg->gbfsSlide == 0)*/)
  112.       pFsJpeg->g_nJpegMode = JPEG_NORMAL_MODE;
  113.     #endif
  114.     #endif
  115.  
  116. if ( (Is_MP3_STATE()) && (adv_search_time!=0) ) //liumzh 2004-9-10 17:24
  117. adv_search_time = 0;
  118.     //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
  119. #if defined(JPEG_THUMBNAIL_MENU) && defined(MODIFY_KODAKBOOK_NO_GUI)
  120.     if(JPEG_THUMBNAIL_MODE == pFsJpeg->g_nJpegMode)
  121. {
  122.     invalid_key();
  123.     return;
  124. }
  125.     #endif //#ifdef JPEG_THUMBNAIL_MENU
  126. #ifdef MP3_STOP_IN_GUI_AND_LOGO     //linrc add 2004-8-2 10:43
  127.     if(play_state = VCD_STATE_NORMAL && play_state != VCD_STATE_MP3_FILELIST)
  128.     {
  129.         Stop_StateForTwice = 0;
  130.     }     
  131.     if(cd_type_loaded==CDROM && Is_MP3_STATE())
  132.     {
  133.         Stop_StateForTwice++;    
  134.     }
  135. #endif
  136.  
  137. #if defined(MP3_ONLY_STOP_TO_GUI)&&defined(MODIFY_MP3_ONLY_STOP_TO_GUI)//nono add 4-8-10 11:00
  138.     if ( (Is_MP3_STATE()) 
  139.       && (play_state == VCD_STATE_MP3_FILELIST) //only in FsMP3mainloop,can use "REPAB"
  140.         )
  141.     {
  142.         invalid_key();
  143.         return; 
  144.     }
  145. #endif
  146.  
  147. #ifdef  USER_VERSION_INFORMATION //eastech
  148. printf("enter ircmd_stop n");
  149. if( (play_state==VCD_STATE_OPEN)) //||(play_state==VCD_STATE_OPEN) ) 
  150. {
  151.        custm_count=0;        
  152.          enter_display_flag=1;
  153.          ClearOsdMsg(2);        
  154.          return;
  155. }
  156. #endif
  157.     #ifdef MOVE_HIGH_LIGHT_IN_PROG_MODE
  158. if(cd_type_loaded == CDROM){     //wsf  2004-7-20 14:55  changed for cancel program when stop  
  159.             prog_cnt=0;
  160.             prog_func_off();
  161.             prog_func_clear();        
  162.         }
  163.     #endif
  164. //#ifdef OP_UI
  165. // PrintOsdMsg(STR_OS_STOP,REGION1,0,0); //feeling 2004-05-26
  166. //#endif
  167. #ifdef AD_TCL
  168. DispFadeOut();
  169. #endif
  170. #if ((defined(SDRAM_16Mb_Mode)||defined(PLAY_JPEG_STOP_USE_AS_RETURN))&&!defined(JPG_EFFECT))
  171. if( Is_JPEG_STATE())//nonotestjpg
  172.     {
  173.         #ifdef PLAY_JPEG_STOP_USE_AS_RETURN_SHOW_STOP//yaowh add 04-12-22
  174.         is_stop_key = 1 ;
  175.         #endif
  176.         
  177. ircmd_return();
  178. return;
  179.     }
  180. else
  181.  
  182. #endif//#ifdef SDRAM_16Mb_Mode
  183.     {
  184. #ifdef NEW_STYLE_SETUP//terry,2003/8/20 10:01PM
  185. if(setup_state!=1)
  186. #endif    
  187. #ifdef SDRAM_16Mb_Mode
  188. if( (prog_state!=1)&&(prog_state!=4) )
  189. #endif
  190. {
  191. if (play_state!=VCD_STATE_STOP) { //PRE-STOP shouldn't show invalid-key, Jeff 20020522
  192. if(UOP_check(UOP_STOP))
  193. {
  194. invalid_key();
  195. return;
  196. }
  197. }
  198. }
  199. #if !defined(SPHE1000)
  200. if((cd_type_loaded==CDROM)&&(Mp3ReadFinish==0)) //huo 2000/10/31
  201. #else
  202. if((cd_type_loaded==CDROM)&&(Mp3ReadFinish==0) && (system_state!=SYSTEM_FILESTREAM)) //MIKEY 2004.06.25 for stop
  203. #endif
  204. {
  205. invalid_key();
  206. return;
  207. }
  208. ircmd_cancel(C_ZOOM);
  209. #ifdef SUPPORT_WMA
  210. if (GetCurrentFileType() == CDROM_WMA) // Robert 2003/12/29
  211. AVD_SetMediaTimeout(); 
  212. #endif            
  213. if(system_state!=SYSTEM_READ_TITLE)
  214. {
  215. //terry,clear vobu still
  216. Vobu_still=0;
  217. P_vobu=0;
  218. #if defined(IR_PLAY_RESUME) ||defined(IR_PLAY_RESUME_PAUSE)//nono 2-3-26 11:34 for fuss
  219. #ifdef SUPPORT_FILE_SYSTEM_MODE //to avoid bug when stop,gerry  3-1-26 17:39
  220.         #if defined(SUPPORT_MP4)&&!defined(MODIFY_MP4_STOP_NOT_NEED_RESUME)//nono 4-8-10 22:47 for eastech
  221. if( GetCurrentFileType() == CDROM_MP4 ) // Robert 2003/12/29
  222. {
  223.     #if defined(SUPPORT_CARD_STORAGE)||defined(SUPPORT_USB)||defined(SPHE8202_CARD_STORAGE)//liweihua 2004-4-28 15:09
  224.     if(media_type == MEDIA_CARD)
  225.         resumeMSF = 0;
  226.     else
  227.     #endif
  228. resumeMSF = GET_MP4_TIME();
  229.                     resumeTRK = pFsJpeg->fsnav_trk_now + pFsJpeg->first_mp3_entry;  // 2004/05/19 yltseng
  230. }
  231.                 else
  232.         #endif
  233. if(((cd_type_loaded==CDROM)&&(!Is_MP3_STATE()))||(is_cdg_disc(1)))//wanghaoying 2003-9-12 17:11 to avoid CDG prestop
  234. {
  235.                     resumeMSF=0;    
  236. }
  237. else
  238. {
  239. #endif
  240. if (cd_type_loaded != CDDVD)
  241. {
  242.     #ifdef SDRAM_16Mb_Mode   //sunzhh add for SEQ PLAY when press "setup" continuously 2004-10-21 23:50
  243.     if((prog_state==4)||(prog_state == 1))    
  244.     resumeMSF = 0;  
  245. #endif
  246. #ifdef RECORD_PER_SECOND
  247. if(play_state != VCD_STATE_STOP)
  248. resumeMSF=0 ; //for display PRE_STOP  gerry  2-12-3 12:13
  249. #endif
  250. if ((resumeMSF == 0) && (play_state != VCD_STATE_STOP) && (Is_JPEG_STATE() == 0) &&
  251. #ifdef SUPPORT_NESGAME
  252. (Is_GAME_STATE() ==0 ) &&
  253. #endif
  254. #ifdef SUPPORT_FILE_SYSTEM_MODE
  255. (Is_OTHER_STATE() ==0 ) &&
  256. #endif
  257. (!is_menu()) && ((cd_trk_now >= cd_trk_lo_now) && (cd_trk_now <= cd_trk_hi)))//nono 2-6-7 11:36
  258. {
  259. #if  defined(QISHENG_DVD)||defined(VTREK_DVD)||defined(DESAY_DVD)
  260. if (IsPBCOn())
  261. {
  262. ircmd_return();
  263. return;
  264. }
  265. #endif
  266.                             resumeMSF = ( is_svo_dvd() ) ? s_msf&0xffffffff : s_msf&0x00ffffff; //2004/01/13 yltseng for DVD disk containing data
  267. resumeTRK = cd_trk_now; //2002/3/12
  268. //Maoyong 2004.06.22 moved out
  269. #if defined(IR_PLAY_RESUME) && defined(POWER_RESUME)  //yw 021003
  270. power_resumeflag = 1;
  271. #endif
  272. }
  273. else
  274. {
  275. resumeMSF = 0;//nono test
  276. resumeTRK = 0; //2002/3/12
  277. #ifdef SUPPORT_WMA
  278. if (GetCurrentFileType() == CDROM_WMA) // Robert 2003/12/29
  279. asf_resume_pck = asf_resume_len = 0;
  280. #endif
  281. }
  282. }else {
  283. resumeMSF = 0;
  284. }
  285.     #ifdef SUPPORT_FILE_SYSTEM_MODE //to avoid bug when stop,gerry  3-1-26 17:39
  286. }
  287.     #endif
  288. #else   //defined(IR_PLAY_RESUME) ||defined(IR_PLAY_RESUME_PAUSE)
  289. if (cd_type_loaded == CDROM)
  290. {
  291. if ( Is_MP3_STATE() ) { //Jeff 20020518
  292. resumeMSF = s_msf;
  293. } else {
  294. resumeMSF = 0;
  295. }
  296. }
  297. else if(cd_type_loaded!=CDDVD)
  298. {
  299. resumeMSF=s_msf&0x00ffffff;
  300. }
  301. resumeTRK = cd_trk_now;
  302. #endif  //defined(IR_PLAY_RESUME) ||defined(IR_PLAY_RESUME_PAUSE)
  303. //Maoyong 2004.06.22 move the part under IRC_RESUME & IRC_PLAY_RESUME definiton here
  304. #ifdef SUPPORT_WMA
  305. if (GetCurrentFileType() == CDROM_WMA) // Robert 2003/12/29
  306. {
  307.     if(play_state == VCD_STATE_STOP){
  308.         // clear resume packet and len and pck time
  309. asf_resume_pck = asf_resume_len = 0;
  310. resumeMSF = 0;
  311.     }else{
  312. asf_resume_pck = asf_pck_current;
  313.                 #if defined(SUPPORT_CARD_STORAGE)||defined(SUPPORT_USB)||defined(SPHE8202_CARD_STORAGE)//liweihua 2004-4-13
  314.                 if(media_type == MEDIA_CARD)
  315.                     asf_resume_len = cardFile.iFileSize-(fnWMAgotoPacket(asf_resume_pck)-cardFile.stLBA);
  316.                 else
  317.                 #endif
  318.     asf_resume_len = lba_st.len;
  319. }
  320. }
  321. #endif
  322. #ifdef SUPPORT_CDG                      //linrc add 2004-11-4 16:36
  323. #ifdef VCD_CDG_PLAY_CONTROL_BY_SETUPMENU    //when "MNP" what define in setupmenu is on
  324. extern BYTE VcdControlFlag();             //VCD & CDG play one TRK in one time....
  325. if((VcdControlFlag())&&(is_cdg_disc(0)))
  326. {
  327.     resumeMSF = 0;
  328.     resumeTRK = 0;
  329. }
  330. #endif
  331. #endif
  332. #ifdef  MP3_ONLY_STOP_TO_GUI//zhaoyanhua add 2004-1-5 16:52
  333. //for bbk,when MP3 ,stop has no PRE_STOP and stop at GUI.
  334. ClrMP3ResumePara(); //zhaoyanhua changed  2004-4-13 15:13
  335. #endif//MP3_ONLY_STOP_TO_GUI
  336.  
  337.         
  338. if(play_state != VCD_STATE_STOP)
  339. ircmd_post_func(CMD_FUNC | CMD_FUNC_STOP);
  340. #if defined(NEW_PARENTAL_GUI)||defined(MODIFY_PARENTAL_GUI)
  341. //when enter"STOP",clear this flag.
  342. //to show parental GUI when enter"PLAY" next time.
  343. //zhaoyanhua add 2003-11-29 9:26
  344. #ifdef TUNR_OFF_PARENTAL_LVL
  345. #ifndef NOT_SHOW_GUI_WHEN_PLAY_IN_STOP
  346. //when play parental disc,stop ->play not show parental GUI. 
  347. //zhaoyanhua 2004-2-9 17:26
  348. bTurnOffParentalLVL = 0;
  349. #endif
  350. #endif
  351. //to avoid the bug :
  352. // first enter"ONE_KEY_PASS",then enter STOP,the following
  353. //PLAY will excute "ONE_KEY_PASS" 
  354. #ifdef ONE_KEY_PASS
  355. one_key_pass_play = 0;
  356. #endif
  357. dvd_title = 0;
  358. #endif//#if defined(NEW_PARENTAL_GUI)||defined(MODIFY_PARENTAL_GUI)
  359. // alan 02-05-21 modified to fix '