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

📄 linear.c

📁 车载电子影音系统dvd播放系统原程序代码
💻 C
📖 第 1 页 / 共 5 页
字号:
                        }
                    }
                }
                else if (bKey == KEY_PREV)
                {
                    // wyc1.10, because set this __dwTimeKey to 0 will make F/W to clear the input number, so now not to 
                    // clear it to allow user can input number by 10+ without F/W clear
                    //__dwTimeKey= 0;
                    // LLY0.83b-2, Let FM_Action(KEY_NEXT) handle NEXT action
                    // Because, __wPlayItem meaning maybe different between CT9928AF & CT908
                    // CT9928AF: __wPlayItem index from 1 ~ Total files within disc
                    // CT908: __wPlayItem index from 1 ~ Total files within current directory
                    // if nothing is done within this API, then go original flow
                    if(FM_Action(KEY_PREV, __wPlayItem)==FM_ACTION_CONTINUE)
                    {
                        if ( __wPlayItem )
                        {
                        // wyc1.07a. remove variale __bKeyRepeat, so update code to __wPlayItem-- to play previous item.
                            __wPlayItem --;
                            if ( __wPlayItem < __wTrackBegin )
                                __wPlayItem= __wTrackEnd;
                        }
                        else    // why __wPlayItem = 0 ?, error protection
                            __wPlayItem= __wTrackEnd;
                    }
                }
            }
            break;

        case    KEY_NUMBER:     // play the track specified by "wTrackNO"
            // mark the follow code
            if ( ! wTrackNO )   // means play current __wPlayItem
                break;          // do not change the __wPlayItem value

            // LLY0.83b-2, don't assign the input number to __wPlayItem
            // Because, it maybe out-of-range !!
            // new track number is assigned
            //__wPlayItem= wTrackNO;

            // LLY0.83b-2, Let FM_Action(KEY_NUMBER) handle NUMBER action
            // Because, __wPlayItem meaning maybe different between CT9928AF & CT908
            // And, the desired play item value will be kept in __wPlayItem
            // CT9928AF: __wPlayItem index from 1 ~ Total files within disc
            // CT908: __wPlayItem index from 1 ~ Total files within current directory
            // if nothing is done within this API, then go original flow
            __bTemp=FM_Action(KEY_NUMBER, wTrackNO);

            if(__bTemp==FM_ACTION_INVALID)
            {
                return FALSE;
            }
            else if(__bTemp==FM_ACTION_CONTINUE)
            {
                // for VCD, the __wPlayItem=TrackNO+1;
                if ( __wDiscType & BOOK_VCD )
                    wTrackNO++;          // Mapping to actual Track

                // Check the valid range in one title
                if ( wTrackNO > __wTrackEnd )
                {
// wyc.170a, add define to show invalid when input number out of range
#ifdef NUMBER_OUTRANGE_INVALID
                    OSD_Output(MSG_INVALID, OSD_ERR_KEY, 1 );
                    return FALSE;
#else    
                    __wPlayItem= __wTrackEnd;
#endif //
                }
                else if( wTrackNO < __wTrackBegin )
                {
#ifdef NUMBER_OUTRANGE_INVALID
                    OSD_Output(MSG_INVALID, OSD_ERR_KEY, 1 );
                    return FALSE;
#else    
                    __wPlayItem= __wTrackBegin;
#endif //
                }
                else
                    __wPlayItem=wTrackNO;
            }
            break;

        default:
            return FALSE;
            break;
    }


// DVD_099bMicky, always swicth to NPF when change track
#ifdef FORCE_CHANGE_TRACK_NORMAL_PLAY
    if (__bModeCmd != KEY_PLAY)
#else
    // Clear STEP and FREEZE status when change track
    if ( (__bModeCmd == KEY_STEP) || (__bModeCmd == KEY_FREEZE) )
#endif
    {
        __bModeCmd=KEY_PLAY;
        //__btVideoFreeze=FALSE;
    }

    // LLY0.83b-2, integrated this procedure into KEY_NUMBER case
    // Because, __wPlayItem value has updated if the input key is out-of-range
    /*
    // Check the valid range in one title
    if ( __wPlayItem > __wTrackEnd )
    {
// wyc.170a, add define to show invalid when input number out of range
#ifdef NUMBER_OUTRANGE_INVALID
        OSD_Output(MSG_INVALID, OSD_ERR_KEY, 1 );
        return FALSE;
#else    
        __wPlayItem= __wTrackEnd;
#endif //
    }

    if ( __wPlayItem < __wTrackBegin )
    {
#ifdef NUMBER_OUTRANGE_INVALID
        OSD_Output(MSG_INVALID, OSD_ERR_KEY, 1 );
        return FALSE;
#else    
        __wPlayItem= __wTrackBegin;
#endif //
    }
    */
// end ..
    //////////////////////////////////

    bCmd= __bModeCmd;       // save current play mode
    if ( __bModeCmd == KEY_STOP )       // play the track from stop mode
    {
        // STOP->track->PLAY
        bCmd= KEY_PLAY;     // *TCH** 97.7.30;
    }
    else    // Playing->STOP->change track
    {
        // Simple the code, SCF just run through KEY_STOP

        // SCB->PREV track,  need take special process
        // 1. play the track beginning, for bitstream info.
        // 2. SCB from the track end
        if ( __bModeCmd == KEY_SCB )
        {
            // Do SCB operation
            BIT     btMute; // store it temporary

            btMute= __btMute;
            __btMute= TRUE;

            UTL_ForceChangeTrack ( __wPlayItem );
            // must show track number in scan backward cross track
            UTL_ShowTrack(MSG_TRACK, __wPlayItem, 3);

            __btPause= TRUE;
            __btPlaying= FALSE;

            // play from track end
            __dwTimeNow= __dwTimeEnd- 750L;
// DVD_276Micky, bit reduce
            //do not show play when scan back cross track
///            __btTrueKey=FALSE;

            // avoid two I-Frame display
            // wyc1.10-3, don't support this message now.
            //OSD_Output(MSG_IGNORENEXT, 1, 0);
            CC_KeyCommand ( KEY_PLAY ); //???
            UTL_DelayTime ( COUNT_HALF_SEC, FALSE );
//DVD_049Micky
// TCH move from below.
            __btMute= btMute;   // ** TCH0.49; move from below, other KeyCommand Can't enable Audio
            CC_KeyCommand ( KEY_SCB );

//            __btMute= btMute;
            HAL_Display(HAL_DISPLAY_VIDEO, TRUE);

            return ERR_NOERR;
        }
        else    // Non KEY_SCB
        // wyc.172-CDDA, when meet CDDA medley title, we not execute stop command to save spend time when play CDDA auto across tracks.
        {
//LJY1.23, LJY1.11b-2, no need???(it will cause audio buffer won't be cleared while using number key to back to track1, and is not good for antishock mode)
            // wyc2.37, MEDLEY pure CDDA can't do stop, otherwise audio not continuously.
#ifdef SUPPORT_PLAY_MEDLEYCDDA
            if ((__bCDDA_DTS != CDDA_PURE) || (__bKeySource != KEY_FROM_NONE))
#endif //                
                CC_KeyCommand ( KEY_STOP );
        }
    }
//LJY1.23, LJY1.11b-2, no need???
    // wyc2.37, MEDLEY pure CDDA can't do stop, otherwise audio not continuously.
    // wyc.172-CDDA, when CDDA auto play across tracks we set some flags to make execute command play successful.
#ifdef SUPPORT_PLAY_MEDLEYCDDA   
    if ((__bKeySource == KEY_FROM_NONE) && (__bCDDA_DTS == CDDA_PURE))
    {
        __btPlaying = FALSE;
        __bModeCmd = KEY_STOP;
        __bCDDAAutoChTrk = TRUE;
    }
#endif //    
    CC_KeyCommand ( bCmd );
    __btPlayEnd = FALSE ;

    return ERR_NOERR;
}

//  *********************************************************************
//  Function    :   LINEAR_Trigger
//  Description :   Check PlayEnd if player is playing...
//  Arguments   :   NONE
//  Return      :
//  Side Effect :
//  *********************************************************************
BYTE LINEAR_Trigger ()
{
    // LLY.099d, the invalid case for trigger while:
    // [1] F/W is non-playing, or
    // [2] Playing new time case, ex GOTOTIME, RESUME, REPEAT AB
    // Otherwise, it will cause GOTOTIME error while __dwTimeNow > __dwTimeEnd
    // __dwTimeNow: keep last playing time
    // __dwTimeEnd: keep the playing end time which will be played
    if ( ! __btPlaying || __btNewTime)
    {
        return ERR_ERROR;
    }

    // *TCH** 97.7.30; ??? How about UTL_OutputShowTime
//BCB begin
//    if ( (__dwCountSystem- __dwPreGetTime) > (COUNT_500_MSEC+COUNT_250_MSEC) )
// The time won't change sec by sec, (<=300 ms.)
///    if ( (__dwCountSystem- __dwPreGetTime) > (COUNT_100_MSEC+COUNT_200_MSEC) ) // *** 0.45;
// wyc.172-CDDA, remove follow code to save time for CDDA medley title.
#ifndef SUPPORT_PLAY_MEDLEYCDDA
    if ( (__dwCountSystem- __dwPreGetTime) > (COUNT_300_MSEC) ) // *** 0.45;
//BCB end
    {
        __dwPreGetTime=__dwCountSystem;
        UTL_GetCurrentTime ();
        
    }
    else
        return ERR_ERROR;
#else
    __dwPreGetTime=__dwCountSystem;
    UTL_GetCurrentTime ();
#endif
// end ..
    // Record RESUME function
    __dwResumeTime=__dwTimeNow;

//DVD_046-1DVDIF
#ifdef  SUPPORT_CDIF
    if (__bCurrentIF==BITSTREAM_CDIF)
        __wTemp= UTL_EstimateSectors ( COUNT_500_MSEC );
    else
#endif
    __wTemp= 0;

    /*
    // ** TCH0.26; begin...
#ifdef    INPUT_PATH_CDIF
    // ** S-TCH;
    __wTemp= UTL_EstimateSectors ( COUNT_500_MSEC );
#else
    __wTemp= 0;      // ATAPI/ HOSTIF is accurate, so don't need the torelence
#endif    // INPUT_PATH_CDIF
    // ** TCH0.26; end...
    */

//    if ( __dwTimeNow >= (__dwTimeEnd- 10L) )
// f/w 0.45(11.20.97, f/w 0.42)
// MPEG track to CD-DA track
///    if ( __dwTimeNow >= (__dwTimeEnd- 100L) )
    if ( __dwTimeNow >= (__dwTimeEnd- __wTemp) )
    {

        // DVD_161Micky, wait CD-DA data  buffer end.
        // so the track end display time won't less than one second.
        // LLY.274p, check playing mode method has updated
        //if (__bModePlay & MODE_PLAYCDDA)
        if(__bAttrPlay == ATTR_CDDA)
        {
            __bSystemTimer=0;
//LJY1.21, LJY1.11, let CDDA can play till track end.                    
#ifdef SUPPORT_ANTISHOCK
            if(__bCDDA_DTS & CDDA_BITSTREAM_PURE)
            {
                W99AV_ReadDM(W99AV_DM_AUDIO2_REMAIN, &__dwTemp);
            }
            else
            {
                W99AV_ReadInfo(W99AV_INFO_AUDIO_REMAIN, &__dwTemp); //LJY1.24-3, DTS not support large buffer
            }
            if(__dwTemp > 10000)
                return ERR_ERROR;
#endif
            while (__bSystemTimer < COUNT_300_MSEC)
            {
#ifdef SUPPORT_ANTISHOCK
            if(__bCDDA_DTS & CDDA_BITSTREAM_PURE)
            {
                W99AV_ReadDM(W99AV_DM_AUDIO2_REMAIN, &__dwTemp);
            }
            else
            {
                W99AV_ReadInfo(W99AV_INFO_AUDIO_REMAIN, &__dwTemp); //LJY1.24-3, DTS not support large buffer
            }

⌨️ 快捷键说明

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