OledString.h
上传用户:hjhsjcl
上传日期:2020-09-25
资源大小:11378k
文件大小:11k
源码类别:

压缩解压

开发平台:

C++ Builder

  1. /*==========================================================================
  2. Copyright (c) 2004 ALi Corporation. All Rights Reserved
  3. File: Lcd.h
  4. content: 
  5. History: Created by David Chiu 2004/3/29
  6. ==========================================================================*/
  7. #ifdef _OLED_STRING_H_
  8. #define EXTERN  
  9. #else
  10. #define EXTERN extern
  11. #endif
  12. #if(USE_SYS_STR_SCROLL)
  13. #define LCD_STR_END_COLUMN OLED_FLIST_END_COLUMN
  14. #define LCD_STR_START_COLUMN UI_FILST_STRING_START
  15. #define LCD_STR_WIDTH (OLED_FLIST_END_COLUMN-UI_FILST_STRING_START+1)
  16. #define LCD_STR_START_DELAY 20
  17. #define LCD_STR_NORMAL_DELAY 1
  18. #define LCD_STR_END_DELAY 20
  19. #endif
  20. // WHH #13 301_070106
  21. //-----------------------------------------------
  22. // USE_LYRIC_TWO_LINE: 1: Display Lyric 2 line and no scrolling
  23. // 0: Display Lyric 1 line and scrolling
  24. //-----------------------------------------------
  25. #define USE_LYRIC_TWO_LINE 0
  26. //-----------------------------------------------
  27. // Support Unicode Start Code
  28. // If your unicode font start at 0x3000(It's default), you should set 0x30
  29. //
  30. // We usally use 0x30 for most east font or 0x01 for all unicode,
  31. // in those case, you only need to change UNICODE_USE_ALL in TypeDef.h
  32. //-----------------------------------------------
  33. #if(UNICODE_USE_ALL)
  34. #define UNICODE_START_CODE 0x00  //Tne050312#1
  35. #else
  36. #define UNICODE_START_CODE 0x30
  37. #endif
  38. #define LCD_DEFAULT_RATIO 4
  39. #define LCD_DEFAULT_CONTRAST 0x02 //Walace060204#Bright  for brightness useage, 
  40. //#define LCD_DEFAULT_CONTRAST 63  //Walace060204#Bright
  41. //#define LCD_DEFAULT_CONTRAST 32 //Walace051130#2
  42. //2 ===== Backlight =========================================
  43. #define LCD_BACKLIGHT_DEFAULT  15
  44. #define LCD_BACKLIGHT_MIN 14 // ASCII 0 , BackLight Always Off
  45. //#define LCD_BACKLIGHT_MIN '3' // ASCII 0 , BackLight Always Off //Walace051229#4
  46. #define LCD_BACKLIGHT_MAX 61 // ASCII : , BackLight Always On 
  47. #define LCD_BACKLIGHT_DEFAULT_NUM LCD_BACKLIGHT_DEFAULT
  48. #define LCD_BACKLIGHT_MIN_NUM LCD_BACKLIGHT_MIN
  49. #define LCD_BACKLIGHT_MAX_NUM LCD_BACKLIGHT_MAX
  50. //#define LCD_BACKLIGHT_DEFAULT LCD_BACKLIGHT_MIN                              //Walace051229#4
  51. //tne 2005/08/08
  52. //Lcd Copy Page Sector Define(0874, 1250-1258)
  53. #define LCD_CP_0874_SECTOR 0
  54. #define LCD_CP_1250_SECTOR 1
  55. #define LCD_CP_1251_SECTOR 2
  56. #define LCD_CP_1252_SECTOR 3
  57. #define LCD_CP_1253_SECTOR 4
  58. #define LCD_CP_1254_SECTOR 5
  59. #define LCD_CP_1255_SECTOR 6
  60. #define LCD_CP_1256_SECTOR 7
  61. #define LCD_CP_1257_SECTOR 8
  62. #define LCD_CP_1258_SECTOR 9
  63. #define LCD_SCROLL_WIDTH 2 //How many pixle scrolled every time(only support 1,2,4,8)
  64. //2 ============ Tag  ==========================================
  65. // WHH #13 301_070105
  66. #define OLED_TAG_ROW 30
  67. #define OLED_TAG_COL (34-8)
  68. #define OLED_TAG_HEIGHT                                  LINE1
  69. #define OLED_TAG_END_COLUMN (121)
  70. #define LCD_TAG_START_DELAY 30 //tne 2005/11/24 #1
  71. #define LCD_TAG_NORMAL_DELAY 1
  72. #define LCD_TAG_END_DELAY 30
  73. //2 ============ Lyric  ======================================
  74. #define OLED_LYRIC_ROW 48
  75. #define OLED_LYRIC_COL (34-8)
  76. #define OLED_LYRIC_HEIGHT                               LINE1
  77. #define OLED_LYRIC_END_COLUMN (121)
  78. #if(USE_LYRIC_TWO_LINE)
  79. #define LCD_LYRIC_START_DELAY 36
  80. #define LCD_LYRIC_NORMAL_DELAY 18
  81. #else
  82. #define LCD_LYRIC_START_DELAY        9
  83. #define LCD_LYRIC_NORMAL_DELAY 0
  84. #endif
  85. //2 ============ File List  =====================================
  86. #define OLED_FLIST_COL        WORD1
  87. #define OLED_FLIST_HEIGHT                               LINE1
  88. // WHH #8 301_061226
  89. //#define OLED_FLIST_END_COLUMN MAX_COLNUM
  90. #define OLED_FLIST_END_COLUMN MAX_COLNUM-14
  91. #define LCD_FLIST_START_DELAY                      29
  92. #define LCD_FLIST_NORMAL_DELAY 2
  93. #define LCD_FLIST_END_DELAY 28
  94. //============ Sub Menu  ===============================
  95. #define ITEM_START_COL 33
  96. #define ITEM_START_ROW 48
  97. #define ITEM_ROW_OFF 20
  98. #define ITEM_NUM_OPAGE 5
  99. #define ITEM_SUB_NUM_OPAGE 4
  100. #define ITEM_COL_WIDTH 168
  101. #define ITEM_ICON_START_COL 10
  102. #define ITEM_SEL_START_COL 26
  103. //============ Subtitle status Define ===========
  104. // use by gxbLcdTagStatus, gxbLcdLyricStatus
  105. #define NO_SUBTITLE 0x00 //Default status,not load subtitle yet or no subtitle
  106. #define SHORT_SUBTITLE 0x10 //Short subtitle less than 16 words
  107. #define LONG_SUBTITLE 0x20 //Long subtitle more than 16 words
  108. //tne 512 tag start
  109. //============== Lcd Tag Turn Define ============
  110. // use by gxbLcdTagStatus, gxbLcdLyricStatus //Modified by tne 512 tag
  111. #define LCD_TAG_TURN_TITLE 0x00 //Showing MP3 TAG Title
  112. #define LCD_TAG_TURN_ARTIST 0x01 //Showing MP3 Artist
  113. #define LCD_TAG_TURN_ALBUM 0x02 //Showing MP3 ALBUM
  114. //#define LCD_TAG_TURN_GENRE 0x03 //Showing MP3 Genre
  115. #define LCD_TAG_TOTAL_NUMBER 3 //Walace061102#1
  116. #define LCD_TAG_TURN_FILEONLY 0x03 //0x04 //No MP3 TAG,Only show File name
  117. #define LCD_TAG_TURN_DEFAULT LCD_TAG_TURN_ALBUM //Default status,for change new song,MP3 Tag exist unkonw
  118. //tne 512 tag end
  119. //========== Lcd Lyric Scroll Done Flag =========
  120. // use by gxbLcdLyricStatus
  121. #define LCD_LYRIC_SCROLL_DONE 0x02
  122. #define LCD_LYRIC_SCROLLING 0x00
  123. //WHH #13 301_070106
  124. #define LCD_LYRIC_CHANGE_LINE 0x01
  125. //============== Get Lcd Tag status =============
  126. #define GET_LCD_TAG_HALFWORD() (gxbLcdTagStatus&0x01)
  127. #define GET_LCD_TAG_TURN() (gxbLcdTagStatus&0x0E)
  128. #define GET_LCD_TAG_SUBTITLE() (gxbLcdTagStatus&0xF0)
  129. //============= Get Lcd Lyric status ============
  130. #define GET_LCD_LYRIC_HALFWORD() (gxbLcdLyricStatus&0x01)
  131. #define GET_LCD_LYRIC_SUBTITLE() (gxbLcdLyricStatus&0xF0)
  132. //================ Lcd Show String Return ===============
  133. //See LcdShowString Function
  134. #define FULL_WORD 0
  135. #define HALF_WORD 1
  136. //=========== Big Font and Small Font ===========
  137. #define LCD_BIG_FONT_WIDTH 16 //Display Big Font Width ... Chinese, Japanes, Koera ...
  138. #define LCD_SMALL_FONT_WIDTH 8 //Display Small Font Width ... English
  139. //Backlight Define
  140. //Lyric & Tag hidden flag
  141. #define LCD_TAG_DISPLAY 0
  142. #define LCD_TAG_HIDDEN 1
  143. //tne 2005/08/08
  144. //Lcd Code Page Sector Define(0874, 1250-1258)
  145. #define LCD_CP_0874_SECTOR 0
  146. #define LCD_CP_1250_SECTOR 1
  147. #define LCD_CP_1251_SECTOR 2
  148. #define LCD_CP_1252_SECTOR 3
  149. #define LCD_CP_1253_SECTOR 4
  150. #define LCD_CP_1254_SECTOR 5
  151. #define LCD_CP_1255_SECTOR 6
  152. #define LCD_CP_1256_SECTOR 7
  153. #define LCD_CP_1257_SECTOR 8
  154. #define LCD_CP_1258_SECTOR 9
  155. #define LCD_AUTO_CENTER_COL 0xFF // In LcdShowSysString, auto center string
  156. //Walace060918#1 start   //vicky061107#1 update return type
  157. #if(_PM_FM_|_PM_PHOTO_|_PM_VD_MENU_) 
  158. EXTERN API WORD StrShowString(PBYTE pbShowStr,BYTE bColStart,BYTE bRowStart,BYTE bStrLen) large;
  159. EXTERN API BYTE StrShowSysString(WORD wSysStrNum,BYTE bColStart,BYTE bRowStart) large;
  160. #else
  161. EXTERN API WORD StrShowString(PBYTE pbShowStr,BYTE bColStart,BYTE bRowStart,BYTE bStrLen) ; 
  162. EXTERN API BYTE StrShowSysString(WORD wSysStrNum,BYTE bColStart,BYTE bRowStart) ;  
  163. #endif
  164. //Walace060918#1 end
  165. #if(USE_SYS_STR_SCROLL)
  166. EXTERN void OLedScrollSysString(void) large;
  167. EXTERN void SysStringScroll(void);
  168. #endif
  169. EXTERN API void StrShowInitLowPower(void);
  170. /* //Walace061228#CodeSize
  171. EXTERN API void LcdShowTagTitle() large;
  172. EXTERN API void LcdScrollTag() large;
  173. EXTERN API void LcdShowLyrics() large;
  174. EXTERN API void LcdScrollLyric() large;
  175. EXTERN API void LcdSetLyricDone() large;
  176. */
  177. EXTERN API void LcdShowTagTitle() ;
  178. EXTERN API void LcdScrollTag() ;
  179. EXTERN API void LcdShowLyrics() ;
  180. EXTERN API void LcdScrollLyric() ;
  181. EXTERN API void LcdSetLyricDone() ;
  182. #if(_PM_FLIST_|_PM_SYS_|_PM_PHOTO_|_PM_VIDEO_) //tne 2005/11/25 #2
  183. EXTERN API void LcdShowFileList(struct FILE_INF_DATA xdata * pFileStruct,BYTE bPage) large;
  184. #else
  185. EXTERN API void LcdShowFileList(PBYTE pbFileName,BYTE bPage,BYTE bStartWord) large;
  186. #endif
  187. #if(_PM_FLIST_|_PM_PHOTO_|_PM_SYS_|_PM_VIDEO_)
  188. EXTERN API BOOL LcdScrollFileList(struct FILE_INF_DATA xdata * pFileStruct, BYTE bPage,BOOL fReverse) large;
  189. #else //#if(_PM_CLIST_|_PM_HST_|)
  190. EXTERN API BOOL LcdScrollFileList(PBYTE pbFileName, BYTE bPage,BOOL fReverse) large;
  191. #endif
  192. API void LcdShowClassList(PBYTE pbClassName,BYTE bPage) large;
  193. #if(_PM_PHOTO_|_PM_VIDEO_|_PM_PLAY_|_PM_SYS_|_PM_HST_) //050803: host
  194. // gxbLcdTagStatus, gxbLcdLyricStatus:
  195. // 7 6 5 4 3 2 1 0
  196. //  | | | | | | | |
  197. //  | | | | | | | LcdShowString FULL or HALF word
  198. //  | | | |(- - -)Showing TAG
  199. // (- - - -)SubTitle Status
  200. //
  201. // bit 0: LcdShowString - FULL_WORD(0) or HALF_WORD(1)
  202. // bit 1-3: show which TAG, see Lcd Tag Turn
  203. // bit 4-7: see Lcd Subtitle Status
  204. EXTERN XBYTE gxbLcdTagStatus;
  205. //  gxbLcdLyricStatus:
  206. // 7 6 5 4 3 2 1 0
  207. //  | | | | | | | |
  208. //  | | | | | | | LcdShowString FULL or HALF word
  209. // | | | | | | Lyric Scroll Done Flag
  210. //  | | | |(- -)reserved
  211. // (- - - -)SubTitle Status
  212. //
  213. // bit 0: LcdShowString - FULL_WORD(0) or HALF_WORD(1)
  214. // bit 1: Lyric Scroll Done
  215. // bit 2-3: reserve
  216. // bit 4-7: see Lcd Subtitle Status
  217. #if(_PM_PLAY_)
  218. //EXTERN XBYTE gxbLcdLyricStatus;
  219. #endif
  220. // gxbLcdTagScrollPix,gxbLcdLyricScrollPix:
  221. // if scrolling... it is the scrolling pixel
  222. EXTERN XBYTE gxbLcdTagScrollPix;
  223. EXTERN XBYTE gxbLcdLyricScrollPix;
  224. //tne 2005/08/11 //Adjust scroll offset
  225. EXTERN XBYTE gxbLcdScrollOffset;
  226. // gxwShowTagPoint, gxbShowLyricPoint:
  227. // point to show word
  228. // EX: gxbTagTitle+gxwShowTagPoint is that word
  229. //EXTERN XBYTE gxwShowTagPoint;
  230. EXTERN XWORD gxwShowTagPoint; //tne 512 tag //vicky061107#1
  231. #if(!_PM_SYS_)
  232. EXTERN XBYTE gxbShowLyricPoint;
  233. #endif
  234. // point to Tag which is showing now
  235. EXTERN xdata PXBYTE gxbShowTagBase; //Walace061211#1
  236. // More delay for scrolling subtitle
  237. EXTERN XBYTE gxbTagScrollDelay;
  238. #if(!_PM_SYS_)
  239. EXTERN XBYTE gxbLyricScrollDelay;
  240. #endif
  241. EXTERN BOOL gfScrollFlag; //Walace060213#3 
  242. #endif
  243. #if(USE_SYS_STR_SCROLL)
  244. EXTERN XBYTE gxbSysStringScrollDelay;
  245. #endif
  246. // If string use unicode
  247. EXTERN XBYTE gxfSourceUnicode;
  248. //tne lcd scroll2
  249. // Lcd Display limit column
  250. EXTERN XBYTE gxbLcdLimitCol;
  251. // If display over the limit column, how many pixels have shown
  252. EXTERN XBYTE gxbLcdDispLimPix;
  253. // After calling LcdShowString, the last display pixel
  254. EXTERN XBYTE gxbLcdLastStrPix;
  255. EXTERN BOOL LcdChkCjkCutWord(PBYTE pbString, BYTE bLen); //tne 2006/02/24
  256. EXTERN API void LcdShowDirName(void) large;
  257. // Turn Big5->Unicode Table index
  258. //EXTERN XWORD gxwBig5UniTable;
  259. //EXTERN XWORD gxwUniBig5Table;
  260. //tne 2005/08/08 //Only keep current transfer table index
  261. /*
  262. #define gxwBig5UniTable gxwFontTable[FONT_BIG2UNI]
  263. #define gxwUniBig5Table gxwFontTable[FONT_UNI2BIG]
  264. #define gxwGbUniTable gxwFontTable[FONT_GB2UNI]
  265. */
  266. //-----------------------------------------------
  267. // USE_ONLY_STD_FONT 0:  When use Big5, include user font area(other characters)
  268. // 1: When use Big5, only use stdand font(5401 characters or 13051 characters)
  269. // This define is for old font system. It recommend to set 1
  270. //-----------------------------------------------
  271. #define USE_ONLY_STD_FONT 1
  272. //Walace051119 #1
  273. /*
  274. #define CB_NUMBER_ROW ICON_DIGIT68_H
  275. #define CB_NUMBER_COL  ICON_DIGIT68_W
  276. */
  277. #define ICON_NUMBER_ROW ICON_DIGIT68_H
  278. #define ICON_NUMBER_COL  ICON_DIGIT68_W
  279. #undef EXTERN