panelvfd.c

来自「一个两碟控制的VCD的代码,两碟之间的转动及连续播放,已大量生产的CODE.」· C语言 代码 · 共 1,575 行 · 第 1/3 页

C
1,575
字号
	    }
	    /* Output TV-output type message... */
	    OUTOSD(OSD_TV_STANDARD_REGION, msg, c_msg, EXTENDED_TIME_OUT);
#ifndef BF43
	} else  /* display_order == 2 */
#endif /* not BF43 */
    	{
	    /* Output audio-effects mode... */
	    OUTOSD(OSD_AUDFX_REGION, SPA_msg, SPA_msg, DISPLAY_TIME_OUT);
	    
	    /* Output vocal and audio modes */
	    show_audio_panel(1);
	}
#endif /* FOUR_LINE_OSD */
    } else {
	CLEARALLOSD();
    }
}

/*===========================================================================*/
void panel_sequence_mode(int mode)
{
    static int previous_mode;
    unsigned char *msg_ptr;
#ifdef BILINGUAL_OSD
    unsigned char *c_msg_ptr;
#endif

    if (mode == SEQ_PBC_ON) {
	RepeatMode = REPEAT_OFF;
	DiscMode &= ~(DISC_PROGRAM | DISC_SHUFFLE
		      | DISC_CONTINUE);
	DiscMode |= DISC_PBC_ON;
	Indicator_2 = 0;
       #ifndef FU267
         #ifdef  FU_AIQING
             Indicator_3 &= ~SEG_CONTINUE;
             Indicator_3 |= ( SEG_AUX | SEG_PBC_OFF);
         #else
           #ifdef FU_KANGHUI30
               Indicator_5 |= SEG_S1;
               Indicator_5 &= ~SEG_S2;
               REFRESH_INDICATOR_5;
               Indicator_1 &= ~(SEG_VCD | SEG_MUSIC_CD);
               Indicator_1 = SEG_VIDEO;
               REFRESH_INDICATOR_1;
            #else
               #ifdef  KEBAO_REMOTE
                   Indicator_1 |= (SEG_VIDEO | SEG_VCD);
                   REFRESH_INDICATOR_1;
                   Indicator_3 |= SEG_PBC_OFF;
               #else
                   Indicator_3 |= SEG_PBC_OFF;
               #endif

            #endif
          #endif
      #else
               Indicator_3 &= ~SEG_PBC_OFF;
      #endif

	assign_osd_msg(msg_ptr, MSG_pbc_on, c_msg_ptr, MSG_c_pbc_on);
    } else if (mode == SEQ_CONTINUE) {
	DiscMode |= DISC_CONTINUE;
	DiscMode &= ~(DISC_PBC_ON | DISC_PROGRAM | DISC_SHUFFLE);
	Indicator_2 &= ~(SEG_PROGRAM | SEG_RANDOM);
       #ifndef FU267
           #ifdef  FU_AIQING
             Indicator_3 |= ( SEG_AUX | SEG_CONTINUE);
             Indicator_3 &= ~SEG_PBC_OFF;
           #else

             #ifdef FU_KANGHUI30
               Indicator_5 &= ~(SEG_S1 | SEG_S2);
               REFRESH_INDICATOR_5;
               Indicator_1 |= (SEG_VCD | SEG_MUSIC_CD);
               Indicator_1 &= ~SEG_VIDEO;
               REFRESH_INDICATOR_1;
               Indicator_3 &= ~(SEG_PBC_OFF | SEG_CONTINUE);
            #else
               #ifdef  KEBAO_REMOTE
                 Indicator_1 |=  SEG_VCD;
                 Indicator_1 &= ~SEG_VIDEO;
                 REFRESH_INDICATOR_1;
                 Indicator_3 &= ~(SEG_PBC_OFF | SEG_CONTINUE);
               #else
                 Indicator_3 &= ~(SEG_PBC_OFF | SEG_CONTINUE);
               #endif
            #endif
          #endif
       #else
           Indicator_3 |= SEG_PBC_OFF;
       #endif
           panel_running_time(0);
    } else if (mode == SEQ_3CONTINUE) {
	Indicator_2 |= (SEG_REPEAT | SEG_REP_ALL);
	Indicator_2 &= ~SEG_REP_1;
	REFRESH_INDICATOR_2;
	assign_osd_msg(msg_ptr, MSG_pbc_off, c_msg_ptr, MSG_c_pbc_off);
    }
    else if (mode == SEQ_PROGRAM) {
	DiscMode |= DISC_PROGRAM;
	DiscMode &= ~(DISC_PBC_ON | DISC_CONTINUE | DISC_SHUFFLE);
	disp_calendar(99);
	addMicroRing(PANEL_TRACK | 0);
	Indicator_2 |= SEG_PROGRAM;
	Indicator_2 &= ~SEG_RANDOM;
       #ifdef FU267
         Indicator_3 |= SEG_PBC_OFF;
       #else
           #ifdef  FU_AIQING
            Indicator_3 |= ( SEG_AUX | SEG_CONTINUE);
            Indicator_3 &= ~SEG_PBC_OFF;
           #else
            Indicator_3 &= ~(SEG_PBC_OFF | SEG_CONTINUE);
           #endif
       #endif
	show_panel_time(0);
	show_program_osd_number(0, 0, 1);
	disp_calendar(99);
    } else if (mode == SEQ_SHUFFLE) {
	DiscMode |= DISC_SHUFFLE;
	DiscMode &= ~(DISC_PBC_ON | DISC_CONTINUE | DISC_PROGRAM);
	Indicator_2 |= SEG_RANDOM;
	Indicator_2 &= ~SEG_PROGRAM;
        #ifndef FU267
           #ifdef  FU_AIQING
            Indicator_3 |= ( SEG_AUX | SEG_CONTINUE);
            Indicator_3 &= ~SEG_PBC_OFF;
           #else
            Indicator_3 &= ~(SEG_PBC_OFF | SEG_CONTINUE);
           #endif
        #else
          Indicator_3 |= SEG_PBC_OFF;
        #endif
	assign_osd_msg(msg_ptr, MSG_shuffle_on, c_msg_ptr, MSG_c_shuffle_on);
    }

    REFRESH_INDICATOR_2;
    REFRESH_INDICATOR_3;
    
    if (mode == SEQ_PROGRAM || mode == SEQ_CONTINUE) {
	if (previous_mode == SEQ_PBC_ON) {
	    assign_osd_msg(msg_ptr, MSG_pbc_off, c_msg_ptr, MSG_c_pbc_off);
	}
	else if (previous_mode == SEQ_SHUFFLE) {
	    assign_osd_msg(msg_ptr, MSG_shuffle_off, c_msg_ptr, 
			   MSG_c_shuffle_off);
	}
	else {
	    assign_osd_msg(msg_ptr, "", c_msg_ptr, "");
	}
    }
#ifdef FOUR_LINE_OSD
    OUTOSD(OSD_INPUT_MODE_REGION, msg_ptr, c_msg_ptr, QUICK_TIME_OUT);
#else
 #ifdef KANGHUI
       OUTOSD(2, msg_ptr, c_msg_ptr, QUICK_TIME_OUT);
 #else
       OUTOSD(OSD_PLAY_ORDER_REGION, msg_ptr, c_msg_ptr, QUICK_TIME_OUT);
 #endif

#endif /* FOUR_LINE_OSD */
    previous_mode = mode;
}

