📄 play_com.c
字号:
#ifdef SPTM_SUPPORT
BYTE bType = bEqCurrType();
BYTE bMode = bCurrWbMode();
if (fgIsNonPlay() || fgIsIsoPlay()
#ifdef SUPPORT_PCD
|| fgIsPcdPlay()
#endif
)
{
// _bIRKey = IR_NONE;
// return (UOP_OK);
// 20050401, CR00002256, show prohibit for non-supported keys
return (UOP_FAIL);
}
#ifdef SUPPORT_DVD_AUDIO
if (bSharedInfo(SI_DISC_TYPE) == SV_DVD_AUDIO)
{
// _bIRKey = IR_NONE;
// return (UOP_OK);
// 20050401, CR00002256, show prohibit for non-supported keys
return (UOP_FAIL);
}
#endif /* SUPPORT_DVD_AUDIO */
if (fgIsStDispWbMode(bMode) == FALSE)
{
_bIRKey = IR_NONE;
return (UOP_OK);
}
switch (bType)
{
case OSD_EQ_TYPE_DISABLE:
#ifdef PLAYER_ZOOMIN_INDICATOR
if( fgIsZoomBrShow())
vDisableWB(WB_ZOOM_BR);
#endif
bType = OSD_EQ_TYPE_GRID;
break;
case OSD_EQ_TYPE_GRID:
#ifdef SPTM_EN_BAR_TYPE
bType = OSD_EQ_TYPE_BAR;
#else
bType = OSD_EQ_TYPE_DISABLE;
#ifdef PLAYER_ZOOMIN_INDICATOR
if( fgIsZoomBrShow())
vEnableWB(WB_ZOOM_BR);
#endif
#endif
break;
case OSD_EQ_TYPE_BAR:
default:
bType = OSD_EQ_TYPE_DISABLE;
#ifdef PLAYER_ZOOMIN_INDICATOR
if( fgIsZoomBrShow())
vEnableWB(WB_ZOOM_BR);
#endif
break;
} /* switch (bType) */
vSptmChangeType(bType);
#else
vOsdShowError(SV_ERR_INVALID_OPERATION, OSD_TIMEOUT_SHORT);
#endif /* SPTM_SUPPORT */
_bIRKey = IR_NONE;
return (UOP_OK);
}
BOOL fgCOMEchoPlusKey(void) large
{
#ifdef KARAOKE_SIMPLE_ECHO
BYTE bLevel = bEepromReadByte(MIC_ECHO_POS);
/* make sure microphone is on */
if (bEepromReadByte(MIC_SW_POS) == EV_OFF)
{
fgEepromWriteByte(MIC_SW_POS, EV_ON);
bSetMic(NULL_POSITION, 0);
vOsdShowEchoLevel(OSD_MIC_ON);
}
else
{
if (bLevel < (ECHO_LEVEL_MAX - 1))
{
bLevel++;
}
else
{
bLevel = ECHO_LEVEL_MAX - 1;
}
vAdspEchoLevel(bLevel);
fgEepromWriteByte(MIC_ECHO_POS, bLevel);
vOsdShowEchoLevel(bLevel);
}
#endif /* KARAOKE_SIMPLE_ECHO */
_bIRKey = IR_NONE;
return (UOP_OK);
}
BOOL fgCOMEchoMinusKey(void) large
{
#ifdef KARAOKE_SIMPLE_ECHO
BYTE bLevel = bEepromReadByte(MIC_ECHO_POS);
if (bEepromReadByte(MIC_SW_POS) == EV_OFF)
{
if (bLevel == 0)
{
vOsdShowEchoLevel(OSD_MIC_OFF);
}
else
{
fgEepromWriteByte(MIC_SW_POS, EV_ON);
bSetMic(NULL_POSITION, 0);
vOsdShowEchoLevel(OSD_MIC_ON);
}
}
else
{
if (bLevel == 0)
{
fgEepromWriteByte(MIC_SW_POS, EV_OFF);
bSetMic(NULL_POSITION, 0);
vOsdShowEchoLevel(OSD_MIC_OFF);
}
else
{
bLevel--;
vAdspEchoLevel(bLevel);
fgEepromWriteByte(MIC_ECHO_POS, bLevel);
vOsdShowEchoLevel(bLevel);
}
}
#endif /* KARAOKE_SIMPLE_ECHO */
_bIRKey = IR_NONE;
return (UOP_OK);
}
BOOL fgCOMEchoTypeKey(void) large
{
// _bIRKey = IR_NONE;
// return (UOP_OK);
// 20050401, CR00002256, show prohibit for non-supported keys
return (UOP_FAIL);
}
BOOL fgCOMSpkCfgKey(void) large
{
#ifndef PLAYER_2_CHANNEL
BYTE bMode = bEepromReadByte(SPEAKER_POSITION);
switch (bMode)
{
case EV_DOWN_LTRT:
bMode = EV_DOWN_LORO;
vOsdPosShow(OSD_POS_AUD_CTRL, OSD_MSG_STEREO_LORO, OSD_TIMEOUT);
break;
case EV_DOWN_LORO:
#ifdef SET_VSURR_IN_SPKCFG
bMode = EV_DOWN_VSURR;
vOsdPosShow(OSD_POS_AUD_CTRL, OSD_MSG_V_SURR, OSD_TIMEOUT);
#else
bMode = EV_DOWN_OFF;
vOsdPosShow(OSD_POS_AUD_CTRL, OSD_MSG_51CH, OSD_TIMEOUT);
#endif
break;
#ifdef SET_VSURR_IN_SPKCFG
case EV_DOWN_VSURR:
#ifdef USE_N22_VSURR
bMode = EV_DOWN_N22;
vOsdPosShow(OSD_POS_AUD_CTRL, OSD_MSG_SPATIALIZER_N22, OSD_TIMEOUT);
#else
bMode = EV_DOWN_OFF;
vOsdPosShow(OSD_POS_AUD_CTRL, OSD_MSG_51CH, OSD_TIMEOUT);
#endif
break;
#ifdef USE_N22_VSURR
case EV_DOWN_N22:
bMode = EV_DOWN_OFF;
vOsdPosShow(OSD_POS_AUD_CTRL, OSD_MSG_51CH, OSD_TIMEOUT);
break;
#endif
#endif
case EV_DOWN_OFF:
default:
bMode = EV_DOWN_LTRT;
vOsdPosShow(OSD_POS_AUD_CTRL, OSD_MSG_STEREO_LTRT, OSD_TIMEOUT);
break;
}
fgEepromWriteByte(SPEAKER_POSITION, bMode);
bSpkConfig(NULL_POSITION, 0);
#endif /* PLAYER_2_CHANNEL */
_bIRKey = IR_NONE;
return (UOP_OK);
}
BOOL fgCOMOpenCloseKey(void) large
{
BYTE bInitState = bSharedInfo(SI_INIT_STATE);
BYTE bMode;
#ifdef AUDIO_IN_EN
bMode = bEepromReadByte(AUDIO_IN_POS);
if (fgIsFuncAin())
{
// force escape audio-in mode
if ((bMode > EV_AI_OFF) &&
(bMode < EV_AIN_MAX))
{
fgEepromWriteByte(AUDIO_IN_POS, EV_AI_OFF);
vAINSwitchSource(EV_AI_OFF);
vPlayerFuncSwitch(PLAYER_FUNC_DVD);
}
fgSetPlayPostKey(IR_EJECT);
_bIRKey = IR_NONE;
return (UOP_OK);
}
#endif /* AUDIO_IN_EN */
/* before any action, make sure the player in a known state */
if (bInitState == SV_DISC_IDENTIFIED)
{
vPlayerReset();
#ifdef EEPROM_LASTMEM_EJECT_WR_BACK
_rOsdStateCtx.fgLastMemWrBack = TRUE;
#endif
}
bMode = 0;
if (bInitState == SV_TRAY_OPENING)
{
bMode = DO_CLOSE;
vClearWB(WB_NORMAL_PBC2);
vWBEnable(WB_NORMAL_PBC2);
}
else if (bInitState == SV_TRAY_ERROR)
{
bMode = DO_OPEN | DO_OPEN_CLOSE_FORCE;
}
else
{
bMode = DO_OPEN;
if (IS_SVCD_TYPE(bSharedInfo(SI_DISC_TYPE)))
vWBDisable(WB_NORMAL_PBC2);
}
if ((bInitState != SV_TRAY_OPENING) && (bInitState != SV_TRAY_CLOSING))
{
bMode |= DO_OPEN_CLOSE_DING;
}
else if ((bInitState == SV_TRAY_OPENING) && fgIsTrayOutside())
{
bMode |= DO_OPEN_CLOSE_DING;
}
vDoEject(bMode);
_bIRKey = IR_NONE;
return (UOP_OK);
}
BOOL fgCOMPowerKey(void) large
{
//[runma] add block for power key problem
#ifdef AUDIO_IN_EN
vAinChSel(AIN_SEL_OFF);
#endif
#ifdef PLAYER_POWERDOWN
vAdspMute(ADSP_ON, 0); // do soft mute ASAP
/* update VFD immediately */
VfdClearAll();
VfdMsg(VFDMSG_off);
VfdUpdateNow();
VfdBright(VFD_DISP_RESET);
/* stop UI task */
vUIStop();
/* this will make RISC to stop running */
vSendUopCmd(UOP_POWER, SV_PWR_STANDBY, 0, 0);
#endif /* PLAYER_POWERDOWN */
_bIRKey = IR_NONE;
return (UOP_OK);
}
// *********************************************************************
// *********************************************************************
static BOOL fgCOMPlayPauseKey(void) large
{
BYTE bTmp = bSharedInfo(SI_PBC_STATE);
if (fgIsNoInputState() && fgIsNonPlay() &&
(bSharedInfo(SI_INIT_STATE) == SV_TRAY_OPENING))
{
/* when tray is open, PLAY key is eject key */
_bIRKey = IR_PLAY;
}
#ifdef PLAY_PAUSE_TRICK_PLAY
else if (bTmp == SV_PLAY)
#else /* trick pause for play pause */
else if ((bTmp == SV_PLAY) || (bTmp == SV_FF) || (bTmp == SV_SF) ||
(bTmp == SV_FR) || (bTmp == SV_SR))
#endif
{
_bIRKey = IR_PAUSE;
}
else /* default is PLAY key */
{
_bIRKey = IR_PLAY;
}
return (UOP_OK);
}
static BOOL fgCOMPauseStepKey(void) large
{
BYTE bPbcState = bSharedInfo(SI_PBC_STATE);
BYTE bDiscType = bSharedInfo(SI_DISC_TYPE);
if (fgIsNonPlay())
{
_bIRKey = IR_NONE;
}
else if (fgIsCddaPlay()
#ifdef ISO_PAUSE_STEP_NO_STEP
|| fgIsIsoPlay()
#ifdef SUPPORT_PCD
|| fgIsPcdPlay()
#endif
#endif
)
{
if (fgIsIsoPlay()
#ifdef SUPPORT_PCD
|| fgIsPcdPlay()
#endif
)
{
_bIRKey = IR_PAUSE;
}
#ifndef CDDA_USE_CDFS
// bPbcState = bFlGetFgPbcState();
if(fgIsCddaPlay())
{
if (bPbcState == SV_PAUSE)
{
_bIRKey = IR_PLAY;
}
else
{
_bIRKey = IR_PAUSE;
}
}
#endif
}
else if ((bPbcState == SV_PAUSE) || (bPbcState == SV_STEP))
{
_bIRKey = IR_STEP;
}
else
{
_bIRKey = IR_PAUSE;
}
return (UOP_OK);
}
static BYTE fgCOMStopResumeKey(void) large
{
BYTE bState = bSharedInfo(SI_PBC_SWITCH);
#ifdef VCD_SUPPORT
if (fgIsVcdPlay())
{
if (bState == SV_PBC_ON)
{
_bIRKey = IR_RETURN;
}
else
{
_bIRKey = IR_STOP;
}
}
else /* fgIsDvdPlay() || fgIsIsoPlay() */
#endif
{
_bIRKey = IR_STOP;
}
return (UOP_OK);
}
static BOOL fgCOMPlayEnterKey(void) large
{
BYTE bHliState = bSharedInfo(SI_HLI_STATE);
BYTE bState = bSharedInfo(SI_PBC_STATE);
if (fgIsNonPlay())
{
/* when tray is open, PLAY key is eject key */
if (fgIsNoInputState() && (bSharedInfo(SI_INIT_STATE) == SV_TRAY_OPENING))
{
_bIRKey = IR_PLAY;
}
}
else /* DVD/VCD/ISO */
{
if(fgIsInputStateValid(INPUT_STATE_VREMOTE))
{
_bIRKey = IR_ENTER;
}
else
{
if (bHliState == SV_OFF)
{
_bIRKey = IR_PLAY;
}
else
{
/* if in trick mode, back to normal play first */
if (fgIsTrickPlay(bState))
{
_bIRKey = IR_PLAY;
}
else
{
_bIRKey = IR_ENTER;
}
}
}
}
return (UOP_OK);
}
static BOOL fgCOMMenuPbcKey(void) large
{
#ifdef VCD_SUPPORT
if (fgIsVcdPlay())
{
_bIRKey = IR_PBC;
}
else
#endif
{
_bIRKey = IR_ROOT_MENU;
}
return (UOP_OK);
}
static BOOL fgCOMTitlePbcKey(void) large
{
#ifdef VCD_SUPPORT
if (fgIsVcdPlay())
{
_bIRKey = IR_PBC;
}
else
#endif
{
_bIRKey = IR_TITLE_MENU;
}
return (UOP_OK);
}
static BOOL fgCOMManualEjectKey(void) large
{
_bIRKey = IR_EJECT;
return (UOP_OK);
}
#ifdef IR_CHECK_KEY_LOCK
// *********************************************************************
// Function :
// Description :
// Parameter :
// Return :
// *********************************************************************
BYTE bHandleIRKeyPressTimeout(BOOL fgTimeout, BYTE bKey) large
{
switch (bKey)
{
#ifdef ENABLE_ZOOM_USER_MODE
case IR_ZOOM_IN:
if (fgTimeout == TRUE)
{
bKey = IR_ZOOM_USER;
}
else // not tiemout yet, no key to return
{
bKey = IR_NONE;
}
break;
#endif
default:
break;
}
return (bKey);
}
#endif /* IR_CHECK_KEY_LOCK */
// *********************************************************************
// Function :
// Description :
// Parameter :
// Return :
// *********************************************************************
BOOL fgHandleMultiKey(void) large
{
BYTE fgRet = UOP_OK;
switch (_bIRKey)
{
case IR_PLAY_PAUSE:
fgRet = fgCOMPlayPauseKey();
break;
case IR_PAUSE_STEP:
fgRet = fgCOMPauseStepKey();
break;
case IR_STOP_RESUME:
fgRet = fgCOMStopResumeKey();
break;
case IR_PLAY_ENTER:
fgRet = fgCOMPlayEnterKey();
break;
case IR_MENU_PBC:
fgRet = fgCOMMenuPbcKey();
break;
case IR_TITLE_PBC:
fgRet = fgCOMTitlePbcKey();
break;
case IR_MANUAL_EJECT:
fgRet = fgCOMManualEjectKey();
break;
/* no need default handle here! */
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -