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

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   :  ircmd_zoom.c
  23. |
  24. |  Description :  zoom function realization in remoter.
  25. |
  26. |  Version    :  0.1  
  27. |  Rev Date         Author(s)      Status & Comments
  28. |---------------------------------------------------------------------------------
  29. |  0.1 2004/1/14        Terry         Creating
  30. |--------------------------------------------------------------------------------*/
  31. /**************************************************************************
  32.  *  Function Name: show_zoom                           
  33.  *  Purposes:                                                             
  34.  *    show word "zoom x" in region1.note:"x" is zoom multiple.                          
  35.  *  Descriptions:                                                         
  36.  *   
  37.  *  Arguments:                                                            
  38.  *    t=1: seconds for time out
  39.  *    t=0: show information at all times
  40.  *    mode(8:5) : 0 sw region on, 1 sw region off, 2 sw region anti
  41.  *    mode(3:0) : Methods to cat some information to output string
  42.  *
  43.  *  Returns:     NONE
  44.  *  See also:    NONE                                                          
  45.  *    
  46.  **************************************************************************/
  47. void show_zoom(int t)
  48. {//terry, 2004/1/14 03:17PM
  49.        
  50.   int zoom,id,md;
  51.   
  52. #ifdef NEWSTYLE_WINDOW
  53.   if(full_scrn&MESSAGE)//xiongyuyue
  54. return;
  55.   else
  56. #endif
  57.   {
  58.      if(vpp_zoom==ZOOM_PS) zoom=ZOOM_LB;//zoom 0
  59.      else zoom=vpp_zoom;
  60.        
  61.      id = STR_OS_ZOOM;
  62.      if(zoom <= ZOOMIN_MAX)
  63.      {
  64.        #ifdef TWELVE_ZOOMFACTORS     //fengjl add 2004-05-05 23:41  
  65.         switch (zoom)
  66.         {
  67.         case 2:strcpy(RegionValStr[REGION1]," 1.2");  break;
  68.         case 3:strcpy(RegionValStr[REGION1]," 1.3");  break;
  69.         case 4:strcpy(RegionValStr[REGION1]," 1.5");  break;
  70.         case 5:strcpy(RegionValStr[REGION1]," 2");    break;
  71.         case 6:strcpy(RegionValStr[REGION1]," 2.5");  break;
  72.         case 7:strcpy(RegionValStr[REGION1]," 3");    break;
  73.         case 8:strcpy(RegionValStr[REGION1]," 3.5");  break;
  74.         case 9:strcpy(RegionValStr[REGION1]," 4");    break;
  75.         }
  76.         printf(" **************ZOOM=%d **************n",zoom);
  77.        #endif
  78.        md = 8;
  79.        zoom++;       
  80.      }
  81.      else
  82.      {
  83.        md = 7;
  84.        zoom = vpp_zoom-ZOOMOUT_BASE+2;
  85.        #ifdef BBK_DVD  
  86.        id = STR_OS_NO_ZOOM;       
  87.        #endif
  88.      }
  89.      OSD1000ISP_STATUS(vpp_zoom, OSDIR_ZOOM);
  90.      PrintOsdMsg(id|(zoom<<OSDSTR_ID_TOTL_BIT),REGION1,t,md);
  91.   }
  92. }
  93. /*
  94. *   zoom in/out
  95. *   vpp_zoom  0 :  LB or Normal
  96. *             1 :  PS
  97. *             2 :  zoom in x1.3
  98. *             3 :  zoom in x1.5
  99. *             4 :  zoom in x2
  100. *             5 :  zoom in x3
  101. *             6 :  zoom out x0.75
  102. *             7 :  zoom out x0.67
  103. *             8 :  zoom out x0.5
  104. */
  105. /**************************************************************************
  106.  *  Function Name: ircmd_zoom                           
  107.  *  Purposes:                                                             
  108.  *      realize zoom function using zoom key.
  109.  *  Descriptions:                                                         
  110.  *   
  111.  *  Arguments:                                                            
  112.  *      vpp_zoom:   2~4: zoom in; 1/4~1/2:zoom out.
  113.  *      ZOOMIN_BASE~ZOOMIN_MAX   : zoom in, zoom ratio>1,at normal state ,
  114.  *                                there are there value 2,3,4.
  115.  *      ZOOMOUT_BASE~ ZOOMOUT_MAX: zoom out,zoom ratio<1, at normal state ,
  116.  *                                there are there value 1/2,1/3,1/4.
  117.  *      If minish ZOOMOUT_MAX value,corresponding,
  118.  *       zoom ratio value amount reduce.(zoom in/out)
  119.  *      for example ,ZOOMOUT_MAX value be changed from 8 to 6, 
  120.  *       there are only zoom ratio value 2,3,4,1/2 .
  121.  * 
  122.  *  Returns:     NONE
  123.  *  See also:    NONE                                                          
  124.  *    
  125.  **************************************************************************/
  126. void ircmd_zoom(void)
  127. {
  128. #ifdef INVALID_ZOOM_IN_DVD_MENU//XLJ2004-3-26
  129. //invaild zoom key during the short film in DVD menu. Zoom key is invailable
  130. //in choosing Menu too, but through inv_tbl. heqiang, 2004-4-23 9:52
  131. if(is_menu()&&(HL_exist!=1)&&(cd_type_loaded==CDDVD))
  132. {
  133. invalid_key();
  134. return;
  135. }
  136. #endif//INVALID_ZOOM_IN_DVD_MENU
  137. #if defined(SUPPORT_TUNER_MV114) || defined(SUPPORT_TUNER_ALPS) //xyy 2003-10-13 11:01
  138.     if(play_state == VCD_STATE_POWER)
  139.         return;
  140. #endif
  141. #ifndef DVB1000_NON_OS
  142.     //check invalid state
  143.     if (cd_type_loaded == CDROM)
  144.     {
  145. #ifdef ZOOM_DIRECT_STOP_SLIDE //wanghaoying 2003-08-25 20:17
  146.     if(Is_JPEG_SlideMode())//nono 4-8-19 1:05
  147. jpg_slide_time = 0xffffffff;
  148. #endif
  149. #ifdef SUPPORT_FILE_SYSTEM_MODE
  150.         //if ((GetCurrentFileType() != CDROM_MPG)|| (pFsJpeg->gifsState == FS_STATE_LIST))
  151.         if ( ((GetCurrentFileType() != CDROM_MPG) && (GetCurrentFileType() != CDROM_MP4)) || (pFsJpeg->gifsState == FS_STATE_LIST))   //hq, 2004-4-15 11:45
  152. #endif
  153.         if (!FSIsZoomOK())
  154.         {
  155.             invalid_key();
  156.             return;
  157.         }
  158. #ifdef  ROTATE_NOT_ZOOM//zhaoyanhua add 2003-12-9 16:34
  159.     if(Is_Rotate_State())
  160.     {    
  161.         invalid_key();
  162.         return;
  163.     }
  164.  
  165.      //printf("######## ZOOM-------rotate_mode:%d---n",Is_Rotate_State());
  166. #endif 
  167.     }
  168. #endif  //DVB1000_NON_OS
  169.     //set zoom ratio parameter
  170.     if(vpp_zoom<ZOOMIN_BASE)
  171.     {
  172.         vpp_zoom=ZOOMIN_BASE;
  173.     }
  174.     else if(vpp_zoom==ZOOMIN_MAX)  
  175.     {
  176.         vpp_zoom=ZOOMOUT_BASE;
  177.     }
  178.     else
  179.     {
  180.         vpp_zoom++;
  181.     }
  182.     
  183.     if (vpp_zoom>ZOOMOUT_MAX)
  184.     {
  185.         set_video_aspect();     // also reset zoom
  186.         show_zoom(1);
  187.     }
  188.     else if (vpp_zoom>=ZOOMIN_BASE && vpp_zoom<=ZOOMIN_MAX)
  189.     {
  190.         vpp_zoom_offset_mode = OFFSET_USER_CENTER;
  191.         show_zoom(0);
  192.     }
  193.     else if (vpp_zoom>=ZOOMOUT_BASE && vpp_zoom<=ZOOMOUT_MAX)
  194.     {
  195.         vpp_zoom_offset_mode = OFFSET_CENTER;
  196.         show_zoom(0);
  197.     }
  198.     //pass parameter to vpp
  199.     startup_vpp();
  200.     setVPP_DoItNow();
  201. }
  202. #ifdef ZOOM_DIRECT_STOP_SLIDE       //wanghaoying 2003-08-25 21:30
  203. //Maoyong 2004.07.05 make it a function for calling
  204. void ForceStopJpgSlide(void)
  205. {
  206.     if( Is_JPEG_SlideMode() )
  207.     {
  208.         jpg_slide_time = JPEG_SLIDE_TIME;
  209.         if(vpp_zoom!=0)
  210.         {
  211.             vpp_zoom = 0;
  212.             show_zoom(1);
  213.         }
  214.     }
  215. }
  216. #endif //#ifdef ZOOM_DIRECT_STOP_SLIDE
  217. //=================================ending====================================