#ifdef THREE_CDS
void panel_disc_slot(int number)
{
    addMicroRing(PANEL_DISC_SLOT | number);
}
#endif

/*===========================================================================*/
void panel_scan_mode(int mode)
{
  /*  OSD_clear_all(); */

    if (mode == SCAN_INTRO)
      Indicator_4 |= SEG_INTRO;
    else /* SCAN_NORMAL, SCAN_CD_DIGEST, SCAN_TRACK_DIGEST */
      Indicator_4 &= ~SEG_INTRO;

#if 0
    if (mode == SCAN_NORMAL)
      Indicator_4 &= ~SEG_INTRO;
    else if (mode == SCAN_INTRO)
      Indicator_4 |= SEG_INTRO;
    else if (mode == SCAN_CD_DIGEST)
      Indicator_4 &= ~SEG_INTRO;
    else if (mode == SCAN_TRACK_DIGEST)
      Indicator_4 &= ~SEG_INTRO;
#endif

    REFRESH_INDICATOR_4;
}

/*===========================================================================*/
int panel_repeat_mode_change(void)
{
    unsigned char *msg, *c_msg;
    int mode;

    if (DiscMode & DISC_PBC_ON)
	RepeatMode = REPEAT_OFF;
    else {
	RepeatMode++;

#ifdef TWO_CDS
	if (RepeatMode > REPEAT_3ALL)
#else
	if (RepeatMode > REPEAT_ALL)          
#endif
	  RepeatMode = REPEAT_OFF;
    }

    if (RepeatMode == REPEAT_OFF) {
        assign_osd_msg(msg, MSG_repeat_off, c_msg, MSG_c_repeat_off);
     	Indicator_2 &= ~(SEG_REP_ALL | SEG_REP_1);
	if (!(Indicator_2 & (SEG_REP_A | SEG_REP_B)))
	  Indicator_2 &= ~SEG_REPEAT;
        REFRESH_INDICATOR_2;
        Indicator_3 &= ~SEG_CONTINUE;
        REFRESH_INDICATOR_3;
#ifdef TWO_CDS
   #ifdef  FU271
	Indicator_5 &= ~(SEG_DISC);
	REFRESH_INDICATOR_5;
   #endif
#endif        
    } else if (RepeatMode == REPEAT_ONE) {
	assign_osd_msg(msg, MSG_repeat_one, c_msg, MSG_c_repeat_one);
	Indicator_2 |= (SEG_REPEAT | SEG_REP_1);
        REFRESH_INDICATOR_2;
        Indicator_3 &= ~SEG_CONTINUE;
        REFRESH_INDICATOR_3;
#ifdef TWO_CDS
     #ifdef FU271
	Indicator_5 &= ~(SEG_DISC);
	REFRESH_INDICATOR_5;
     #endif
#endif        
    } else if (RepeatMode == REPEAT_ALL) {
        assign_osd_msg(msg, MSG_repeat_all, c_msg, MSG_c_repeat_all);
	Indicator_2 |= (SEG_REPEAT | SEG_REP_ALL);
	Indicator_2 &= ~SEG_REP_1;
	REFRESH_INDICATOR_2;
        Indicator_3 &= ~SEG_CONTINUE;
        REFRESH_INDICATOR_3;
#ifdef TWO_CDS
  #ifdef  FU271
	Indicator_5 &= ~(SEG_DISC);
	REFRESH_INDICATOR_5;
  #endif
#endif        
	


#ifdef TWO_CDS
    } else if (RepeatMode == REPEAT_3ALL) {
	Indicator_2 |= (SEG_REPEAT | SEG_REP_ALL);
	Indicator_2 &= ~SEG_REP_1;
	REFRESH_INDICATOR_2;
        Indicator_3 |= SEG_CONTINUE;
        REFRESH_INDICATOR_3;
      #ifdef  FU271
	Indicator_5 |= SEG_DISC;
	REFRESH_INDICATOR_5;
      #endif
        assign_osd_msg(msg, MSG_repeat_3all, c_msg, MSG_repeat_3all);
#endif

    }
    OUTOSD(OSD_REPEAT_REGION, msg, c_msg, QUICK_TIME_OUT);
    return (RepeatMode);
}




/*===========================================================================*/
void panel_play_track(int track_num)
{
    Indicator_4 |= SEG_TRACK;

#ifndef  FU_AIQING
    if (DiscMode & DISC_PBC_ON)
	disp_calendar(0);	/* show all calendar */
    else
	disp_calendar(cur_track_index);
#endif

    if (track_num) {
	addMicroRing(PANEL_TRACK | track_num);
	if (track_num <= MAX_CALENDAR)
	    addMicroRing(FLASH_CAL | track_num);
#ifndef FU267
        Indicator_4 &= ~SEG_HYPHEN;
#else
       Indicator_4 |= SEG_HYPHEN;
#endif
    }
    /* if track number is 0, we are in play segment. */
    else {
	show_panel_time(0);
	addMicroRing(PANEL_BLANK | BLANK_TRACK);
        Indicator_4 &= ~SEG_HYPHEN;
    }
    
    REFRESH_INDICATOR_4;
    TrackIndex = TRACK_LIST_INDEX;
    PlayTrack = track_num;
}


#ifndef FU271
void  panel_karaoke_off(int flag)
{
   Indicator_5 &= ~(SEG_KARAOKE1|SEG_KARAOKE2);
   if (flag == 1)
       Indicator_5 |= (SEG_KARAOKE1|SEG_KARAOKE2);
    else if (flag == 2)
     {
       Indicator_5 |= SEG_KARAOKE1;
       Indicator_5 &= ~SEG_KARAOKE2;
     }
    else if (flag == 3)
       {
       Indicator_5 |= SEG_KARAOKE2;
       Indicator_5 &= ~SEG_KARAOKE1;
      }
   else
       Indicator_5 &= ~(SEG_KARAOKE1|SEG_KARAOKE2);
      REFRESH_INDICATOR_5;
}
#endif

#ifdef FU_265
void  panel_resume_on()
{
    Indicator_5 |= SEG_RESUME;
    REFRESH_INDICATOR_5;
}
#endif

#if  0
void panel_resume_track_index(int track_index)
{
    disp_calendar(cur_track_index);
}
#endif


/*===========================================================================*/
void panel_total_track(int total_track_num)
{
    Indicator_4 |= SEG_TRACK;

    if ((TotalTrack = total_track_num) > MAX_CALENDAR) {
        Indicator_4 |= SEG_16_PLUS;
    } else {
        Indicator_4 &= ~SEG_16_PLUS;
    }

    REFRESH_INDICATOR_4;

    addMicroRing(PANEL_TRACK | total_track_num);
    addMicroRing(TOTAL_TRACK | total_track_num);    /* 10-10-96 Alger */
#ifndef  FU_AIQING
    disp_calendar(0);
#endif
}

/*===========================================================================*/
/* only program calls this function                                          */
void panel_track_select(int track_num, int flag)
{
    int tmp;

    if (flag <= 0) { /* invalid track: flag = -1 */
	show_program_osd_number(TOTAL_PROGRAM_TRACKS + 1, track_num, 
				(flag) ? 1 : 0);
    } else {
      #ifndef  FU_AIQING
	disp_calendar(0);
      #endif
	addMicroRing(PANEL_TRACK | TOTAL_PROGRAM_TRACKS);
	showProgramTime(-1);
	
	show_program_osd_number(TOTAL_PROGRAM_TRACKS, track_num, 1);
    }
}

/*===========================================================================*/
void panel_track_deselected(int track_num)
{
  #ifndef  FU_AIQING
	disp_calendar(0);
   #endif

    addMicroRing(PANEL_TRACK | TOTAL_PROGRAM_TRACKS);
    showProgramTime(-1);
    
    /* update OSD */
    show_program_osd_number(TOTAL_PROGRAM_TRACKS, 
			    (TOTAL_PROGRAM_TRACKS) ? 
			    track_list[TOTAL_PROGRAM_TRACKS - 1] : 0, 1);
}

/*===========================================================================*/
void panel_repeat_ab(int mode)
{
    int timeout;
    unsigned char *msg_ptr;
#ifdef BILINGUAL_OSD
     unsigned char *c_msg_ptr;
#endif

    timeout = 0; /* Leave message on */

    if (mode == REPEAT_AB_OFF) {
	assign_osd_msg(msg_ptr, MSG_clearA2B, c_msg_ptr, MSG_c_clearA2B);
	timeout = QUICK_TIME_OUT; /* Clear msg after 1sec */

	if (RepeatMode == REPEAT_OFF)
	  Indicator_2 &= ~(SEG_REP_A | SEG_REP_B | SEG_REPEAT);
	else
	  Indicator_2 &= ~(SEG_REP_A | SEG_REP_B);
    } else if (mode == REPEAT_AB_START) {
	Indicator_2 |= SEG_REP_A | SEG_REPEAT;
	assign_osd_msg(msg_ptr, MSG_set_A, c_msg_ptr, MSG_c_set_A);
    } else { /* (mode == REPEAT_AB_END) */
	Indicator_2 |= SEG_REP_B | SEG_REPEAT;
	assign_osd_msg(msg_ptr, MSG_repeatA2B, c_msg_ptr, MSG_c_repeatA2B);
    }

    REFRESH_INDICATOR_2;

    OUTOSD(OSD_INPUT_MODE_REGION, msg_ptr, c_msg_ptr, timeout);
}

/*===========================================================================*/
#define GOTO_MIN_POS    7
#define GOTO_SEC_POS    (GOTO_MIN_POS + 3)
#define CGOTO_MIN_POS    5
#define CGOTO_SEC_POS    (CGOTO_MIN_POS + 3)

void panel_goto(int mode, int value)
{
    int timeout = 0;
    unsigned char *msg_ptr;
#ifdef BILINGUAL_OSD
    unsigned char *c_msg_ptr;
#endif

    assign_osd_msg(msg_ptr, goto_buf, c_msg_ptr, c_goto_buf);
    value += '0';

    if (mode == GOTO_OFF) {
       #ifdef  SHARK_REMOTE
          Indicator_4 &= ~SEG_TIME;
          REFRESH_INDICATOR_4;
       #endif
        
        msg_ptr[GOTO_MIN_POS] = 'X';
        msg_ptr[GOTO_MIN_POS+1] = 'X';
        msg_ptr[GOTO_SEC_POS] = 'X';
        msg_ptr[GOTO_SEC_POS+1] = 'X';
#ifdef BILINGUAL_OSD
        c_msg_ptr[CGOTO_MIN_POS] = 'X';
        c_msg_ptr[CGOTO_MIN_POS+1] = 'X';
        c_msg_ptr[CGOTO_SEC_POS] = 'X';
        c_msg_ptr[CGOTO_SEC_POS+1] = 'X';
#endif
	timeout = DISPLAY_TIME_OUT;
    } else if (mode == GOTO_START) {
       #ifdef  SHARK_REMOTE
          Indicator_4 |= SEG_TIME;
          REFRESH_INDICATOR_4;
       #endif
        msg_ptr[GOTO_MIN_POS] = '_';
        msg_ptr[GOTO_MIN_POS+1] = '_';
        msg_ptr[GOTO_SEC_POS] = '_';
        msg_ptr[GOTO_SEC_POS+1] = '_';
#ifdef BILINGUAL_OSD
        c_msg_ptr[CGOTO_MIN_POS] = '_';
        c_msg_ptr[CGOTO_MIN_POS+1] = '_';
        c_msg_ptr[CGOTO_SEC_POS] = '_';
        c_msg_ptr[CGOTO_SEC_POS+1] = '_';
#endif
    } else if (mode == GOTO_MINUTE_TEN) {
        msg_ptr[GOTO_MIN_POS] = value;
#ifdef BILINGUAL_OSD
        c_msg_ptr[CGOTO_MIN_POS] = value;
#endif
    } else if (mode == GOTO_MINUTE) {
        msg_ptr[GOTO_MIN_POS+1] = value;
#ifdef BILINGUAL_OSD
        c_msg_ptr[CGOTO_MIN_POS+1] = value;
#endif
    } else if (mode == GOTO_SECOND_TEN) {
        msg_ptr[GOTO_SEC_POS] = value;
#ifdef BILINGUAL_OSD
        c_msg_ptr[CGOTO_SEC_POS] = value;
#endif
    } else if (mode == GOTO_SECOND) {
        msg_ptr[GOTO_SEC_POS+1] = value;
#ifdef BILINGUAL_OSD
        c_msg_ptr[CGOTO_SEC_POS+1] = value;
#endif
	timeout = EXTENDED_TIME_OUT;
       #ifdef  SHARK_REMOTE
           Indicator_4 &= ~SEG_TIME;
           REFRESH_INDICATOR_4;
       #endif


    }
    
    OUTOSD(OSD_GOTO_REGION, msg_ptr, c_msg_ptr, timeout);
}

static void show_panel_time(int time)
{
    unsigned int temp_servo_info;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?