prog_mp3undir.c
上传用户:caisangzi8
上传日期:2013-10-25
资源大小:15756k
文件大小:19k
- /*****************************************************
- Creater: Terry
- Date : 2001/5/14 05:30PM
- Description: Program menu using
- *****************************************************/
- //#define MONE_PROG
- #ifdef SUPPORT_OSDID3//suqiaoli add 2004-3-26
- extern void osd_init_OSDID3(void);
- extern void show_id3(void);
- #endif
- #ifdef SUPPORT_MP4_SUBTITLE // David 2004-5-12
- extern void osd_init_OSDSRT(void);
- extern BYTE GetCurrentFileType(void);
- #endif
- #ifdef OSD_BMP_PROG
- //Note:some data about OSD_BMP_PROG,moved to prog_bmp.c
- //suqiaoli 2004-11-23
- #include "prog_bmp.c"
- extern void ShowBmpProgSel(UINT8 mode);
- extern void ShowBmpProgPage(void);
- #endif
- #ifdef SETUP_PROGRAM_IN_PLACE_UNDER_16M
- #ifdef NEW_STYLE_SETUP
- static inline void ProgOffForNewStyleSetup()
- { // 2004/11/26 yltseng
- #ifdef SDRAM_16Mb_Mode
-
- #include "memmap0.h"
- #include "navdata.h"
-
- regs0->osd_base_addr=regs0->osdya;
- osd_init();
- if( (prog_state == 2)||(prog_state == 6))
- {
- if ((cd_type_loaded == CDROM) && (pFsJpeg->gifsFuncBtn == 2))
- {
- prog_state=255;
- ircmd_post_func(CMD_FUNC | CMD_FUNC_PLAY);
- }
- else
- {
- if ((prog_state != 6)&& (prog_state != 3))
- ircmd_resume();
- prog_state=0;
- }
- OSD1000ISP_STATUS(OSDISP_PROG_CNL, OSDIR_PROGRAM);
- psprintf(RegionValStr[REGION1], "");
- PrintOsdMsg(STR_OS_SPACE, REGION1, 1, 1);
- }
-
- #else
-
- if( (old_play_state==VCD_STATE_NORMAL)&&(play_state==VCD_STATE_PAUSE) ) // add by shawn 20020218
- ircmd_play();
- #ifdef MP3_STOP_IN_GUI_START//zhaoyanhua add 03-10-14 11:39 keep inital state for MP3
- else if((Is_MP3_STATE()) && (old_play_state == VCD_STATE_MP3_FILELIST))
- {
- play_state = old_play_state;
- }
- #endif
-
- #endif
- }
- #else
- static inline void ProgOffForNormal()
- { // 2004/11/26 yltseng
- #ifdef SDRAM_16Mb_Mode
- osd_disable();
-
- extern UINT8 g_uiOSDStatus; // 2005/01/14 yltseng
- g_uiOSDStatus = OSD_FULL_SCREEN_STATUS_NONE;
- regs0->osd_base_addr=regs0->osdya;
- #ifdef JPEG_PAUSE_WHEN_SETUP // 2004/12/30 yltseng
- if( Is_JPEG_SlideMode() )
- {
- play_state = VCD_STATE_NORMAL;
- PrintOsdMsg( STR_OS_SEQUENCE, REGION1, 1, 0 );
- }
- #endif
- #endif
-
- if( (old_play_state==VCD_STATE_NORMAL)&&(play_state==VCD_STATE_PAUSE) ) // add by shawn 20020218
- ircmd_play();
- #ifdef MP3_STOP_IN_GUI_START//zhaoyanhua add 03-10-14 11:39 keep inital state for MP3
- else if((Is_MP3_STATE()) && (old_play_state == VCD_STATE_MP3_FILELIST))
- {
- play_state = old_play_state;
- }
- #endif
- }
- #endif
- void prog_func_off()
- {
- if(prog_cnt==0) //uncomplete program no
- {
- ircmd_cancel(1);//terry 1011
- }
- #ifdef CD_PLAYER //liweihua add 2003-9-11
- if(cd_type_loaded == CDDA)
- osd_init_cdplayer();
- else
- osd_init();
- #else
- osd_init();
- #endif
- full_scrn = 0;
- // 2004/11/26 yltseng
- #ifdef NEW_STYLE_SETUP //zhaoyanhua add 2003-8-26 19:03
- ProgOffForNewStyleSetup();
- #else
- ProgOffForNormal();
- #endif
- #ifdef SUPPORT_OSDID3//liweihua add 2004-1-13
- if(Is_MP3_STATE()&& (play_state != VCD_STATE_STOP))
- {
- osd_init_OSDID3();
- show_id3();
- }
- #endif
- #ifdef SUPPORT_MP4_SUBTITLE // David 2004-5-12
- if (GetCurrentFileType() == CDROM_MP4)
- {
- osd_init_OSDSRT();
- }
- #endif
- }
- #else // SETUP_PROGRAM_IN_PLACE_UNDER_16M
- void prog_func_off()
- {
- #ifdef CD_PLAYER //liweihua add 2003-9-11
- if(cd_type_loaded == CDDA)
- osd_init_cdplayer();
- else
- osd_init();
- #else
- osd_init();
- #endif
- if(prog_cnt==0) //uncomplete program no
- {
- ircmd_cancel(1);//terry 1011
- }
-
- full_scrn = 0;
- #ifdef SDRAM_16Mb_Mode
- {
- #include "memmap0.h"
- #include "navdata.h"
-
- regs0->osd_base_addr=regs0->osdya;
- osd_init();
-
- #ifdef NEW_STYLE_SETUP //zhaoyanhua add 2003-8-26 19:03
- if( (prog_state == 2)||(prog_state == 6))
- #else
- if (prog_state==2)
- #endif//#ifdef NEW_STYLE_SETUP //zhaoyanhua add 2003-8-26 19:03
- {
- if ((cd_type_loaded == CDROM) && (pFsJpeg->gifsFuncBtn == 2))
- {
- prog_state=255;
- ircmd_post_func(CMD_FUNC | CMD_FUNC_PLAY);
- }
- else
- {
- #ifdef NEW_STYLE_SETUP//zhaoyanhua add 2003-8-26 19:02
- if ((prog_state != 6)&& (prog_state != 3))
- ircmd_resume();
- prog_state=0;
- #else
- prog_state=0;
- ircmd_resume();
- #endif//end NEW_STYLE_SETUP
- }
- OSD1000ISP_STATUS(OSDISP_PROG_CNL, OSDIR_PROGRAM);
- psprintf(RegionValStr[REGION1], "");
- PrintOsdMsg(STR_OS_SPACE, REGION1, 1, 1);
- }
- }
- #else
- {
- if( (old_play_state==VCD_STATE_NORMAL)&&(play_state==VCD_STATE_PAUSE) ) // add by shawn 20020218
- ircmd_play();
- #ifdef MP3_STOP_IN_GUI_START//zhaoyanhua add 03-10-14 11:39 keep inital state for MP3
- else if((Is_MP3_STATE()) && (old_play_state == VCD_STATE_MP3_FILELIST))
- {
- play_state = old_play_state;
- }
- #endif
- }
- #endif
- #ifdef SUPPORT_OSDID3//liweihua add 2004-1-13
- if(Is_MP3_STATE()&& (play_state != VCD_STATE_STOP))
- {
- osd_init_OSDID3();
- show_id3();
- }
- #endif
- #ifdef SUPPORT_MP4_SUBTITLE // David 2004-5-12
- if (GetCurrentFileType() == CDROM_MP4)
- {
- osd_init_OSDSRT();
- }
- #endif
- }
- #endif // SETUP_PROGRAM_IN_PLACE_UNDER_16M
- void prog_func_clear(void)
- {
- UINT8 i;
- for(i=0;i<=SHOW_PROG_NO;i++)
- {
- prog[i][0]=0;
- prog[i][1]=0;
- }
- index_y=2;
- index_x=0;
-
- prog_cnt = 0;
- #ifdef OSD_BMP_PROG
- flag_data = 0;
- #endif
-
- }
- int is_clear_pos(void)//2002-4-19 1:53
- {
- int ret=0;
- if(prog_item[page][index_y][0]==SET_FUNC)
- {
- #ifndef PROG_12_ITEMS //Jeff 20020925
- if(prog_item[page][index_y][index_x/2+1]==STR_OS_CLEAR)
- #else
- if(prog_item[page][index_y][index_x/2+2]==STR_OS_CLEAR)
- #endif
- {
- ret=1;
- }
- }
- return ret;
- }
- void prog_func_select(void)
- {
- if(prog_item[page][index_y][0] == SET_FUNC)
- {
- #ifdef PROG_12_ITEMS
- if (prog_item[page][index_y][index_x / 2 + 2] == STR_OS_CLEAR)
- {
- prog_func_clear();
- ShowProgPage();
- }
- else if (prog_item[page][index_y][index_x / 2 + 2] == STR_OS_PLAY)
- ircmd_play();
- #else
- if (prog_item[page][index_y][index_x / 2 + 1] == STR_OS_CLEAR)
- {
- OSD1000ISP_STATUS(OSDISP_PROG_CLEAR, OSDIR_PROGRAM);
- prog_func_clear();
- ShowProgPage();
- }
- else if (prog_item[page][index_y][index_x / 2 + 1] == STR_OS_PLAY)
- ircmd_play();
- #endif
- }
- }
- void prog_func_play(void)
- {
- UINT8 i;
- #ifdef MONE_PROG
- printf("prog_func_play, inn");
- #endif
-
- prog_cnt=0;
-
- for(i=0;i<SHOW_PROG_NO;i++)
- {
- //if (offset == 3) { //Jeff 20010808
- if (cd_type_loaded == CDROM) { //Jeff 20010914
- BYTE iPage = prog[i][0];
- BYTE iItem = prog[i][1];
-
- if ( iPage && iItem && FSChkProg(iPage, iItem) )
- {
- #ifdef MONE_PROG
- printf("i:%d Page:%d Item:%d sucessn", i, prog[i][0], prog[i][1]);
- #endif
- prog_cnt++;
- prog[prog_cnt][0]=prog[i][0];
- prog[prog_cnt][1]=prog[i][1];
- }
- else
- {
- #ifdef MONE_PROG
- printf("i:%d Page:%d Item:%d failn", i, prog[i][0], prog[i][1]);
- #endif
- }
-
- if (i > prog_cnt)
- {
- prog[i][0]=0;
- prog[i][1]=0;
- }
- }
- else //if (cd_type_loaded == CDROM)
- if(offset==2)
- {
- //printf("i:%x prog[i][0]:%xn",i,prog[i][0]);
- // if( (prog[i][0]>=cd_trk_lo)&&(prog[i][0]<=show_trk_num(cd_trk_hi)) )
- if ((prog[i][0] >= 1) && (prog[i][0] <= show_trk_num(cd_trk_hi))) // robert 030512 for some case cd_trk_lo = 2
- {
- prog_cnt++;
- prog[prog_cnt][0]=prog[i][0];
- //printf("prog_cnt:%xn",prog_cnt);
- }
-
- if(i>prog_cnt)
- prog[i][0]=0;
- }
- else //if(offset==2)
- {//dvd ,reference ChkPTTRange
- UINT8 tt=prog[i][0];
- UINT16 ptt=prog[i][1];
-
- #ifdef DVD_AUDIO
- UINT8 (*ChkRange)(UINT8*, UINT16*);
- if (dAMG_LSN) // alan, 2002/11/8 11:40