📄 osdsrch.c
字号:
#include "winav.h"#ifndef NO_SEARCH_UI //++CoCo2.37p#include "input.h"#include "osd.h"#include "hal.h"#include "cc.h"#include "gdi.h"#include "fontindex.h" //++CoCo2.37P#include "dvdinfo.h"#include "infofilter.h"#include "linear.h"#include "navigate.h"#include "utl.h"#include "osdsrch.h" #include "cell.h"#include "vcd20.h"#include "digest.h"#include "thumb.h"#include "srcfilter.h"#include "media.h"#include "osdnd.h" #include "setup.h"#include "parser.h"#ifdef SIMPLE_SEARCH_UI#include "osddsply.h"#endif#include "notransl.h"/* alan testWORD aTitleIcon[] = {1, CHAR_N_TITLE}; WORD aChapterIcon[] = {1, CHAR_N_CHAP}; WORD aTimeIcon[] = {1, CHAR_N_TIME}; *///alex909,20040909 move osdsrch.c/***********************************/// DEFINE/***********************************/#define FRAME_THICKNESS 2#define TOTAL_BUTTON_NUM_IN_SRCH 4#define TOTAL_SP_NUM_IN_VIR 2 #define BUTTON_PREV 0#define BUTTON_PLAY 1#define BUTTON_PAUSE 2#define BUTTON_STOP 3#define BUTTON_NEXT 4#define BUTTON_SPST_CTL 5#define BUTTON_AST_CTL 6#define BUTTON_AUDIO_LR BUTTON_AST_CTL#define BUTTON_ANGLE_CTL 7#define BUTTON_EXIT 8#define SEARCH_TITLE 0#define SEARCH_TRACK SEARCH_TITLE#define SEARCH_CHAPTER 1#define SEARCH_TIME 2#define BUTTON_GAP 8#ifndef SIMPLE_SEARCH_UI#define SRCH_FRAME_X0 25#define SRCH_FRAME_Y0 40 #define SRCH_FRAME_X1 375#define SRCH_FRAME_Y1 SRCH_FRAME_Y0+52#define SRCH_SEPARATOR_WIDTH 2*BUTTON_GAP#define SRCH_BUTTON_WIDTH 5*BUTTON_GAP//Search Title/Track Button#define BUTTON_T_X0 (SRCH_FRAME_X0 + BUTTON_GAP + 15)#define BUTTON_T_Y0 (SRCH_FRAME_Y0 + BUTTON_GAP + 5)#define BUTTON_T_X1 (BUTTON_T_X0 + SRCH_BUTTON_WIDTH + 5)#define BUTTON_T_Y1 (SRCH_FRAME_Y1 - BUTTON_GAP)//Search Chapter Button#define BUTTON_C_X0 (BUTTON_T_X1 + 2*SRCH_BUTTON_WIDTH + 3*BUTTON_GAP + 15)#define BUTTON_C_Y0 BUTTON_T_Y0#define BUTTON_C_X1 (BUTTON_C_X0 + SRCH_BUTTON_WIDTH + 5)#define BUTTON_C_Y1 BUTTON_T_Y1#define SOLIDUS_T_X (BUTTON_T_X1+BUTTON_GAP*2+40)#define SOLIDUS_C_X (BUTTON_C_X1+BUTTON_GAP*2+40)#else // #ifndef SIMPLE_SEARCH_UI#define SRCH_FRAME_X0 25#define SRCH_FRAME_Y0 OSDDSPLY_LD_START_V#define SRCH_FRAME_X1 (352 + SRCH_FRAME_X0)#define SRCH_FRAME_Y1 (SRCH_FRAME_Y0+26)#define SRCH_SEPARATOR_WIDTH BUTTON_GAP#define SRCH_BUTTON_WIDTH (4*BUTTON_GAP)//Search Title/Track Button#define BUTTON_T_X0 (SRCH_FRAME_X0 + BUTTON_GAP*3) #define BUTTON_T_Y0 SRCH_FRAME_Y0#define BUTTON_T_X1 (BUTTON_T_X0 + SRCH_BUTTON_WIDTH + 20)#define BUTTON_T_Y1 SRCH_FRAME_Y1//Search Chapter Button#define BUTTON_C_X0 (BUTTON_T_X1 + 2*SRCH_BUTTON_WIDTH + BUTTON_GAP + 15)#define BUTTON_C_Y0 BUTTON_T_Y0#define BUTTON_C_X1 (BUTTON_C_X0 + SRCH_BUTTON_WIDTH + 20)#define BUTTON_C_Y1 BUTTON_T_Y1#define SOLIDUS_T_X (BUTTON_T_X1+BUTTON_GAP+20)#define SOLIDUS_C_X (BUTTON_C_X1+BUTTON_GAP+20)#endif//Search Time Button#define BUTTON_E_X0 BUTTON_C_X0#define BUTTON_E_Y0 BUTTON_C_Y0#define BUTTON_E_X1 BUTTON_C_X1#define BUTTON_E_Y1 BUTTON_C_Y1//Kevin1.07, VCD/CDDA time postion for absolute gototime#define BUTTON_EABS_X0 BUTTON_T_X0#define BUTTON_EABS_Y0 BUTTON_T_Y0#define BUTTON_EABS_X1 BUTTON_T_X1#define BUTTON_EABS_Y1 BUTTON_T_Y1 typedef struct{ WORD wX0; WORD wY0; WORD wX1; WORD wY1; WORD *wpOSDVIRFONT;} BUTTON_INFO;BUTTON_INFO aSRCHButton[TOTAL_BUTTON_NUM_IN_SRCH] ={ {BUTTON_T_X0, BUTTON_T_Y0, BUTTON_T_X1, BUTTON_T_Y1, aTitleIcon}, {BUTTON_C_X0, BUTTON_C_Y0, BUTTON_C_X1, BUTTON_C_Y1, aChapterIcon}, {BUTTON_E_X0, BUTTON_E_Y0, BUTTON_E_X1, BUTTON_E_Y1, aTimeIcon}, {BUTTON_EABS_X0, BUTTON_EABS_Y0, BUTTON_EABS_X1, BUTTON_EABS_Y1, aTimeIcon}}; /***********************************/// Variable/***********************************/PARM_FRAME _OSDSRCHFrame;PARM_DRAW_STRING _OSDSRCHStringAttr;PARM_RECT _OSDSRCHGRect;WORD _wOSDSRCHString[GDI_STRING_LENGTH+1];/***********************************/// Function/***********************************/ static BYTE _OSDSRCH_SearchKey(BYTE bKey);static void _OSDSRCH_InitializeGDI(void);static void _OSDSRCH_Process_KeyNumber ( WORD wValue );static void _OSDSRCH_ConfirmAction(WORD wValue);void _OSDSRCH_ShowButton(BYTE bButtonIndex); //CoCo1.20, reduce code size.static void _OSDSRCH_ShowSrchFrame(void);static void _ShowOneEntry(BYTE bColor); //rename later//static void _ShowOneEntryNumber(BYTE bSize, BYTE bNumber);static void _ShowOneEntryNumber(BYTE bSize, WORD wNumber);#ifndef NO_DISC_MODE //CoCo2.37pstatic void _OSDSRCH_ShowTwoEntry(BYTE bColor1 , BYTE bColor2); // #endif //#ifndef NO_DISC_MODE //CoCo2.37pstatic void _OSDSRCH_ClearOSDRegion(void); //CoCo0.76void _OSDSRCH_DrawFrame(WORD wLeft, WORD wTop, WORD wRight, WORD wBottom); //CoCo1.20, reduce code size.void _OSDSRCH_DrawString(void); //CoCo1.20, reduce code size.static void _OSDSRCH_Exit(void);extern void _InitRect(PURECT pRect, WORD wLeft, WORD wTop, WORD wRight, WORD wBottom); //CoCo1.20, reduce code size.//alex080,20041231,void _OSDSRCH_Entry_Initial(void);#ifndef NO_DISC_MODE //CoCo2.37pvoid _OSDSRCH_Entry_TitleChapter(void);void _OSDSRCH_Entry_TitleTime(void);#endif //#ifndef NO_DISC_MODE //CoCo2.37pvoid _OSDSRCH_Entry_PureTime(void);void _OSDSRCH_SetCommonFrameAttr(void);WORD __wMaxNumber;WORD _wPreValue;DWORD __dwTimeNumber;extern WORD code aDigit[];//Global variables extern BYTE __bGoToTimeNO; //current pos extern BYTE __bSearchCursor; // *************************************************************************// Function : _OSDSRCH_ShowTwoEntry// Description : Show twoe Entry Number in either SEARCH_TITLE, SEARCH_CHAPTER, or SEARCH_TIME field. a Button in the VIR Frame// Arguments : // bColor: First Color in Title// bColor: Second Color in Chapter// Return : None// Side Effect : None// *************************************************************************#ifndef NO_DISC_MODE //CoCo2.37pstatic void _OSDSRCH_ShowTwoEntry(BYTE bColor1 , BYTE bColor2){ if (__bSearchCursor == SEARCH_CURSOR_TITLE) { __bSearchCursor = SEARCH_CURSOR_CHAPTER; _ShowOneEntry(bColor1); __bSearchCursor = SEARCH_CURSOR_TITLE; _ShowOneEntry(bColor2); } else if (__bSearchCursor == SEARCH_CURSOR_CHAPTER) { __bSearchCursor = SEARCH_CURSOR_TITLE; _ShowOneEntry(bColor1); __bSearchCursor = SEARCH_CURSOR_CHAPTER; _ShowOneEntry(bColor2); } }#endif //#ifndef NO_DISC_MODE //CoCo2.37p// *************************************************************************// Function : _OSDSRCH_ShowButton// Description : Show a Button in the VIR Frame// Arguments : bButtonIndex: Button Index ( 0 ~ (TOTAL_BUTTON_NUM_IN_SRCH-1) )// bColor: Center Color & Text BG Color// Return : None// Side Effect : None// *************************************************************************void _OSDSRCH_ShowButton(BYTE bButtonIndex) //CoCo1.20, reduce code size.{ #ifdef ABSOLUTE_GOTOTIME //Kevin1.07, VCD/CDDA shows track# only for relative gototime only if ( !(__wDiscType & BOOK_DVD) ) bButtonIndex ++;#endif #ifndef SIMPLE_SEARCH_UI if (SETUP_CUSTOM_UI_STYLE_1 == __SetupInfo.bUIStyle) { _OSDSRCHFrame.bColorBright= OSDSRCH_ENTRY_COLOR_FRAME_BRIGHT; _OSDSRCHFrame.bColorCenter= OSDSRCH_ENTRY_COLOR_ICON_BG; _OSDSRCHFrame.bColorDark= OSDSRCH_ENTRY_COLOR_FRAME_DARK; _OSDSRCHFrame.bStyle= FRAME_POP_SOLID; _OSDSRCHFrame.bThickness = FRAME_THICKNESS; _OSDSRCH_DrawFrame(aSRCHButton[bButtonIndex].wX0, aSRCHButton[bButtonIndex].wY0, aSRCHButton[bButtonIndex].wX1, aSRCHButton[bButtonIndex].wY1); //CoCo1.20, reduce code size. _OSDSRCHStringAttr.wX = aSRCHButton[bButtonIndex].wX0+8; } else if (SETUP_CUSTOM_UI_STYLE_2 == __SetupInfo.bUIStyle) { _OSDSRCHGRect.bColor = OSDSRCH_ENTRY_COLOR_ICON_BG; _InitRect(&(_OSDSRCHGRect.rect), //CoCo1.20, reduce code size. aSRCHButton[bButtonIndex].wX0, aSRCHButton[bButtonIndex].wY0, aSRCHButton[bButtonIndex].wX1 + 12, aSRCHButton[bButtonIndex].wY1); GDI_FillRoundRect(0, 17, &_OSDSRCHGRect); _OSDSRCHStringAttr.wX = aSRCHButton[bButtonIndex].wX0+13; } else if (SETUP_CUSTOM_UI_STYLE_3 == __SetupInfo.bUIStyle) { _OSDSRCHGRect.bColor = OSDSRCH_ENTRY_COLOR_ICON_BG; _InitRect(&(_OSDSRCHGRect.rect), //CoCo1.20, reduce code size. aSRCHButton[bButtonIndex].wX0, aSRCHButton[bButtonIndex].wY0, aSRCHButton[bButtonIndex].wX1 + 12, aSRCHButton[bButtonIndex].wY1); GDI_FillRoundRect(0, 13, &_OSDSRCHGRect); _OSDSRCHStringAttr.wX = aSRCHButton[bButtonIndex].wX0+13; } else if (SETUP_CUSTOM_UI_STYLE_4 == __SetupInfo.bUIStyle) { _OSDSRCHFrame.bColorBright= OSDSRCH_ENTRY_COLOR_FRAME_DARK; _OSDSRCHFrame.bColorCenter= OSDSRCH_ENTRY_COLOR_ICON_BG; _OSDSRCHFrame.bColorDark= OSDSRCH_ENTRY_COLOR_FRAME_BRIGHT; _OSDSRCHFrame.bStyle= FRAME_POP_SOLID; _OSDSRCHFrame.bThickness = FRAME_THICKNESS; _OSDSRCH_DrawFrame(aSRCHButton[bButtonIndex].wX0, aSRCHButton[bButtonIndex].wY0, aSRCHButton[bButtonIndex].wX1, aSRCHButton[bButtonIndex].wY1); //CoCo1.20, reduce code size. _OSDSRCHStringAttr.wX = aSRCHButton[bButtonIndex].wX0+8; } _OSDSRCHStringAttr.wY = aSRCHButton[bButtonIndex].wY0 + 3;#else _OSDSRCHStringAttr.wX = aSRCHButton[bButtonIndex].wX0+8; _OSDSRCHStringAttr.wY = aSRCHButton[bButtonIndex].wY0;#endif _OSDSRCHStringAttr.bTextColor = OSDSRCH_ENTRY_COLOR_ICON_FG; _OSDSRCHStringAttr.bBackground = OSDSRCH_ENTRY_COLOR_ICON_BG; _OSDSRCHStringAttr.bColorKey = 0; _OSDSRCHStringAttr.bShadow1 = PAL_ENTRY_COLOR_TRANSPARENT; _OSDSRCHStringAttr.bShadow2 = PAL_ENTRY_COLOR_TRANSPARENT; GDI_DrawString_909(0, &_OSDSRCHStringAttr, aSRCHButton[bButtonIndex].wpOSDVIRFONT ); } //end of _OSDSRCH_ShowButton()// *************************************************************************// Function : _OSDSRCH_ShowSrchFrame // Description : Show the search frame // Arguments : // Return : None// Side Effect : None// *************************************************************************static void _OSDSRCH_ShowSrchFrame(void){ _OSDSRCHGRect.bColor = OSDSRCH_ENTRY_COLOR_FRAME_CENTER;#ifndef SIMPLE_SEARCH_UI if (SETUP_CUSTOM_UI_STYLE_1 == __SetupInfo.bUIStyle) { _OSDSRCH_SetCommonFrameAttr(); //CoCo1.20, reduce code size. _OSDSRCH_DrawFrame(SRCH_FRAME_X0, SRCH_FRAME_Y0, //CoCo1.20, reduce code size. SRCH_FRAME_X1, SRCH_FRAME_Y1); } else if (SETUP_CUSTOM_UI_STYLE_2 == __SetupInfo.bUIStyle) { _InitRect(&(_OSDSRCHGRect.rect), SRCH_FRAME_X0, SRCH_FRAME_Y0, //CoCo1.20, reduce code size. SRCH_FRAME_X1, SRCH_FRAME_Y1); GDI_FillRoundRect(0, 25, &_OSDSRCHGRect); } else if (SETUP_CUSTOM_UI_STYLE_3 == __SetupInfo.bUIStyle) { _InitRect(&(_OSDSRCHGRect.rect), SRCH_FRAME_X0, SRCH_FRAME_Y0, //CoCo1.20, reduce code size. SRCH_FRAME_X1, SRCH_FRAME_Y1); GDI_FillRoundRect(0, 15, &_OSDSRCHGRect); } else if (SETUP_CUSTOM_UI_STYLE_4 == __SetupInfo.bUIStyle) { _OSDSRCH_SetCommonFrameAttr(); //CoCo1.20, reduce code size. _OSDSRCH_DrawFrame(SRCH_FRAME_X0, SRCH_FRAME_Y0, //CoCo1.20, reduce code size. SRCH_FRAME_X1, SRCH_FRAME_Y1); }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -