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

📄 linear.c

📁 ct952 source code use for Digital Frame Photo
💻 C
📖 第 1 页 / 共 5 页
字号:
                    // LLY0.83b-2, Let MM_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                    // wyc0.60-909, rename it.                    if(MM_ActionForChangeTrack(KEY_NEXT, __wPlayItem)==MM_ACTION_CONTINUE)                    {//winnie2.51, added to show JPG from SPI flash and key press NEXT                    #ifdef  SUPPORT_ENCODE_JPG_PICTURE                       if(__SF_SourceGBL[0].bSourceIndex == SOURCE_SPI)                         LINEAR_JPGAction(KEY_NEXT,0);                        else                    #endif                        {                        // wyc1.07a. remove variable __bKeyRepeat, so update code to __wPlayItem++ to play next item.                        __wPlayItem ++;                        if ( __wPlayItem > __wTrackEnd )                        {                            __wPlayItem= __wTrackBegin;     // roll back                            // ** 2.76-TCHM; begin... Force to reset ICs for long-time play under VCD title.                            if ( __wDiscType & BOOK_VCD )                                __bModePlay= MODE_PLAYUNKNOW;                            // ** 2.76-TCHM; end...                        }                        }                    }                }                else if (bKey == KEY_PREV)                {                    // LLY1.50, add previous chapter control for Nero Digital#ifdef  SUPPORT_MP4                    if( MM_GetFileType(__MMPlayingItem.wDirID, __wPlayItem) == EXTNAME_MP4 )                    {                        // if exist previous chapter, change to it                        if(__wChapter > 1)                        {                            // [1] Calculate the desired time for previous changer beginning                            __dwGoToTime = PARSER_GetMP4ChapterTime(PARSER_MP4_CHAP_PREV);;                            // LLY2.36, keep corresping STC value here to avoid STC/90K= sec, then *90K=STC again                            __dwGoTimeSTC = __dwGoToTime*90000;                            // [2] Let it go the same flow of GoTime Action                            __btNewTime=TRUE;                            // [3] Transfer the command as KEY_PLAY                            __bModeCmd = KEY_PLAY;                            return TRUE;                        }                    }#endif  // #ifdef SUPPORT_MP4                    // 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 MM_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(MM_ActionForChangeTrack(KEY_PREV, __wPlayItem)==MM_ACTION_CONTINUE)                    {//winnie2.51, added to show JPG from SPI flash and key press PREV                    #ifdef  SUPPORT_ENCODE_JPG_PICTURE                       if(__SF_SourceGBL[0].bSourceIndex == SOURCE_SPI)                         LINEAR_JPGAction(KEY_PREV,0);                        else                    #endif                        {                        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"        #ifdef  SUPPORT_ENCODE_JPG_PICTURE         if(__SF_SourceGBL[0].bSourceIndex == SOURCE_SPI) //winnie2.51, added to show JPG from SPI flash and key press Number                LINEAR_JPGAction(KEY_NUMBER,wTrackNO);         else        #endif            {            // 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 MM_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=MM_ActionForChangeTrack(KEY_NUMBER, wTrackNO);            // wyc0.60-909, rename it.            if(__bTemp==MM_ACTION_INVALID)            {                return FALSE;            }            else if(__bTemp==MM_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            CC_KeyCommand ( KEY_PLAY ); //???            OS_DelayTime ( COUNT_HALF_SEC ); //CoCo1.20, reduce code size//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;            // wyc2.04-909S, replace by DISP_DisplayCtrl            DISP_DisplayCtrl(DISP_MAINVIDEO, 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???    // wyc.172-CDDA, when CDDA auto play across tracks we set some flags to make execute command play successful.    // wyc2.37, MEDLEY pure CDDA can't do stop, otherwise audio not continuously.#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// wyc.172-CDDA, remove follow code to save time for CDDA medley title.#ifndef SUPPORT_PLAY_MEDLEYCDDA    if ( (OS_GetSysTimer()- __dwPreGetTime) > (COUNT_300_MSEC) ) // *** 0.45;//BCB end    {        __dwPreGetTime=OS_GetSysTimer();        UTL_GetCurrentTime ();    }    else        return ERR_ERROR;#else    __dwPreGetTime=OS_GetSysTimer();    UTL_GetCurrentTime ();#endif// end ..    // LLY1.01, Why need to keep resume time each LINEAR_Trigger()    // Record RESUME function    //__dwResumeTime=__dwTimeNow;/* Alan1.06 remove//DVD_046-1DVDIF#ifdef  SUPPORT_CDIF    if (__bCurrentIF==BITSTREAM_CDIF)        __wTemp= UTL_EstimateSectors ( COUNT_500_MSEC );#endif*/

⌨️ 快捷键说明

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