📄 periphgui.c
字号:
osd_init();
//if you want not interrupt current play,you can use the followed method//dingzhy
//psprintf(RegionValStr[REGION1], "USB/CARD NOT FOUND");
//PrintOsdMsg(STR_OS_SPACE, REGION1, 1, 1);
}
else
{
Set_MediaSwitch_Button();
level=1;
input_flag=0;
xoffset=0;
CopyID=0;
InfoGui_flag=0;
if(detect_type&USB_DEVICE)
SwitchID=BUTTON_UDISK;
#ifdef CARD_SETUP_TYPE_3
else if(detect_type&CF_CARD_DEVICE)
SwitchID=BUTTON_CF;
#endif
highlight_button(SwitchID);
}
}
#endif
/***************************************************************************
* Function Name: show_switch *
* Purposes: show the function switch menu *
* Arguments: Select_Media *
* Returns: none *
* Update: sunzhh 2004-11-10 *
**************************************************************************/
void show_switch(BYTE Select_Media)
{
BYTE i;
BYTE Select_Media;
if(Switch_flag==0)
{
if(detect_type==USB_DEVICE)
Select_Media=Media_UDISK;
else if(detect_type==CF_CARD_DEVICE)
Select_Media=Media_CF;
else if(detect_type==SD_CARD_DEVICE)
Select_Media=Media_SD;
else if(detect_type==MS_CARD_DEVICE)
Select_Media=Media_MS;
else if(detect_type==SMC_CARD_DEVICE)
Select_Media=Media_SMC;
}
if(Select_Media==Media_UDISK)
{
string[1]="CDROM TO UDISK";
string[2]="UDISK TO CDROM";
}
else if(Select_Media==Media_CF)
{
string[1]="CDROM TO CF";
string[2]="CF TO CDROM";
string[5]="FORMAT CF";
}
else if(Select_Media==Media_SD)
{
string[1]="CDROM TO SD/MMC";
string[2]="SD/MMC TO CDROM";
string[5]="FORMAT SD/MMC";
}
else if(Select_Media==Media_MS)
{
string[1]="CDROM TO MS/MS PRO";
string[2]="MS/MS PRO TO CDROM";
string[5]="FORMAT MS/MS";
}
else if(Select_Media==Media_SMC)
{
string[1]="CDROM TO SMC";
string[2]="SMC TO CDROM";
string[5]="FORMAT SMC";
}
osd_init_periphGUI();
osd_draw_region_rect(0, 0, 64*8, 40, COLOR_GREEN, 3);
osd_draw_region_rect(0, 278, 64*8, 10, COLOR_GREEN, 3);
BYTE *title_str="USER OPERATIONS";
if(storage_type==0)
{
osd_DrawRegionString(8, 1, string[NO_PERIPHRAL], COLOR_DBLUE, COLOR_LBLUE, MESSAGE_REGION); //draw string on button
delay_1ms(2000);
full_scrn &= (~PERIPHERAL);//for release the IR
osd_init();
//if you want not interrupt current play,you can use the followed method//dingzhy
//psprintf(RegionValStr[REGION1], "USB/CARD NOT FOUND");
//PrintOsdMsg(STR_OS_SPACE, REGION1, 1, 1);
}
else
{
osd_DrawRegionString(8, 1, title_str, COLOR_YELLOW, COLOR_GREEN, FUNCTION_REGION); //draw the note
SetOsdCol(FUNCTION_REGION, FUNCTION_REGION, 0,__palette4F(192,192, 192, 0xe0)); //draw background of the region
Set_Button();
level=1;
input_flag=0;
xoffset=0;
CopyID=0;
Switch_flag=0;
InfoGui_flag=0;
if(media_type==MEDIA_CARD)
KeyID=BUTTON_P2CD;
else if(media_type==MEDIA_CD)
KeyID=BUTTON_CD2P;
highlight_button(KeyID);
for(i=0;i<8;i++)
getstring[i]=32;//initialize the getstring for rename,every element is space
}
}
/***************************************************************************
* Function Name: show_CapacityInfo *
* Purposes: *
* show the capacity infomation if the "CapacityInfo" button is select *
* Arguments: none *
* Returns: none *
* Create: sunzhh 2004-11-10 *
**************************************************************************/
void show_CapacityInfo(void)
{
#ifdef SPHE8202_ALL_TYPE_CARD_WRITE
card_browse_sign = 0; //dingzhy add for not into CardSetBrowse
#endif
InfoGui_flag=1;
StorageGetCapacityInfo();
osd_init_MediaswitchGUI();
BYTE *title_str="CAPACITY INFO";
osd_draw_region_rect(0, 0, 64*4, 40, COLOR_GREEN, 3);
osd_DrawRegionString(2, 1, title_str, COLOR_YELLOW, COLOR_GREEN, FUNCTION_REGION);
SetOsdCol(FUNCTION_REGION, FUNCTION_REGION, 0,__palette4F(192,192, 192, 0xe0)); //draw background of the region
osd_DrawRegionString(2, 1, title_str, COLOR_YELLOW, COLOR_GREEN, FUNCTION_REGION);
psprintf(linebuf, "TOTAL: %5dM", uiTotalCapacity);
osd_DrawRegionString(1,8+5,linebuf, COLOR_WHITE, COLOR_GRAYWHITE,3); //draw string on button
psprintf(linebuf, "USED: %6dM", uiUsedCapacity);
osd_DrawRegionString(1,2*8+5,linebuf, COLOR_WHITE, COLOR_GRAYWHITE,3); //draw string on button
psprintf(linebuf, "REMAIN: %4dM", uiRemainCapacity);
osd_DrawRegionString(1,3*8+5,linebuf, COLOR_WHITE, COLOR_GRAYWHITE,3); //draw string on button
}
/***************************************************************************
* Function Name: switch_left *
* Purposes: shift highlight using the left key on the switch menu *
* Arguments: none *
* Returns: none *
* Update: sunzhh 2004-11-10 *
**************************************************************************/
void switch_left()
{
if(InfoGui_flag==1)
{
invalid_key();
return;
}
if(input_flag==0)
{
if((level == 2))
{ level=1;
CopyID=0;
}
highlight_button_all(KeyID,CopyID);
}
#ifndef NEW_INPUT_MENU
else if(input_flag==1)
{
pressnum_flag=0;
if(xoffset==7)
{
if(getstring[xoffset]!=32)
{
getstring[xoffset]=32;
osd_DrawRegionString(14+xoffset, 1, " ", COLOR_DBLUE,COLOR_LBLUE, FUNCTION_REGION);
}
else
{
getstring[xoffset-1]=32;
osd_DrawRegionString(14+xoffset, 1, " ", COLOR_DBLUE,COLOR_GREEN, FUNCTION_REGION);
xoffset--;
osd_DrawRegionString(14+xoffset, 1, " ", COLOR_DBLUE,COLOR_LBLUE, FUNCTION_REGION);
}
}
else if((xoffset>0)&&(xoffset<7))
{
getstring[xoffset]=32;
getstring[xoffset-1]=32;
osd_DrawRegionString(14+xoffset, 1, " ", COLOR_DBLUE,COLOR_GREEN, FUNCTION_REGION);
xoffset--;
osd_DrawRegionString(14+xoffset, 1, " ", COLOR_DBLUE,COLOR_LBLUE, FUNCTION_REGION);
}
else if(xoffset==0)
{
getstring[xoffset]=32;
// getstring[xoffset-1]=32;
osd_DrawRegionString(14+xoffset, 1, " ", COLOR_DBLUE,COLOR_GREEN, FUNCTION_REGION);
}
}
#endif
}
/***************************************************************************
* Function Name: switch_right *
* Purposes: shift highlight using the right key on the switch menu *
* Arguments: none *
* Returns: none *
* Update: sunzhh 2004-11-10 *
**************************************************************************/
void switch_right()
{
if(InfoGui_flag==1)
{
invalid_key();
return;
}
if(input_flag==0)
{
if((level == 1)&&(KeyID == BUTTON_COPY))
{
level=2;
CopyID=1;
}
highlight_button_all(KeyID,CopyID);
}
#ifndef NEW_INPUT_MENU
else if(input_flag==1)
{
if(xoffset<7)
{
getstring[xoffset]=32;//char " "
osd_DrawRegionString(14+xoffset, 1, " ", COLOR_DBLUE,COLOR_GREEN, FUNCTION_REGION);
xoffset++;
osd_DrawRegionString(14+xoffset, 1, " ", COLOR_DBLUE,COLOR_LBLUE, FUNCTION_REGION);
}
}
#endif
}
/***************************************************************************
* Function Name: switch_down *
* Purposes: shift highlight using the down key on the switch menu *
* Arguments: none *
* Returns: none *
* Update: sunzhh 2004-11-10 *
**************************************************************************/
void switch_down(void)
{
if(InfoGui_flag==1)
{
invalid_key();
return;
}
if(Switch_flag==1)
{
#ifdef CARD_SETUP_TYPE_4
if(SwitchID==BUTTON_UDISK)
{
if(detect_type & SD_CARD_DEVICE)
SwitchID=BUTTON_SD;
else if(detect_type & MS_CARD_DEVICE)
SwitchID=BUTTON_MS;
}
else
SwitchID=BUTTON_UDISK ;
#elif defined(CARD_SETUP_TYPE_3)
if(detect_type&USB_DEVICE)
{
if(SwitchID==BUTTON_UDISK)
{
if(detect_type & CF_CARD_DEVICE)
SwitchID=BUTTON_CF;
else if(detect_type & SD_CARD_DEVICE)
SwitchID=BUTTON_SD;
else if(detect_type & MS_CARD_DEVICE)
SwitchID=BUTTON_MS;
else if(detect_type & SMC_CARD_DEVICE)
SwitchID=BUTTON_SMC;
}
else
SwitchID=BUTTON_UDISK ;
}
else if((detect_type & CF_CARD_DEVICE)&&!(detect_type&USB_DEVICE))
{
if(SwitchID==BUTTON_CF)
{
if(detect_type & SD_CARD_DEVICE)
SwitchID=BUTTON_SD;
else if(detect_type & MS_CARD_DEVICE)
SwitchID=BUTTON_MS;
else if(detect_type & SMC_CARD_DEVICE)
SwitchID=BUTTON_SMC;
}
else
SwitchID=BUTTON_CF ;
}
#endif
highlight_button(SwitchID);
}
else
{
if(input_flag==0)
{
if(media_type==MEDIA_CD)
{
if(level==1)
{
if(KeyID==BUTTON_COPY)
{
KeyID=BUTTON_CAPACITY;
CopyID=0;
}
else if(KeyID==BUTTON_CD2P)
KeyID=BUTTON_COPY;
else if(KeyID==BUTTON_CAPACITY)
KeyID=BUTTON_CD2P;
}
else if(level ==2)
{
if(CopyID>=COPY_NEWDIR)
CopyID=COPY_ROOTDIR;
else
CopyID++;
}
}
else
if(media_type==MEDIA_CARD)
{
if(KeyID>=BUTTON_CAPACITY)
{
KeyID=BUTTON_P2CD;
}
else
{
KeyID++;
}
if(KeyID==BUTTON_COPY)
{
KeyID=BUTTON_DELETE;
}
}
highlight_button_all(KeyID,CopyID);
}
}
}
/***************************************************************************
* Function Name: switch_up *
* Purposes: shift highlight using the up key on the switch menu *
* Arguments: none *
* Returns: none *
* Update: sunzhh 2004-11-10 *
**************************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -