⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cc.bak.c

📁 车载电子影音系统dvd播放系统原程序代码
💻 C
📖 第 1 页 / 共 5 页
字号:
    }
    else
    // ** DVD-TCH0.20;
#endif    // _WINDVD
    switch ( __bTemp )
    {
#ifndef NO_MP3
        case    BOOK_CDROM:
                // LLY.274p-1, Check if playable CDROM title
                if ( (__wDiscType & CDROM_M1) )
                    FM_Trigger();

                if (__bThumbnailMode)
                    THUMBNAIL_Trigger(); //CoCo.jpeg

                 break;
#endif
        case    BOOK_CDDA:
        case    BOOK_CDI:
        case    BOOK_VCD:
                if ( __btPBC )
                {
                    if ( ! (__wStatus & ID_ENDLIST ) )
                    {
                        __wStatus= VCD20_Trigger ();
                        if ( __wStatus & ID_ENDLIST )
                        {   // Enter END_LIST, Show LOGO and CDROM Stop
                            OSD_OUTPUT_MACRO ( MSG_ENDLIST, NULL, NULL );
                            
                            // DVD_101bMicky, fix VCD 2.0 pause/slow-> enter end list
                            // the OSD still don't update??
                            // LLY2.37p, assign KEY_STOP from F/W key
                            // To avoid IR key and F/W key conflict issue
                            // __bISRKey = KEY_STOP;
                            __bFWKey = KEY_STOP;
                        }
                    }
                }
                else
                {
// Micky1.20, 4M flash
#ifndef NO_DIGEST
                    // DIGEST mode only calls Trigger Function
                    if ( __btDIGEST )
                    {
                        // DIGEST track view->DIGEST->will be translated as KEY_PLAY
                        // should stop DIGEST display
                        if (__bISRKey!=KEY_PLAY)
                            DIGEST_Trigger ();
                    }
                    else
#endif
                        LINEAR_Trigger ();
                }
                break;

        default:
            break;
    }
/// End Of Section[7]  : The DVD Channel Flow Trigger

// ==============================================================
/// Section[8]  : Monitor the System status
/// 8.1) Monitor The System Hang
/// 8.2) Monitor The Time Update
/// 8.3) Monitor The Buffer Control
/// 8.4) Monitor The Bitstream Info.
// ==============================================================
/// 8.1) Monitor The System Hang
    MONITOR_SystemHang();

// Micky0.90, fix OSD message won't be cleared when time out if tray is opened
// 8.2 is necessary for OSD_TRIGGER_MACRO to clear time out message
/// 8.2) Monitor The Time Update
    UTL_TriggerShowTime ();  // ** TCH0.99-1;

// Micky0.86, fix the problem no disc or open will show cmd_ack_err.(UTL_OutputShowTime-> SERVO_GetCurrentPosition)
// Micky0.90, 8.2 is necessary for OSD_TRIGGER_MACRO to clear time out message
// Section 8.3/8.4 are not necessary when no disc & illegal disc. 
// 8.1 is necessary for auto power down/ screen saver.../ close tray(service_420)??
if ( (__wDiscType != NO_DISC_IN_DRIVE)  &&  !(__bDiscInfo & DISCINFO_UNPLAYABLE) )
{
/// 8.3) Monitor The Buffer Control
// Micky2.80, enable buffer control for DIGEST.
    if ( __btPlaying || __btNewTime 
// Micky1.20, 4M flash
#ifndef NO_DIGEST
    || (__btDIGEST && (!__bSetupMode)) 
#endif
    )
    {
        MONITOR_CheckBuffer ();
// Micky2.37, run time save resume information
// save resume informationat  run time
#ifdef  SUPPORT_RUNTIME_SAVE_RESUME
    if (__bModeCmd != KEY_STOP)
    {
        if ( (__wDiscType & BOOK_DVD) ||
            ( (__wDiscType & BOOK_VCD) && (__wPlayItem >=2) && (__wPlayItem <=99) && (__dwResumeTime !=0) ) || 
            ( (__wDiscType & BOOK_CDDA ) && !(__bCDDA_DTS & CDDA_DISC_CDG) && (__dwResumeTime !=0) )  )
        {
            __dwTemp=UTL_GetSysTimer();
            if ( ( __dwTemp-__dwPreRSM) > (COUNT_10_SEC*3) )
            {
                __dwPreRSM = __dwTemp;
                if (__wDiscType & BOOK_DVD)
                {
                    NV_RSMControl ( STATUS_SAVE );
                }

                if ( (__wDiscType & BOOK_DVD) && (__bDomain != TT_DOM) )
                {
                }
                else
                {
                    _Save_Resume_Information();
                }
            }
        }
    }
#endif  //#ifdef  SUPPORT_RUNTIME_SAVE_RESUME
/// End Of Section[8]  : Monitor the System s
    }   // __btPlaying

/// 8.4) Monitor The Bitstream Info.
    // ** TCH0.99-1; begin...
    // every 1 second to on/off the message for encrypt
    if ( (UTL_GetSysTimer () > _dwTimerCount_MainLoop) )
    {
        // Move from original Timer. Monitor Video or Audio
        MONITOR_VideoStream();
        MONITOR_AudioStream();
        _dwTimerCount_MainLoop = UTL_GetSysTimer() + COUNT_1_SEC;
    }
    // ** TCH0.99-1; end...
}
/// End Of Section[8]  : Monitor the System status
// ==============================================================
/// Section[9]  : Monitor The Tray Status
/// 9.1) Check Tray Open by extra force(such as Eject Button)
/// 9.2) Check Tray was really closed(By IR Key or extra force)
// ==============================================================
    // Micky2.37, move tray open/close checking into function 
    MEDIA_MonitorStatus();
/// End Of Section[9]  : Monitor The Tray Status
/// ******  DVD Channel Sections Only End  *********************

MAIN_LOOP_END:
//LJY0.86, to add Service_420() in main loop. It can also cover the problem of servo spin reversely in power-down mode.
// Micky1.05, only call it when CT908 mode.
#ifndef  INPUT_PATH_HOSTIF
    {
        extern void Service_420(void);
        Service_420();
    }
#endif

#ifdef  SYSTEM_8051
    continue;   // continue the while loop.
#else
    return;
#endif
}   // while (1)    - main-loop
}   // main ()

//  *********************************************************************
//  Function    :   CC_KeyCommand
//  Description :   Process KEY_PLAY, KEY_STOP, KEY_FF, KEY_SF, KEY_SCF, KEY_SCB
//                          KEY_STEP, KEY_FREEZE
//  Arguments   :   bKey    : The key definition
//  Return      :   TRUE only. ???
//  Side Effect :   It'll record __bModeCmd and open __btPlayEnd
//  *********************************************************************
BYTE CC_KeyCommand ( BYTE bKey )
{
    BYTE        bKeyPrevious;
    BYTE        bTemp;

    // Only fast/npf mode can't toggle?
    if ( ( (bKey==KEY_FF) || (bKey==KEY_PLAY)) && (__bModeCmd==bKey) && (!__btPause) )
    {
        OSD_Output(MSG_INVALID, OSD_ERR_KEY, 1);
        return TRUE;
    }

// DVD_099cMicky, for pause->other modes, must re-get next time position for play
// or it will cause data discontinue.(as mian-loop may update __dwTimeNow
// fix pause->slow/fast/scf's block
    if (__btPause && !__btNewTime)  // repeat a-b will simulate pause->play
    {
        UTL_GetCurrentTime();
        __dwTimeNow++;
//LJY1.23, LJY1.11d, play from the time before buffer was cleared when pause->AST switching->play.
#ifdef SUPPORT_ANTISHOCK
#ifdef SUPPORT_ANTISHOCK_SOFT_RESET_VIDEO
        if(__btResetBuffer)
        {
            __btResetBuffer = FALSE;
            __dwTimeNow = __dwTimeRecover;
        }
#endif        
#endif
    }

    bKeyPrevious= __bModeCmd;

    // optimize codes for step/fast/scan/slow/freeze
    if ( ( bKey != KEY_PLAY ) && ( bKey != KEY_STOP ) )
    {
#ifdef  _WINDVD
        if (__wDiscType & BOOK_DVD)
        {
            // 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) )     // ** TCH0.401;
                    return INVALID_KEY;
            }
            else
            if (bKey == KEY_SCB)
            {
                if (! NV_QueryUOP(UOP_CAN_BACKWARD_SCAN))       // ** TCH0.401;
                    return INVALID_KEY;
            }
        }
#endif
        bTemp= UTL_CheckPlayItemMode ( __wPlayItem );

        // don't allow in STILL mode or CDDA mode
        // LLY.274, check playing mode has updated
        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 );
        }
    }   // The ModeCmd except PLAY and STOP
// WinVCD
    // must release the auto pause state
    {
        extern BYTE __bVCD20Status;
        __bVCD20Status=VCD20_NORMAL;
    }
    // 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_SPST, TRUE) ;
            else                // freeze-> pause-> freeze, stay freeze
            {
                // do nothing
            }
        }
        else    // play-> freeze, enter freeze
        {
            HAL_Display(HAL_DISPLAY_SPST, FALSE) ;
        }

    }
    // check leave freeze mode
    else if ( __bModeCmd == KEY_FREEZE )
    {
        HAL_Display(HAL_DISPLAY_SPST, TRUE) ;

    }

    //DVD_040-1
    __bModeCmd= bKey;

// Micky2.30-2, fix JPEG small buffer threshold invalid.
// must do the setting after __bAttrPlay is set.
/*    
    // Micky0.87, set Video over/underflow threshold value for general command.
#ifdef  NEW_AUDIO_BUFFER_CONTROL
    if (__bModeCmd != KEY_STOP)
    if (__bModeCmd == KEY_STEP)
    {
        __dwVOBuffer = 20000L;
        __dwAOBuffer = 2000L;   // 28C is 6500L
        W99AV_SetBufferThreshold(W99AV_VOVERFLOW, __dwVOBuffer );   // for mini-DVD
        W99AV_SetBufferThreshold(W99AV_AOVERFLOW, __dwAOBuffer );
    }
    else
    {
// Micky1.07, lower the overflow threshold.
//    __dwVOBuffer = __dwW99AVVBUFFSIZE - 12000L; // reference 28C.
        __dwVOBuffer = __dwW99AVVBUFFSIZE - 20000L; // reference 28C.
        __dwVUBuffer = 8000;
        // the audio overflow/ underflow value is different 
        // for overflow, only reference audio buffer 1.
        // Micky0.91, adjust threshold for different disc.
        // set audio overflow as 3/4 audio buffer1.
        __dwAOBuffer = (__dwW99AVABUFFSIZE*3)/ 4 ;
        // Micky0.91, adjust threshold for different disc.
        // set audio underflow threshold higher(MP3 high bitrate has problem)
//        __dwAUBuffer = 0x2000L;
        __dwAUBuffer = __dwAOBuffer/2; //LJY2.30a, let AU=AO/2;

        if (__bAttrPlay == ATTR_JPG) //CoCo2.30, set buffer size to fix the Progress JPEG problem
        {
            __dwVOBuffer = (__dwW99AVVBUFFSIZE*3)/4;
            __dwVUBuffer = __dwW99AVVBUFFSIZE/4;
            __dwAUBuffer = __dwW99AVABUFFSIZE/4 ;
        }
        
#ifdef  SUPPORT_WMA
        //Kevin1.22, fix WMA de

⌨️ 快捷键说明

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