📄 ircmd_switch_media.c
字号:
** Function Name : switch_media_down **
** Purposes : **
** Limitations : (none) **
** Arguments : (none) **
** Returns : (none) **
** See also : **
\****************************************************************************************/
void switch_media_down(void)
{
last_hl_item = hl_item;
if (hl_item < (SWGUI_MAX_ITEM - 1))
hl_item++;
else
hl_item = 0;
switch_media_show_HL();
}
/****************************************************************************************\
** Function Name : switch_media_select **
** Purposes : **
** Limitations : (none) **
** Arguments : (none) **
** Returns : (none) **
** See also : **
\****************************************************************************************/
void switch_media_select(void)
{
//Because this flow will execute the ircmd_play/ircmd_resume, so don't run it again on exit_switch_media_gui().
exit_switch_media_gui(NO_RESUME_AFTER_EXIT_SWITCH_MENU); //robert.chang, 2007-05-27
switch (hl_item)//media_status == hl_item
{
#ifndef NO_DVD_SERVO
case STATUS_DISC:
ircmd_key_disc();
break;
#endif//NO_DVD_SERVO
#ifdef SPHE8202_CARD_STORAGE
case STATUS_CARD:
ircmd_key_card();
break;
#endif//SPHE8202_CARD_STORAGE
#ifdef SUPPORT_USB
case STATUS_USB:
ircmd_key_usb();
break;
#endif//SUPPORT_USB
default:
break;
}
}
/****************************************************************************************\
** Function Name : switch_media_show_HL **
** Purposes : **
** Limitations : (none) **
** Arguments : (none) **
** Returns : (none) **
** See also : **
\****************************************************************************************/
void switch_media_show_HL(void)
{
coordinate string;
//clear last hl
string.x = 10 + 56;
string.y = 10 + last_hl_item*50 + 8;
osd_draw_region_rect(10, 10 + last_hl_item*50, 180, 40, SWGUI_MAIN_BG_COLOR, SWITCH_GUI_REGION);
osd_draw_string(&string, bMediaStr[last_hl_item], SWGUI_FONT_COLOR, SWGUI_MAIN_BG_COLOR, SWITCH_GUI_REGION, 0);
//mark current playing media item
string.x = 10 + 56;
string.y = 10 + media_status*50 + 8;
osd_draw_region_rect(10, 10 + media_status*50, 180, 40, SWGUI_MARK_BG_COLOR, SWITCH_GUI_REGION);
osd_draw_string(&string, bMediaStr[media_status], SWGUI_FONT_COLOR, SWGUI_MARK_BG_COLOR, SWITCH_GUI_REGION, 0);
//show current hl
string.x = 10 + 56;
string.y = 10 + hl_item*50 + 8;
osd_draw_region_rect(10, 10 + hl_item*50, 180, 40, SWGUI_HL_BG_COLOR, SWITCH_GUI_REGION);
osd_draw_string(&string, bMediaStr[hl_item], SWGUI_HL_FONT_COLOR, SWGUI_HL_BG_COLOR, SWITCH_GUI_REGION, 0);
}
/****************************************************************************************\
** Function Name : draw_switch_gui_background **
** Purposes : **
** Limitations : (none) **
** Arguments : (none) **
** Returns : (none) **
** See also : **
\****************************************************************************************/
void draw_switch_gui_background(void)
{
coordinate string;
int i = 0;
//draw main background
osd_fill_region(SWITCH_GUI_REGION, 15);//clear background color
osd_draw_region_rect(0, 0, 200, SWGUI_MAX_ITEM*40 + (SWGUI_MAX_ITEM + 1)*10, SWGUI_MAIN_BG_COLOR, SWITCH_GUI_REGION);
//draw items
for (i=0; i<SWGUI_MAX_ITEM; i++)
{
string.x = 10 + 56;
string.y = i*40 + (i + 1)*10 + 8;
osd_draw_string(&string, bMediaStr[i], SWGUI_FONT_COLOR, SWGUI_MAIN_BG_COLOR, SWITCH_GUI_REGION, 0);
}
osd_tog_region(SWITCH_GUI_REGION, OSD_ON);
}
/****************************************************************************************\
** Function Name : ircmd_source **
** Purposes : **
** Limitations : (none) **
** Arguments : (none) **
** Returns : (none) **
** See also : **
\****************************************************************************************/
void ircmd_source(void)
{
#ifdef SUPPORT_MIDI
if (gIsMidiSelMenu) //lptan add 2007-6-25 21:04
{
invalid_key();
return;
}
#endif
// limit the conditions for running the media switch, robert.chang, 2007-05-14
//kevinmonkey 070529 adding pause to it, so that we can pause before enter media switch menu.
if((play_state != VCD_STATE_NORMAL) && (play_state != VCD_STATE_OPEN) && (play_state != VCD_STATE_CLOSE) && (play_state != VCD_STATE_PAUSE)
&& (play_state != VCD_STATE_STOP) && (play_state != VCD_STATE_IDLE) && (play_state != VCD_STATE_MP3_FILELIST))
{
invalid_key();
return;
}
// When loading page, the play_state is VCD_STATE_MP3_FILELIST.So we add this condition to prevent loading file
// from being interrupted by media switch gui. robert.chang, 2007-05-27
else if((play_state == VCD_STATE_MP3_FILELIST) && (pFsJpeg->gifsFuncBtn == FS_STATE_INIT))
{
invalid_key();
return;
}
#ifdef ONE_KEY_NO_GUI_TOGGLE_SWITCHING
static int iToggle = 0;
full_scrn = SW_MEDIA;
t_disp = 0;
osd0_state = OSD0_STATE_INIT;
ClearOsdMsg(0);
osd_init();
if (iToggle == (SWGUI_MAX_ITEM - 1))
iToggle = 0;
else
iToggle++;
switch_2_des_media(iToggle);
#else//ONE_KEY_NO_GUI_TOGGLE_SWITCHING
//disable by robert.chang, 2007-05-14
/*
#ifdef SDRAM_16Mb_Mode
if (play_state == VCD_STATE_READTOC)
{
invalid_key();
return;
}
#endif//SDRAM_16Mb_Mode
*/
if (full_scrn & SW_MEDIA)//exit switch menu
{
exit_switch_media_gui(RESUME_AFTER_EXIT_SWITCH_MENU);
}
else//enter switch menu
{
#ifdef LARGE_OSD_SHOW_IN_LOGO
if (system_state != SYSTEM_STOP)
{
if ((play_state != VCD_STATE_CLOSE) && (play_state != VCD_STATE_STOP) && (play_state != VCD_STATE_IDLE) && (play_state != VCD_STATE_OPEN))
{
if ((prog_state == 0) || (prog_state == 7)) //When run the ircmd_stop(), the system maybe not stop.But prog_state=7,
{ //so run media_type invalidly next time.For solve this bug, we add (prog_state == 7). robert.chang, 2007-04-20.
prog_state = 7;
old_t_disp = t_disp;
ircmd_stop();
}
else
{
invalid_key();
}
return;
}
}
regs0->osd_base_addr = OSD_BASE_USE_ADDR;
#endif//LARGE_OSD_SHOW_IN_LOGO
#ifdef LARGE_OSD_USE_DSP_MEMORY
run_pause_setting();
osd_disable();
switch( InitializeOSDMenu(OSD_MENU_MEDIA_SWITCH_MENU) )
{
case FLOW_CTRL_INVALID_REQUEST:
invalid_key();return;
break;
default:
break;
}
#endif //#ifdef LARGE_OSD_USE_DSP_MEMORY
full_scrn = SW_MEDIA;
t_disp = 0;
osd0_state = OSD0_STATE_INIT;
ClearOsdMsg(0);
osd_init_media_switch_gui();
draw_switch_gui_background();
osd_tog_region(SWITCH_GUI_REGION, OSD_ON);
hl_item = media_status;
switch_media_show_HL();
SetFullscrnCmdFuncPtr(switch_media_up, switch_media_down, invalid_key, invalid_key, switch_media_select);
}
#endif//ONE_KEY_NO_GUI_TOGGLE_SWITCHING
}
/****************************************************************************************\
** Function Name : exit_switch_media_gui **
** Purposes : **
** Limitations : (none) **
** Arguments : (none) **
** Returns : (none) **
** See also : **
\****************************************************************************************/
extern int pause_n_fields();//zhongshan add.2007-5-28 11:55
extern UINT32 GetOSDBackUpAddress();
void exit_switch_media_gui(int iPlayResume)
{
full_scrn &= (~SW_MEDIA);
osd_tog_region(SWITCH_GUI_REGION, OSD_OFF);
osd_disable();
#ifdef LARGE_OSD_USE_DSP_MEMORY
//zxb 070625 the reset code in the funcion no need to run.
DestroyOSDMenu(OSD_MENU_MEDIA_SWITCH_MENU);
return;
#endif //#ifdef LARGE_OSD_USE_DSP_MEMORY
#ifdef LARGE_OSD_SHOW_IN_LOGO
prog_state = 0;
regs0->osd_base_addr = GetOSDBackUpAddress();
if((hl_item == media_status)||(full_scrn & SW_MEDIA)) //zhongshan move from ircmd_source add some status need resume 2007-4-28 12:02AM
{
if ((cd_type_loaded == CDROM) && (Is_MP3_STATE() == 0))
{
if(iPlayResume){ircmd_play();}
}
else if ((cd_type_loaded == CDDA) && (old_play_state != VCD_STATE_STOP))
{
prog_state = 0;
ShowTitle();
if(iPlayResume){ircmd_resume();}
}
else if ((old_play_state == VCD_STATE_STOP) || (system_state == SYSTEM_NODISC) || (system_state == SYSTEM_OPEN))
{
prog_state = 0;
ShowTitle();
}
else
{
if ((prog_state != 6)&&(iPlayResume))
ircmd_resume();
}
}
#endif//LARGE_OSD_SHOW_IN_LOGO
#ifdef LARGE_OSD_USE_DSP_MEMORY
if(iPlayResume)
{ ircmd_play();}
#endif //#ifdef LARGE_OSD_USE_DSP_MEMORY
osd_init();
#ifdef SUPPORT_MP4_SUBTITLE
if (IS_EXT_SUP_ACTIVATED())
osd_init_OSDSRT();
#endif//SUPPORT_MP4_SUBTITLE
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -