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

DVD

开发平台:

C/C++

  1. /**************************************************************************
  2.  *                                                                        *
  3.  *         Copyright (c) 2002 by Sunplus Technology Co., Ltd.             *
  4.  *                                                                        *
  5.  *  This software is copyrighted by and is the property of Sunplus        *
  6.  *  Technology Co., Ltd. All rights are reserved by Sunplus Technology    *
  7.  *  Co., Ltd. This software may only be used in accordance with the       *
  8.  *  corresponding license agreement. Any unauthorized use, duplication,   *
  9.  *  distribution, or disclosure of this software is expressly forbidden.  *
  10.  *                                                                        *
  11.  *  This Copyright notice MUST not be removed or modified without prior   *
  12.  *  written consent of Sunplus Technology Co., Ltd.                       *
  13.  *                                                                        *
  14.  *  Sunplus Technology Co., Ltd. reserves the right to modify this        *
  15.  *  software without notice.                                              *
  16.  *                                                                        *
  17.  *  Sunplus Technology Co., Ltd.                                          *
  18.  *  19, Innovation First Road, Science-Based Industrial Park,             *
  19.  *  Hsin-Chu, Taiwan, R.O.C.                                              *
  20.  **************************************************************************/
  21. /*--------------------------------------------------------------------------
  22. |  File Name   :  v11.c
  23. |
  24. |  Description : .... pseudo hook for 1.1 playback.                                        
  25. |
  26. |  Version    :  0.1  
  27. |  
  28. |  Rev    Date              Author(s)      Status & Comments
  29. |-----------------------------------------------------------------------------------------
  30. |  0.1                                     Creating
  31. |  0.1  2004/11/30          Linrc          Add Comments
  32. |-----------------------------------------------------------------------------------------*/
  33. #include "config.h"
  34. #include "global.h"
  35. #include "macro.h"
  36. #include "util.h"
  37. #include "func.h"
  38. #include "user_init.h"
  39. //#include "cfont.h"
  40. //#include "ircmd.h"
  41. //#include "osd.h"
  42. #ifdef SP1000_NO_DVD
  43. #include "repeat_null.c"
  44. #else
  45. //#define     REPEAT_DBG      1
  46. /**************************************************************************
  47.  *  Function Name: int repeat_func(void)                                  *                
  48.  *  Purposes:                                                             *
  49.  *    DO repeat function                                                  *
  50.  *  Descriptions:                                                         *
  51.  *     DO repeat function                                                 *
  52.  *  Arguments:                                                            *
  53.  *    input:None                                                          *                                       
  54.  *  Returns: Track will play                                              *
  55.  *  See also: None                                                        *
  56.  **************************************************************************/
  57. int
  58. repeat_func(void)
  59. {
  60.     int play_trk_now =cd_trk_now;
  61.     int func=GET_CMD_SELECT();
  62.     //repeat state check here
  63.     if(rep_mode==REPEAT_TRACK)
  64.     {
  65. play_trk_now = rep_track;            
  66. ShowRepInfo();
  67. }else
  68. {
  69. if (IS_CMD_FUNC()) 
  70. {
  71. if(func==CMD_FUNC_PREV)
  72. {
  73. if (cd_trk_now == cd_trk_lo_now) {
  74. cd_trk_now = cd_trk_hi;
  75. } else {
  76. cd_trk_now--;
  77. }
  78. }else if(func==CMD_FUNC_NEXT)
  79. {
  80. if (cd_trk_now == cd_trk_hi) {
  81. cd_trk_now = cd_trk_lo_now;
  82. //osd_print2(OS_REP_ALL); //zhyf unmark it 1-3-4 21:18
  83. //PrintOsdMsg(STR_OS_REP_ALL, REGION2, 1, 0);     /* alan 02-05-27 modified */
  84. ShowRepInfo();
  85. } else {
  86. cd_trk_now++;
  87. }
  88. }else if(func==CMD_FUNC_TIMEOUT)
  89. {
  90. if (prog_cnt==0) { //jjding 2001/4/2 02:59PM                
  91. if (play_state!=VCD_STATE_FASTBACKWARD) {                
  92. if(cd_trk_now > cd_trk_hi) { //zyf 2000/10/30 to solve Repeat ALL 
  93. cd_trk_now = cd_trk_lo_now;
  94. //osd_print2(OS_REP_ALL); //zhyf unmark it 1-3-4 21:18
  95. ShowRepInfo();
  96. }
  97. } else {
  98. if(cd_trk_now<cd_trk_lo_now) {
  99. #ifdef CD_VCD_FB_ONETIME_WHEN_REPEAT //linrc 2004-8-10 14:33
  100. cd_trk_now = cd_trk_lo_now;
  101. rep_mode = REPEAT_IDLE;
  102. ircmd_play();
  103. #else
  104. cd_trk_now=cd_trk_hi;
  105. #endif
  106. }
  107. }
  108. } // end of if (prog_cnt)
  109. } // end of if ((sys_cmd&0xff00)==CMD_FUNC)
  110. if (prog_cnt) {
  111. if(play_state!=VCD_STATE_FASTBACKWARD)
  112. prog_next();                                                        
  113. else 
  114. prog_prev();                        
  115. cd_trk_now = adjust_trk_num(prog[prog_index][0]); 
  116. }
  117. play_trk_now = cd_trk_now; 
  118.         
  119.     }
  120.     return play_trk_now;
  121. }
  122. #endif //#ifdef SP1000_NO_DVD