?? panelvfd.c
字號:
/* Copyright 1996, ESS Technology, Inc. */
/* SCCSID @(#)panelvfd.c 1.41 01/19/98 */
/*
* $Log$
*/
#include <stdio.h>
#include "vcd30.h"
#include "const.h"
#include "dsa.h"
#include "util.h"
#include "panel.h"
#include "micro.h"
#include "sysinfo.h"
#include "fsosd.h"
#include "play.h"
#include "panelcmd.h"
#include "tdm.h"
#include "custom.h"
/*===========================================================================*/
/*===========================================================================*/
static unsigned char Indicator_1 = 0;
static unsigned char Indicator_2 = 0;
static unsigned char Indicator_3 = 0;
static unsigned char Indicator_4 = 0;
static unsigned char Indicator_5 = 0;
static unsigned char Indicator_6 = 0;
int TotalTrack ;
int SystemStatus ;
int DiscMode ;
int Motion_Pic;
static int PlayTrack = 1;
static int TimeMode ;
static int RepeatMode ;
static int ElapsedTime; /* In mm:ss:ff (CD format, i.e. BCD) */
static int TrackIndex ;
#if (defined(FOUR_LINE_OSD) && !defined(BF43))
static char PANEL_display_order; /* Used to cycle through status display */
#endif
static void show_FF_FR_osd(int cur_state, int index);
static void show_program_osd_number(int index, int track, int done);
static void enable_program_cdda();
static void show_panel_time(int time);
extern PSD_size;
static unsigned char disc_buf1[] = "DISC " ;
static unsigned char c_disc_buf1[] = "DISC ";
/*===========================================================================*/
#define REFRESH_INDICATOR_1 addMicroRing(PANEL_IND1 | Indicator_1)
#define REFRESH_INDICATOR_2 addMicroRing(PANEL_IND2 | Indicator_2)
#define REFRESH_INDICATOR_3 addMicroRing(PANEL_IND3 | Indicator_3)
#define REFRESH_INDICATOR_4 addMicroRing(PANEL_IND4 | Indicator_4)
#define REFRESH_INDICATOR_5 addMicroRing(PANEL_IND5 | Indicator_5)
#define REFRESH_INDICATOR_6 addMicroRing(PANEL_IND6 | Indicator_6)
/* The following informations are from play.c */
#define TOTAL_PROGRAM_TRACKS \
track_list_max
#define TRACK_LIST_INDEX \
cur_track_index
/*===========================================================================*/
/* function protype */
/*------------------------------------------------------------------------
Function:
Parameters:
Description:
------------------------------------------------------------------------*/
void disp_calendar(int start_index)
{
int cal;
int track;
int i;
#ifdef VCDROM
/* Don't show calendar if play clip */
if (play_clip == VCD30_PLAY_CLIP)
return;
#endif
VFD_update_calendar(start_index, track_list_max);
}
/*===========================================================================*/
void panel_system_status(int status)
{
switch (status) {
case SYSTEM_INIT:
addMicroRing(PANEL_BLANK | BLANK_ALL);
break;
case SYSTEM_STOP:
Indicator_4 &= ~(SEG_PLAY | SEG_PAUSE | SEG_INTRO);
REFRESH_INDICATOR_4;
Indicator_2 &= ~SEG_MEMORY;
REFRESH_INDICATOR_2;
#ifdef VCDROM
if (play_clip == VCD30_PLAY_CLIP) {
addMicroRing(PANEL_BLANK | BLANK_TRACK);
TimeMode = TIME_SINGLE_ELAPSED;
Indicator_5 |= (SEG_SEC | SEG_MIN | SEG_COLON);
REFRESH_INDICATOR_5;
break;
}
#endif
#ifdef FU271
Indicator_5 &= ~SEG_REMAIN;
Indicator_5 |= (SEG_SEC | SEG_MIN | SEG_COLON);
REFRESH_INDICATOR_5;
#else
#ifdef FU_KANGHUI30
Indicator_5 &= ~( SEG_SHUFFLE | SEG_FF | SEG_FB);
Indicator_5 |= SEG_COLON;
REFRESH_INDICATOR_5;
#else
Indicator_5 &= ~(SEG_REMAIN | SEG_RESUME);
Indicator_5 |= (SEG_SEC | SEG_MIN | SEG_COLON
#ifndef USE_ECHO
#ifndef FU271
| SEG_KARAOKE1 | SEG_KARAOKE2
#endif
#endif
);
REFRESH_INDICATOR_5;
#endif
#endif
#ifdef FU267
Indicator_4 |= (SEG_TRACK | SEG_TIME | SEG_HYPHEN | SEG_COLON);
#endif
if (DiscMode & DISC_PROGRAM) {
addMicroRing(PANEL_TRACK | TOTAL_PROGRAM_TRACKS);
} else {
addMicroRing(PANEL_TRACK | TotalTrack);
}
disp_calendar(0);
TimeMode = TIME_TOTAL_REMAIN;
ElapsedTime = 0;
SystemStatus = status;
PlayTrack = 1; /* force to show min and sec */
if (SystemStatus != SYSTEM_OPEN)
panel_running_time(0);
break;
#ifdef SGAME
case SYSTEM_SGAME:
Indicator_1 = 0;
Indicator_2 = 0;
Indicator_3 = 0;
Indicator_4 = 0;
DiscMode = 0;
ElapsedTime = 0;
disp_calendar(99);
addMicroRing(PANEL_BLANK | BLANK_ALL);
addMicroRing(SHOW_MSG | SHOW_SGAME);
break;
#endif
case SYSTEM_OPEN:
Indicator_1 = 0;
Indicator_2 = 0;
Indicator_3 = 0;
Indicator_4 = 0;
DiscMode = 0;
ElapsedTime = 0;
disp_calendar(99);
addMicroRing(PANEL_BLANK | BLANK_ALL);
addMicroRing(SHOW_MSG | SHOW_OPEN);
break;
#ifdef TWO_CDS
case SYSTEM_1OPEN:
Indicator_1 = 0;
Indicator_2 = 0;
Indicator_3 = 0;
Indicator_4 = 0;
Indicator_5 = 0;
Indicator_6 = 0;
DiscMode = 0;
ElapsedTime = 0;
disp_calendar(99);
addMicroRing(PANEL_BLANK | BLANK_ALL);
addMicroRing(SHOW_MSG | SHOW_1OPEN);
break;
case SYSTEM_2OPEN:
Indicator_1 = 0;
Indicator_2 = 0;
Indicator_3 = 0;
Indicator_4 = 0;
Indicator_5 = 0;
Indicator_6 = 0;
DiscMode = 0;
ElapsedTime = 0;
disp_calendar(99);
addMicroRing(PANEL_BLANK | BLANK_ALL);
addMicroRing(SHOW_MSG | SHOW_2OPEN);
break;
case SYSTEM_CHDISC:
Indicator_1 = 0;
Indicator_2 = 0;
Indicator_3 = 0;
Indicator_4 = 0;
Indicator_5 = 0;
Indicator_6 = 0;
addMicroRing(PANEL_BLANK | BLANK_ALL);
addMicroRing(SHOW_MSG | SHOW_CHDISC);
break;
#endif
case SYSTEM_CLOSE:
addMicroRing(PANEL_BLANK | BLANK_ALL);
addMicroRing(SHOW_MSG | SHOW_CLOSE);
break;
case SYSTEM_READING:
addMicroRing(PANEL_BLANK | BLANK_ALL);
addMicroRing(SHOW_MSG | SHOW_READING);
break;
case SYSTEM_PAUSE:
Indicator_4 |= SEG_PAUSE;
Indicator_4 &= ~SEG_PLAY;
REFRESH_INDICATOR_4;
#ifdef FU_KANGHUI30
Indicator_5 &= ~(SEG_FF | SEG_FB);
REFRESH_INDICATOR_5;
#endif
break;
case SYSTEM_PLAYING:
if ((SystemStatus == SYSTEM_STOP) || (DiscMode & DISC_PBC_ON))
showProgramTime(TIME_SINGLE_ELAPSED);
case SYSTEM_CONTINUE:
#ifdef VCDROM
if (play_clip>=VCD30_PLAY_CLIP){
TimeMode = TIME_SINGLE_ELAPSED;
}
#endif
status = SYSTEM_PLAYING;
Indicator_4 |= SEG_PLAY;
Indicator_4 &= ~SEG_PAUSE;
#ifdef FU_KANGHUI30
Indicator_5 &= ~(SEG_FF | SEG_FB);
REFRESH_INDICATOR_5;
#endif
REFRESH_INDICATOR_4;
addMicroRing(PANEL_AUTO_PAUSE);
break;
}
SystemStatus = status;
}
/*===========================================================================*/
void panel_TV_mode(int mode)
{
if (mode == PANEL_TV_NTSC) {
Indicator_3 |= SEG_NTSC;
Indicator_3 &= ~SEG_PAL;
} else {
Indicator_3 |= SEG_PAL;
Indicator_3 &= ~SEG_NTSC;
}
REFRESH_INDICATOR_3;
}
/*===========================================================================*/
void panel_disc_type(int type)
{
if (type == DISC_UNKNOWN) {
addMicroRing(PANEL_BLANK | BLANK_ALL);
addMicroRing(SHOW_MSG | SHOW_UN_DISC);
Indicator_1 = 0;
} else if (type == DISC_NO_DISC) {
addMicroRing(PANEL_BLANK | BLANK_ALL);
addMicroRing(SHOW_MSG | SHOW_NO_DISC);
Indicator_1 = 0;
} else if (type == DISC_VCD20) {
addMicroRing(PANEL_VCD | PANEL_VCD_20);
#ifdef FU_KANGHUI30
Indicator_5 |= SEG_S1;
Indicator_5 &= ~SEG_S2;
REFRESH_INDICATOR_5;
Indicator_1 |= SEG_VIDEO;
REFRESH_INDICATOR_1;
#else
Indicator_1 |= (SEG_VIDEO | SEG_VCD);
REFRESH_INDICATOR_1;
#endif
} else if (type == DISC_VCD11) {
addMicroRing(PANEL_VCD | PANEL_VCD_11);
#ifdef FU_KANGHUI30
Indicator_5 &= ~(SEG_S1 | SEG_S2 | SEG_VIDEO);
REFRESH_INDICATOR_5;
Indicator_1 |= (SEG_VCD | SEG_MUSIC_CD);
#else
#ifdef YONGSHENG
Indicator_1 |= (SEG_VIDEO | SEG_VCD);
#else
Indicator_1 |= SEG_VCD;
#endif
#endif
REFRESH_INDICATOR_1;
} else if (type == DISC_AUDIO) {
#ifdef FU_KANGHUI30
Indicator_5 &= ~(SEG_S1 | SEG_S2 | SEG_VIDEO);
REFRESH_INDICATOR_5;
Indicator_1 |= SEG_MUSIC_CD;
#else
Indicator_1 |= SEG_MUSIC_CD;
#endif
REFRESH_INDICATOR_1;
}
addMicroRing(PANEL_FLASH | CLEAR_ACCESS);
}
/*===========================================================================*/
void panel_audio_mode(int mode)
{
if (mode == AUDIO_MUTE)
#ifndef FU267
#ifdef FU_KANGKUI
Indicator_3 &= ~(SEG_1_L | SEG_2_R | SEG_VOCAL);
else if (mode == AUDIO_L_R)
Indicator_3 |= (SEG_1_L | SEG_2_R | SEG_VOCAL);
else if (mode == AUDIO_L_L) {
Indicator_3 &= ~(SEG_2_R | SEG_VOCAL);
Indicator_3 |= SEG_1_L;
} else if (mode == AUDIO_R_R) {
Indicator_3 &= ~(SEG_1_L | SEG_VOCAL);
Indicator_3 |= SEG_2_R;
}
#else
Indicator_3 &= ~(SEG_1_L | SEG_2_R );
else if (mode == AUDIO_L_R)
Indicator_3 |= (SEG_1_L | SEG_2_R );
else if (mode == AUDIO_L_L) {
Indicator_3 &= ~SEG_2_R;
Indicator_3 |= SEG_1_L;
} else if (mode == AUDIO_R_R) {
Indicator_3 &= ~SEG_1_L;
Indicator_3 |= SEG_2_R;
}
#endif
#else
Indicator_3 &= ~(SEG_1_L | SEG_2_R | SEG_STEREO);
else if (mode == AUDIO_L_R)
Indicator_3 |= (SEG_1_L | SEG_2_R | SEG_STEREO);
else if (mode == AUDIO_L_L) {
Indicator_3 &= ~(SEG_2_R | SEG_STEREO);
Indicator_3 |= SEG_1_L;
} else if (mode == AUDIO_R_R) {
Indicator_3 &= ~(SEG_1_L | SEG_STEREO);
Indicator_3 |= SEG_2_R;
}
#endif
REFRESH_INDICATOR_3;
}
/*===========================================================================*/
void panel_key_shift(int level)
{
#ifdef FU_KANGHUI30 /* FU267*/
Indicator_1 &= ~(SEG_KEY_MINUS | SEG_KEY_RESUME | SEG_KEY_PLUS);
if (level > 0) Indicator_1 |= SEG_KEY_PLUS;
else if (level < 0) Indicator_1 |= SEG_KEY_MINUS;
else Indicator_1 |= SEG_KEY_RESUME;
REFRESH_INDICATOR_1;
#endif
OSD_pitch_bar(level);
}
void panel_auto_pause(int auto_pause)
{
if (auto_pause) {
addMicroRing(PANEL_AUTO_PAUSE | PANEL_AUTO_PAUSE_BIT);
} else {
addMicroRing(PANEL_AUTO_PAUSE);
}
}
/*===========================================================================*/
void panel_vocal_mode(int mode)
{
if (mode == VOCAL_LEFT) {
#ifdef FU267
Indicator_3 |= SEG_VOCAL | SEG_1_L;
Indicator_3 &= ~(SEG_2_R | SEG_STEREO);
} else if (mode == VOCAL_RIGHT) {
Indicator_3 |= SEG_VOCAL | SEG_2_R;
Indicator_3 &= ~(SEG_1_L | SEG_STEREO);
} else if (mode == VOCAL_OFF) {
Indicator_3 &= ~SEG_VOCAL;
Indicator_3 |= SEG_STEREO;
}
#else
#ifdef FU_KANGHUI
Indicator_3 |= SEG_1_L;
Indicator_3 &= ~SEG_2_R;
} else if (mode == VOCAL_RIGHT) {
Indicator_3 |= SEG_2_R;
Indicator_3 &= ~SEG_1_L ;
} else if (mode == VOCAL_OFF) {
Indicator_3 &= ~SEG_VOCAL;
}
#else
Indicator_3 |= SEG_VOCAL | SEG_1_L;
Indicator_3 &= ~SEG_2_R;
} else if (mode == VOCAL_RIGHT) {
Indicator_3 |= SEG_VOCAL | SEG_2_R;
Indicator_3 &= ~SEG_1_L ;
} else if (mode == VOCAL_OFF) {
Indicator_3 &= ~SEG_VOCAL;
}
#endif
#endif
REFRESH_INDICATOR_3;
}
/*===========================================================================*/
void panel_osd_mode_change(void)
{
unsigned char *msg, *c_msg;
#if (defined(FOUR_LINE_OSD) && !defined(BF43))
static char display_order;
display_order++;
if (display_order > 2) {
display_order = 0;
DiscMode &= ~DISC_OSD_ON;
} else
DiscMode |= DISC_OSD_ON;
#else
DiscMode ^= DISC_OSD_ON;
#endif /* FOUR_LINE_OSD && not BF43 */
if (DiscMode & DISC_OSD_ON) {
#if (defined(FOUR_LINE_OSD) && !defined(BF43))
if (display_order == 1) {
#endif /* FOUR_LINE_OSD && not BF43 */
/* Turn on time & track */
if (PlayTrack) {
OSD_time_track(OSD_TRACK_REGION_MASK|OSD_TIME_REGION_MASK, 0);
if (TimeMode == TIME_SINGLE_ELAPSED) {
assign_osd_msg(msg, MSG_single_elapsed, c_msg,
MSG_c_single_elapsed);
} else if (TimeMode == TIME_SINGLE_REMAIN) {
assign_osd_msg(msg, MSG_single_remain, c_msg,
MSG_c_single_remain);
} else if (TimeMode == TIME_TOTAL_REMAIN) {
assign_osd_msg(msg, MSG_total_remain, c_msg,
MSG_c_total_remain);
}
/* Output time-type message... */
OUTOSD(OSD_FUNCTION_STATUS_REGION, msg, c_msg, QUICK_TIME_OUT);
}
#ifdef FOUR_LINE_OSD
/* Checking play-order */
msg = c_msg = NULL; /* initialize */
if (DiscMode & DISC_PBC_ON) {
assign_osd_msg(msg, MSG_pbc, c_msg, MSG_pbc);
} else if (DiscMode & DISC_SHUFFLE) {
assign_osd_msg(msg, MSG_shuffle, c_msg, MSG_c_shuffle);
} else if (DiscMode & DISC_PROGRAM) {
assign_osd_msg(msg, MSG_program, c_msg, MSG_c_program);
}
if (msg) /* Output play-order message... */
OUTOSD(OSD_PLAY_ORDER_REGION, msg, c_msg, EXTENDED_TIME_OUT);
/* Checking track-repeat type */
if (RepeatMode == REPEAT_ONE) {
assign_osd_msg(msg, MSG_repeat_one, c_msg, MSG_c_repeat_one);
} else if (RepeatMode == REPEAT_ALL) {
assign_osd_msg(msg, MSG_repeat_all, c_msg, MSG_c_repeat_all);
} else {/* RepeatMode == REPEAT_OFF */
assign_osd_msg(msg, MSG_repeat_off, c_msg, MSG_c_repeat_off);
}
/* Output track-repeat type message... */
OUTOSD(OSD_REPEAT_REGION, msg, c_msg, EXTENDED_TIME_OUT);
/* Checking TV-output type */
if (currentTVmode == TV_PAL) {
assign_osd_msg(msg, MSG_pal, c_msg, MSG_pal);
} else { /* currentTVmode == TV_NTSC */
assign_osd_msg(msg, MSG_ntsc, c_msg, MSG_ntsc);
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -