osd_jpg_rotate.c
上传用户:caisangzi8
上传日期:2013-10-25
资源大小:15756k
文件大小:9k
源码类别:

DVD

开发平台:

C/C++

  1. /*
  2.  *************************************************************************
  3.  * File Name:   osd_jpg_rotate.c
  4.  * Created:     2004/6/30 Maoyong
  5.  * Description: for easy do customizied jpeg rotation string display, no need
  6.                 to compile JPEG/FS releated files
  7.  * Maintain:
  8.  ************************************************************************/
  9. #include "cmd.h"
  10. #include "set.h"   //terry,2005/1/24 04:29PM
  11. #include "user_init.h"
  12. #include "jpegeffect.h"
  13. #ifdef USE_JAPANESE_IN_JPEG_MODE            //hq, 2004-3-11 16:41
  14. #include "cfont.h"
  15. #include "setup_page.h"
  16. #include "setup_def.h"
  17. extern const UINT8 setup_item[MAX_SETUP_PAGE + MAX_CUSTM_SETUP_PAGE][MAX_PAGE_ITEM][MAX_ITEM_SEL];
  18. #endif//USE_JAPANESE_IN_JPEG_MODE
  19. #ifdef  USE_CHINESE_IN_JPEG_ROTATE //zhaoyanhua add 2004-2-9 14:43
  20. extern const char *const _OsdMessegeFont1[N_OSD_LANGS][MAX_OSD_STR_ID];
  21. #endif//#ifdef  USE_CHINESE_IN_JPEG_ROTATE
  22. //*****linrc move the following here from jpegeffect.c 2005-1-20 16:55****//
  23. #ifdef JPG_EFFECT
  24. #ifdef USE_CHINESE_IN_JPEG_MODE            //fengjl add 4-1-5 20:43
  25. const char * const jpeg_effect_str_chinese[EFFECT_MODE_NUM] = {
  26.      OS_WIPE_TOP,                     //0  //由上至下进图    
  27.      OS_WIPE_BOTTOM,                  //1  //由下至上进图    
  28.      OS_WIPE_LEFT,                    //2  //由左至右进图  
  29.      OS_WIPE_RIGHT,                   //3  //由右至左进图  
  30.      OS_DIGONAL_WIPE_LEFT_TOP,        //4  //由左上至右下进图
  31.      OS_DIGONAL_WIPE_RIGHT_TOP,       //5  //由右上至左下进图
  32.      OS_DIGONAL_WIPE_LEFT_BOTTOM,     //6  //由左下至右上进图
  33.      OS_DIGONAL_WIPE_RIGHT_BOTTOM,    //7  //由右上至左下进图
  34.      OS_EXTEND_FROM_CENTER_H,         //8  //由中间向上下展开图
  35.      OS_EXTEND_FROM_CENTER_V,         //9  //由中间向左右展开图
  36.      OS_COMPRESS_TO_CENTER_H,         //10  //由上下向中间展开图
  37.      OS_COMPRESS_TO_CENTER_V,         //11  //由左右向中间展开图
  38.      OS_WINDOW_H,                     //12  //由上向下分层展开图
  39.      OS_WINDOW_V,                     //13  //由左向右分层展开图
  40.      OS_WIPE_FROM_EDGE_TO_CENTER,     //14  //由四周向中间分层展开图
  41.      OS_RANDOM_WAY,                   //15  //随机进图
  42.      OS_NONE_WAY,                     //16  //正常进图
  43. //     OS_WIPE_TOP,                     //17  //由上至下进图
  44. };
  45. #endif//USE_CHINESE_IN_JPEG_MODE
  46. #ifdef USE_JAPANESE_IN_JPEG_MODE      //hq, 2004-3-11 14:32
  47. const char * const jpeg_effect_str_japanese[EFFECT_MODE_NUM] = {
  48.      JOS_WIPE_TOP,                     //0  //由上至下进图    
  49.      JOS_WIPE_BOTTOM,                  //1  //由下至上进图    
  50.      JOS_WIPE_LEFT,                    //2  //由左至右进图  
  51.      JOS_WIPE_RIGHT,                   //3  //由右至左进图  
  52.      JOS_DIGONAL_WIPE_LEFT_TOP,        //4  //由左上至右下进图
  53.      JOS_DIGONAL_WIPE_RIGHT_TOP,       //5  //由右上至左下进图
  54.      JOS_DIGONAL_WIPE_LEFT_BOTTOM,     //6  //由左下至右上进图
  55.      JOS_DIGONAL_WIPE_RIGHT_BOTTOM,    //7  //由右上至左下进图
  56.      JOS_EXTEND_FROM_CENTER_H,         //8  //由中间向上下展开图
  57.      JOS_EXTEND_FROM_CENTER_V,         //9  //由中间向左右展开图
  58.      JOS_COMPRESS_TO_CENTER_H,         //10  //由上下向中间展开图
  59.      JOS_COMPRESS_TO_CENTER_V,         //11  //由左右向中间展开图
  60.      JOS_WINDOW_H,                     //12  //由上向下分层展开图
  61.      JOS_WINDOW_V,                     //13  //由左向右分层展开图
  62.      JOS_WIPE_FROM_EDGE_TO_CENTER,     //14  //由四周向中间分层展开图
  63.      JOS_RANDOM_WAY,                   //15  //随机进图
  64.      JOS_NONE_WAY,                     //16  //正常进图
  65. };
  66. //for ROTATE etc. in Slide Shoe. I only added Japanese Notes for JPEG_EXT2FULL. 
  67. //if not define JPEG_EXT2FULL, Please add Japanese Notes by yourself when needed. 
  68. //add these strings into 'osd_string.h' is better. hq, 2004-3-22 17:20 
  69. //JOS_UP_DOWN,JOS_LEFT_RIGHT,JOS_ROTATE_LEFT,JOS_ROTATE_RIGHT,
  70. #endif//USE_JAPANESE_IN_JPEG_MODE
  71. #ifndef SDRAM_16Mb_Mode       //only use 16Mb*1 SDRAM
  72. const char * const jpeg_effect_str[EFFECT_MODE_NUM] = {
  73.     "WIPE TOP",                     // 0
  74.     "WIPE BOTTOM",                  // 1
  75.     "WIPE LEFT",                    // 2
  76.     "WIPE RIGHT",                   // 3
  77.     "DIGONAL WIPE LEFT TOP",        // 4
  78.     "DIGONAL WIPE RIGHT TOP",       // 5
  79.     "DIGONAL WIPE LEFT BOTTOM",     // 6
  80.     "DIGONAL WIPE RIGHT BOTTOM",    // 7
  81.     "EXTEND FROM CENTER H",         // 8
  82.     "EXTEND FROM CENTER V",         // 9
  83.     "COMPRESS TO CENTER H",         // 10
  84.     "COMPRESS TO CENTER V",         // 11
  85.     "WINDOW H",                     // 12
  86.     "WINDOW V",                     // 13
  87.     "WIPE FROM EDGE TO CENTER",     // 14
  88.     "RANDOM",                       // 15
  89.     "NONE",                         // 16
  90. #ifdef JPEG_EFFECT_OFFITEM
  91.     "EFFECT CLOSED"                      // 17
  92. #endif 
  93. };
  94. #else
  95. const char * const jpeg_effect_str[EFFECT_MODE_NUM] = {
  96.     "WIPE TOP",                // 0
  97.     "WIPE BOTTOM",             // 1
  98.     "WIPE L",                  // 2
  99.     "WIPE R",                  // 3
  100.     "DIGONAL L TOP",           // 4
  101.     "DIGONAL R TOP",           // 5
  102.     "DIGONAL L BOTTOM",        // 6
  103.     "DIGONAL R BOTTOM",        // 7
  104.     "EXTEND CENTER H",         // 8
  105.     "EXTEND CENTER V",         // 9
  106.     "COMPRESS CENTER H",       // 10
  107.     "COMPRESS CENTER V",       // 11
  108.     "WINDOW H",                // 12
  109.     "WINDOW V",                // 13
  110.     "EDGE TO CENTER",          // 14
  111.     "RANDOM",                  // 15
  112.     "NONE",                    // 16
  113. #ifdef JPEG_EFFECT_OFFITEM
  114.     "EFFECT CLOSED"                      // 17
  115. #endif 
  116. };
  117. #endif
  118. #endif  //endif JPG_EFFECT
  119. //*******************end linrc move here ***************************//
  120. //======================rotation display osd str=====================
  121. #ifdef YADAI_DVD
  122. #define ROTATION_LEFT_STR     NSZ//2004-3-22 19:14 LIJD
  123. #elif defined(ENGLISH_OSD_IN_JPEG_ROTATE)
  124. #define ROTATION_LEFT_STR     "ROTATE ANTI-CLOCKWISE"
  125. #else
  126. #define ROTATION_LEFT_STR     "<<<"
  127. #endif
  128. #ifdef YADAI_DVD
  129. #define ROTATION_RIGHT_STR    SSZ//2004-3-22 19:14 LIJD
  130. #elif defined(ENGLISH_OSD_IN_JPEG_ROTATE)
  131. #define ROTATION_RIGHT_STR     "ROTATE CLOCKWISE"
  132. #else
  133. #define ROTATION_RIGHT_STR    ">>>"
  134. #endif
  135. #ifdef YADAI_DVD
  136. #define ROTATION_UP_DOWN_STR  ShangXia//2004-3-22 19:15 LIJD
  137. #else
  138. #define ROTATION_UP_DOWN_STR     "UP-DOWN"
  139. #endif
  140. #ifdef YADAI_DVD
  141. #define ROTATION_L_R_STR      ZuoYou//2004-3-22 19:15 LIJD
  142. #else
  143. #define ROTATION_L_R_STR      "LEFT-RIGHT"
  144. #endif
  145. //=============================rotation display  str functino =====================
  146. #ifdef USE_JAPANESE_IN_JPEG_MODE    //I think it's so special, so tell from this case
  147. void DispJpgRotateStr(void)
  148. {
  149.     UINT8 *str = "";
  150.     const UINT8 *osdRotStrJan[5] = {JOS_ROTATE_LEFT, JOS_ROTATE_RIGHT, JOS_LEFT_RIGHT, 0, JOS_UP_DOWN};
  151.     const UINT8 *osdRotStrEng[5] =
  152.     {
  153.     #ifdef ENGLISH_OSD_IN_JPEG_ROTATE//wuxiaofeng 02-27 for minton DVD
  154.     "ROTATE ANTI-CLOCKWISE", "ROTATE CLOCKWISE", "LEFT-RIGHT", "", "UP-DOWN",
  155. #else
  156.     "<<<", ">>>", "LEFT-RIGHT", "", "UP-DOWN",
  157. #endif
  158.     };
  159.    #ifdef OSD_L_JP_BEFORE_EN//hq, 2004-3-22 9:49
  160. BYTE my_osd_font_mode = 0;
  161.     if(osd_font_mode == 0)
  162.      my_osd_font_mode = 1;
  163.     else
  164.      my_osd_font_mode = 0;
  165. if (setup_item[LANGPAGE][LANGITEM][my_osd_font_mode+2]==LCD_JA)
  166. #else//OSD_L_JP_BEFORE_EN
  167.     if (setup_item[LANGPAGE][LANGITEM][osd_font_mode+2]==LCD_JA)
  168. #endif//OSD_L_JP_BEFORE_EN
  169.     {
  170. str = osdRotStrJan[sys_cmd - CMDS_GAME_L]; //Jan
  171.     }else{
  172.         str = osdRotStrEng[sys_cmd - CMDS_GAME_L];
  173. }
  174. }
  175. #else   //#ifdef USE_JAPANESE_IN_JPEG_MODE
  176. void DispJpgRotateStr(void)
  177. {
  178.     UINT8 *str = "";
  179. #ifndef JPEG_EXT2FULL
  180.     const UINT8 *osdRotStr[5] =
  181.     {
  182.         ROTATION_LEFT_STR, ROTATION_RIGHT_STR, ROTATION_L_R_STR,  "", ROTATION_UP_DOWN_STR,
  183.     };
  184.     str = osdRotStr[sys_cmd - CMDS_GAME_L];
  185. #elif defined(NINTAUS_DVD)
  186.     const UINT16 rotOSDStr[5] =
  187.     {
  188.         STR_OS_PICTURE_ROTATE_LEFT, STR_OS_PICTURE_ROTATE_RIGHT,
  189.         STR_OS_PICTURE_LR, 0, STR_OS_PICTURE_UD,
  190.     };
  191.     psprintf(RegionValStr[REGION1], "");
  192.     PrintOsdMsg(rotOSDStr[sys_cmd - CMDS_GAME_L], REGION1, 1, 0);
  193. #elif  defined(USE_CHINESE_IN_JPEG_MODE)//yaowh(USE_CHINESE_IN_JPEG_ROTATE)&&defined(BBK_DVD)//zhaoyanhua add 2004-2-9 14:44
  194.     if( (sys_cmd == CMDS_GAME_L) || (sys_cmd == CMDS_GAME_L) )
  195.         str = (UINT8 *)_OsdMessegeFont1[osd_font_mode][STR_OS_PICTURE_ROTATE];
  196.     else
  197.         str = (UINT8 *)_OsdMessegeFont1[osd_font_mode][STR_OS_PICTURE_UPTURN];
  198. #else  //for direct string display
  199.     const char * const osdRotStr[5] =
  200.     {
  201.     #ifdef ENGLISH_OSD_IN_JPEG_ROTATE//wuxiaofeng 02-27 for minton DVD
  202.     "ROTATE ANTI-CLOCKWISE", "ROTATE CLOCKWISE", "LEFT-RIGHT", "", "UP-DOWN",
  203. #else
  204.     "<<<", ">>>", "LEFT-RIGHT", "1234",  "UP-DOWN",
  205. #endif
  206.     };
  207.     str = (UINT8 *)osdRotStr[sys_cmd - CMDS_GAME_L];
  208. #endif  //#ifdef NINTAUS_DVD
  209. #ifndef NINTAUS_DVD
  210.     psprintf(RegionValStr[REGION1], str);
  211.     PrintOsdMsg(STR_OS_SPACE, REGION1, 1, 1);
  212. #endif
  213. }
  214. #endif  //ifdef USE_JAPANESE_IN_JPEG_MODE