📄 cc.c
字号:
{ // DVD_051Micky, treat KEY_FF as KEY_SCF // must check if allow Scan if ( (bKey == KEY_SCF) || (bKey == KEY_FF) ) { if ( ! NV_QueryUOP (UOP_CAN_FORWARD_SCAN) ) return INVALID_KEY; } else if (bKey == KEY_SCB) { if (! NV_QueryUOP(UOP_CAN_BACKWARD_SCAN)) return INVALID_KEY; } //kevin1.11, fix Play -> Slow %75 -> Slow %50 => unsmooth audio for a while (change sampling freq should be within the period of PCM scale=0) //kevin1.20, fade out on discont. points //wyc2.17-909S, support another key to enable language study function. if (bKey==KEY_FF || bKey == KEY_SCF || bKey == KEY_SCB || bKey == KEY_SF || bKey == KEY_LAN_STUDY) { CHIPS_OpenAudio( FALSE ); } } else#endif //#ifndef NO_DISC_MODE //CoCo2.37p // Micky0.67-909 { // non-DVD bTemp= UTL_CheckPlayItemMode ( __wPlayItem ); // STILL mode or CDDA mode don't allow scan if ((bTemp & MODE_STILL ) || (__bAttrPlayNew==ATTR_CDDA)) { // LLY.274, check playing mode has updated if( ((bKey==KEY_SCF) || (bKey==KEY_SCB)) && (__bAttrPlayNew==ATTR_CDDA) ) { __bScan=SCAN_NONE; } else { OSD_Output(MSG_INVALID, OSD_ERR_KEY, 1); return TRUE; } } else {// Micky1.06, KEY_FF don't have audio, must mute too.// if ( ( bKey != KEY_FF ) && ( bKey != KEY_FREEZE ) ) //fast has audio if ( bKey != KEY_FREEZE ) CHIPS_OpenAudio( FALSE ); } } // non-DVD } // The ModeCmd except PLAY and STOP// WinVCD // must release the auto pause state#ifndef NO_DISC_MODE //++CoCo2.37p { extern BYTE __bVCD20Status; __bVCD20Status=VCD20_NORMAL; }#endif //#ifndef NO_DISC_MODE //++CoCo2.37p // Micky1.07, fix DVD/ CVD-> freeze-> subpicture still update // only KEY_PLAY can enter KEY_FREEZE mode. // But FREEZE-> can switch to SCF/SCB/SMF. // enter freeze, set subpicture off // check enter freeze mode if ( bKey == KEY_FREEZE) { if (__bModeCmd == KEY_FREEZE) { if (__btPlaying) // freeze-> freeze, leave freeze { HAL_Display(HAL_DISPLAY_SPST1, TRUE) ; HAL_Display(HAL_DISPLAY_SPST2, TRUE) ; // Chuan0.75, Give the same behavior } else // freeze-> pause-> freeze, stay freeze { // do nothing } } else // play-> freeze, enter freeze { HAL_Display(HAL_DISPLAY_SPST1, FALSE) ; HAL_Display(HAL_DISPLAY_SPST2, FALSE) ; // Chuan0.75, Give the same behavior } } // check leave freeze mode else if ( __bModeCmd == KEY_FREEZE ) { HAL_Display(HAL_DISPLAY_SPST1, TRUE) ; HAL_Display(HAL_DISPLAY_SPST2, TRUE) ; // Chuan0.75, Give the same behavior } // Ming0.68-909, Disable sub-picture on SCF, SCB, STOP mode. if( (bKey == KEY_SCF) || (bKey == KEY_SCB) ) { if((bKeyPrevious != KEY_SCF) && (bKeyPrevious != KEY_SCB) ) { // enter SCF or SCB mode HAL_Display(HAL_DISPLAY_SPST1, FALSE); HAL_Display(HAL_DISPLAY_SPST2, FALSE); PARSER_ActionFilter( 0, PARSER_ENABLE_SP1, FALSE ); // Micky0.76, reset SP2 PARSER_ActionFilter( 0, PARSER_ENABLE_SP2, FALSE ); // Chuan0.80, Pass __dwSPType to SPU_Reset() due the API changed. // wyc2.04-909S, replace follow code by HAL_Reset(HAL_RESET_SPST). HAL_Reset(HAL_RESET_SPST); /*SPU_Reset(__dwSPType); PARSER_BufferReset(PARSER_ES_SP1); // Micky0.75, reset SP2 PARSER_BufferReset(PARSER_ES_SP2); //Alan1.10, for char-based subpicture#ifdef SUPPORT_CHAR_SUBPICTURE CHAR_SP_Reset();#endif */ // Micky0.70, must reset audio before enter scf/scb // Micky0.72, audio only don't need action // LLY1.01, don't throw Audio if video stream has been threw. if( (__bModePlay == MODE_PLAYMOTION) && (__bVideoID!=HAL_THROW_VIDEO) ) { HAL_ControlParser(HAL_PARSER_AUDIO_ID, HAL_THROW_AUDIO); HAL_Reset(HAL_RESET_AUDIO); } } } else if((bKeyPrevious == KEY_SCF) || (bKeyPrevious == KEY_SCB) ) { // leave SCF or SCB mode // wyc0.95, only enable SP when SCF/SCB -> play when SP is on before entering SCF/SCB mode. if ((__bSP_Disp_OFF == 0) || (__bSP_Disp_OFF&0x80)) { HAL_Display(HAL_DISPLAY_SPST1, TRUE); // Micky0.76, suppose don't have any SP data now. don't reset. /* SPU_Reset(__dwSPType); PARSER_BufferReset(PARSER_ES_SP1); // Micky0.75, enable SP2 PARSER_BufferReset(PARSER_ES_SP2); */ } // wyc1.07-909, move outside the if statement to fix SP off -> enter scan mode -> normal play -> enable SP but SP will show with little delay. PARSER_ActionFilter( 0, PARSER_ENABLE_SP1, TRUE ); // Micky0.76, enable SP2 if (__bSPST2ID!= 0xFF) { // Micky0.75, enable SP2 if ((__bSP2_Disp_OFF == 0) || (__bSP2_Disp_OFF&0x80)) { HAL_Display(HAL_DISPLAY_SPST2, TRUE); } PARSER_ActionFilter( 0, PARSER_ENABLE_SP2, TRUE ); } } // Micky0.70, modify macro commnad A/V sync control, now is audio master // bitstream dis-continue, must reset audio // switch to the mode that has audio, must set audio master // Notice: nothing need to do for audio only playback mode -- LLY0.91 // LLY1.01, don't Reset Audio if video stream has been threw. if( (__bModePlay != MODE_PLAYAUDIO) && (__bVideoID!=HAL_THROW_VIDEO) ) { // wyc2.17-909S, add key for language study function. if ( ( bKey == KEY_PLAY) || ( bKey == KEY_LAN_STUDY) || (bKey == KEY_SF) || (bKey == KEY_STEP) || (bKey == KEY_FF) || (bKey == KEY_SCF) || (bKey == KEY_SCB) || (bKey == KEY_PAUSE)) { if ( (__bModeCmd == KEY_STOP) || __btNewTime ) {#ifdef SUPPORT_JPEG_AUDIO_PLAYING if (!__bMMJPEGAudioMode)#endif //SUPPORT_JPEG_AUDIO_PLAYING { HAL_Reset(HAL_RESET_AUDIO); } // wyc1.10-909, by KC's updated code and need to reset video also, otherwise A/V will async sometimes and audio will mute when async. HAL_Reset(HAL_RESET_VIDEO); } else if ((__bModeCmd == KEY_SCF) || (__bModeCmd == KEY_SCB)) { if ((bKey != KEY_SCF) && (bKey != KEY_SCB)) { HAL_Reset(HAL_RESET_AUDIO); // wyc1.10-909, by KC's updated code and need to reset video also, otherwise A/V will async sometimes and audio will mute when async. HAL_Reset(HAL_RESET_VIDEO); // HAL_ControlAVSync(HAL_AVSYNC_VIDEOMASTER, 0 ); } } // Chuan0.80, FF/ FF -> Play/Freeze/Slow/Step/ SCAN -> Play/Freeze/Slow/Step will do VideoMaster.. // Scan/ fast mode-> bitstream continue play mode, must set video master // Gotime/ repeat AB/ resume, must se video master // fast always do video master if ((__bModeCmd == KEY_PLAY) || (__bModeCmd == KEY_SF) || (__bModeCmd == KEY_STEP) || (__bModeCmd == KEY_FF) || (__bModeCmd == KEY_SCF) || (__bModeCmd == KEY_SCB) || (__btNewTime)) { if ((__bModeCmd != KEY_PLAY) || (( bKey != KEY_LAN_STUDY) && (bKey != KEY_PAUSE) && ((__btPause != TRUE) || (bKey!=KEY_PLAY)))) { DBG_Printf(DBG_THREAD_CHEERDVD, DBG_INFO_MM_INFOFTR,"\nIssue Video Master"); // wyc2.36a-909s, add mpeg-cd code#ifdef SUPPORT_FUSS_MPEG_CD if (INFOFILTER_FUSSMPEGCD(IF_MODE_CHECK_MPEG_CD,0)) HAL_ControlAVSync(HAL_AVSYNC_VIDEOMASTER, FALSE); else HAL_ControlAVSync(HAL_AVSYNC_VIDEOMASTER, TRUE);#else#ifdef SUPPORT_JPEG_AUDIO_PLAYING if (!__bMMJPEGAudioMode)#endif //SUPPORT_JPEG_AUDIO_PLAYING HAL_ControlAVSync(HAL_AVSYNC_VIDEOMASTER, 1 );#endif // } } } } // wyc1.06-909, when pause -> play, need to issus seek command wake up SERVO if SERVO stopped. UTL_PreStartServo will issue seek ccommand // if SERVO stopped. // wyc1.08, modify __bKey checking by bKey to fix SETUP mode -> KEY_SETUP -> SERVO won't spin problem.#ifdef SUPPORT_SERVO_SOURCE //++CoCo2.37p if (((__btPause) && ((bKey == KEY_PLAY) || (bKey == KEY_SF) || (bKey == KEY_PAUSE) || (bKey == KEY_STEP) || (bKey == KEY_LAN_STUDY))) || ((__bModeCmd == KEY_STEP) && ((bKey == KEY_PLAY) || (bKey == KEY_SF)))) { UTL_PreStartServo(__dwTimeNow,ACTION_CONTINUE); } #endif //#ifdef SUPPORT_SERVO_SOURCE //++CoCo2.37p //DVD_040-1 __bModeCmd= bKey;switch ( bKey ){ case KEY_PLAY: // scan forward->black->play will have no video display // wyc2.04-909S, replace by DISP_DisplayCtrl if ( (bKeyPrevious == KEY_SCF ) && (__bFirstPlay ) ) DISP_DisplayCtrl(DISP_MAINVIDEO, TRUE); //kevin1.11, fix Slow %50 -> Play => unsmooth audio for a while (change sampling freq should be within the period of PCM scale=0) // wyc2.17-909S, for language study if (( bKeyPrevious == KEY_SF ) || (bKeyPrevious == KEY_LAN_STUDY)) CHIPS_OpenAudio( FALSE ); // Micky0.80a, fix reepat ab-> slow->play, the repeat ab OSD won't recover if (__bKeyMessage == MSG_PLAYING) { OSD_OUTPUT_MACRO ( MSG_PLAYING, NULL_0, 3 ); } else { // wyc1.06-909, when scan -> play in AVI mode, we will call _CC_AVIScanToPlayProcess to show "play" OSD. But __bKeyMessage // will be clear to 0 after _CC_MapKeyMessage. So we will see OSD "play" show about 0.5s then clear by follow code. So // we add one variable to not clear "play" OSD here if it flow is AVI scan to play to enhance this problem. if (_bAVIScan2Play == TRUE) { _bAVIScan2Play = FALSE; } else { OSD_OUTPUT_MACRO ( MSG_PLAYING, NULL_0, 0 ); } } /* //CoCo0.72, support JPEG Preview // wyc0.80, change BYTE declare to DWORD declare. if (!__dwMMJPEGPreview) { OSD_OUTPUT_MACRO ( MSG_PLAYING, NULL_0, 3 ); } */ // Micky0.67-909, step->play, just issue command // decoder will write vpts to stc always, must test VOBU_E_PTM case // Read back the recent STC value if (__bModeCmd != KEY_STOP ) { HAL_ReadInfo(HAL_INFO_STC, &__dwSTCValue); } // clear Scan state __bScan=SCAN_NONE; // Micky0.72, if playing, only change macro command if (__btNewTime || (!__btPlaying && !__btPause) ) { _Get_PlayRange (); } else { UTL_TransferCommandID(__bModeCmd); // Micky0.72, must be done first, as CHIPS_OpenAudio will reference it. __btPlaying = TRUE; __btPause=FALSE; } if ( ! __btMute ) CHIPS_OpenAudio( TRUE ); break; case KEY_STOP: __btNewTime=FALSE;#ifdef SUPPORT_JPEG_AUDIO_PLAYING if (__bMMJPEGAudioMode == FALSE)#endif // CHIPS_OpenAudio( FALSE ); // wyc2.77-909p, remove it be KC's suggestion for macrovision enable/disable will make video shake problem. // HAL_TVSetAPS ( NULL_0 ); // LLY0.95, support stop --> resume feature for // [1] CDROM motion file // [2] DVD/ VCD/ CDDA/ CVD/ SVCD title // So, keep the resume time while pre-stop mode and this titles // Notice: DVD resume time calculation method is different. // wyc1.06-909, can't set __dwResumeTime when JPG preview mode, otherwise MM-motion can't resume from resume time if cursor stay in JPG preview file. // It is because preview will issue CC_KeyCommand(KEY_STOP) then play, so when stop from mm-motion file and move cursor to JPG file // to preview mode, then it will re-set __dwResumeTime and it is the reason mm-motion can't resume from resume time. if( (__bCountStop==1) && !(__wDiscType&BOOK_DVD) && (__dwMMJPEGPreview == FALSE) ) { // LLY2.10-1, Keep resume directory & item together for CDROM/ DVDROM title if(__wDiscType & CDROM_M1) { __dwResumeItem = MAKELONG(__wPlayItem, __MMPlayingItem.wDirID); } if(__bAttrPlay == ATTR_AVI) { // LLY1.01, keep current PTS value for DivX // Since, we must give time for parser to get the corresponding sector // (base on index table) HAL_ReadInfo(HAL_INFO_STC, &__dwTemp); __dwResumeTime=__dwTemp/90000; // LLY2.36, keep corresping STC value here to avoid STC/90K= sec, then *90K=STC again __dwGoTimeSTC = __dwTemp; //DBG_Printf(DBG_THREAD_CHEERDVD, DBG_INFO_PRINTF, "Stop STC: %lx, Time: %lx\n", __dwTemp, __dwResumeTime); } // LLY2.05, alwasy keep decoded sector as resume time // for CDROM & DVDROM 's AV or audo file, or SVCD/ CVD/ VCD/ CDDA title else // if( (__bAttrPlay&TYPE_CDROM_AV) || !(__wDiscType & CDROM_M1) ) { // LLY2.35, must keep stop time (in second unit) as resume time for WMA // Since, we must give time for parser to get the corresponding sector // So, must re-calculate it again. if(__bAttrPlay == ATTR_WMA) { // Must /75 since _UTL_CalTime_FromFrameCnt() return value is second*75 __dwResumeTime = _UTL_CalTime_FromFrameCnt()/75; } else // others will keep current decoded sector { // Call API to get current decoded time. __dwResumeTime = UTL_GetDeco
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -