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

📄 linear.c

📁 ct952 source code use for Digital Frame Photo
💻 C
📖 第 1 页 / 共 5 页
字号:
    if (PARSER_QueryEvent( 0, PARSER_EVENT_COMPLETED, FALSE)) //LJY0.67, check parsing OK.(for bitstream end detection)    {        //LJY0.65, set it TURE for waiting buffer to be consumed.//        __btPlayEnd = TRUE;        HAL_ReadInfo(HAL_INFO_VIDEO_REMAIN, &__dwTemp);        if(__dwTemp > 0x100)        {            return ERR_NOERR;        }        // 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)        {            __dwSystemTimer=0;//LJY1.21, LJY1.11, let CDDA can play till track end.                HAL_ReadInfo(HAL_INFO_AUDIO_REMAIN, &__dwTemp);        // wyc.172-CDDA, remove follow code to save time for playing CDDA medley title.#ifndef SUPPORT_PLAY_MEDLEYCDDA				if (__dwTemp > 0x30)#else				if (__dwTemp > 10000)#endif //					return ERR_ERROR; //LJY.pc908.060            UTL_OutputShowTime();        }        //CHIPS_OpenAudio (FALSE);/* Alan1.06 remove        // wyc.172-CDDA, if play CDDA medley title we not mute the audio when across tracks.//LJY1.21, LJY1.11, let VCD can play till track end.#ifdef SUPPORT_ANTISHOCK        else        {            //LJY1.11d, ~0.5sec tolerance for track change.           //LJY1.24a, using UTL_EstimateBufferTime() for code refinement.            __dwTemp = UTL_EstimateBufferTime();            if((__dwTimeNow - __dwTemp) < (__dwTimeEnd- __wTemp))                return ERR_ERROR;        }#endif*/#ifdef SUPPORT_PLAY_MEDLEYCDDA        if (!(__wDiscType & BOOK_CDDA))#endif //        CHIPS_OpenAudio (FALSE);        __dwTimeNow= __dwTimeBegin;        __btPlaying= FALSE;        __btPlayEnd= TRUE;        PARSER_QueryEvent( 0, PARSER_EVENT_COMPLETED, TRUE); //LJY0.67, clear the flag of "PARSER_EVENT_COMPLETED".        // PlayEnd, must check repeat AB        //#if 1 to disable REPEATAB cross track    }    else if (__btIntroMode)    {        if ( __dwTimeNow > (__dwTimeBegin + __dwIntroPlayTime) )        {        __dwTimeNow= __dwTimeBegin;        __btPlaying= FALSE;        __btPlayEnd= TRUE;        CHIPS_OpenAudio (FALSE);        }    }    if ( ! __btPlayEnd )        return ERR_ERROR;    // STEP mode can't allow from the start of playing track    if  ( (__bModeCmd == KEY_STEP) || (__bModeCmd==KEY_FREEZE) )    {        __bModeCmd=KEY_PLAY;        //__btVideoFreeze=FALSE;    }    //Alan1.02a, Bug #286    OS_DelayTime(COUNT_50_MSEC); //CoCo1.20, reduce code size    // wyc.172-CDDA, we add a parameter for CDDA playing, when 1 to represent playing across    // tracks automatically. 0 means press keys to across tracks.    LINEAR_ChangeTrack(KEY_NEXT, 1);    return ERR_NOERR;}//  *********************************************************************//  Function    :   LINEAR_PlayItem//  Description :   Will get the range of __wPlayItem, and start play//  Arguments   :   None////  Return      :   None//  Change      :   __wPlayItem//  Side Effect ://  *********************************************************************void LINEAR_PlayItem(){    // Pause->Playing    // do not re-initial the play range    // just resume from the current time(__dwTimeNow)    if ( __btPause )    {//        if(__dwTimeNow==0)//            printf("[1] Play Item w/ zero\n");        UTL_PlayItem (__wPlayItem, __dwTimeNow );    }    else    // Stop->Playing    {        // Micky1.07-2, DVD only need the action that UTL_PlayItem.        // DVD PGM->play->next(auto or user key)-> will call LINEAR_ChangeTrack-> NV_TitlePlay        // CC_KeyCommand->Get_PlayRange-> LINEAR_PlayItem-> only need do reset+command.#ifndef NO_DISC_MODE //CoCo2.37p        if (__wDiscType & BOOK_DVD)        {            // Micky1.10, fix stop->program-> play, always play TT/CC 1/1.            // For DVD, RESUME-> PLAY, use common path            // For VCD, RESUME-> KEY_GOTOTIME_PLAY            // PGM + RESUME, RESUME should be high priority            if ( __bModeCELLTimeSearch != CELL_TIME_BEGIN )            {                UTL_PlayItem (__wPlayItem, 0 );                return;            }        }#endif //#ifndef NO_DISC_MODE //CoCo2.37p        // 1. for PROGRAM mode,        // first must get Program entry, and mapping to __wPlayItem        // Must send program index for next track        if ( __btPlayingProgram )        {            // wyc.pro __wProgramData[0] -> __bProgramMaxEntry            if ( __bProgramMaxEntry )    // Program has entries            {                // wyc.pro to let DVD can run program playing from stop mode#ifndef NO_DISC_MODE //CoCo2.37p                if (__wDiscType & BOOK_DVD)                {                    __bTemp = _LinearEntryOperation(LINEAR_FIND_ENTRY,1);                    if (__bTemp == 1)                    {//Kevin0.86, __bTitle/__wChapter for font mode / GDI mode program UI                        __bTitle = __ProgIdxList[__bProgramPlayingIndex].bMainIndex;                        __wChapter = __ProgIdxList[__bProgramPlayingIndex].wSubIndex;                        NV_TitlePlay(__bTitle,__wChapter);                        //Ming0.72, Must restore the command before next play in PROGRAM mode.                        // TODO: Must review all the codes which call audio reset.                        UTL_TransferCommandID(__bModeCmd);                    }                    else                        __bFWKey = KEY_STOP;                }                else#endif //#ifndef NO_DISC_MODE //CoCo2.37p                {//Kevin0.86, __wPlayItem for font mode / GDI mode program UI                    __MMPlayingItem.wDirID = __ProgIdxList[__bProgramPlayingIndex].bMainIndex;   //for FM use only			 __wPlayItem= __ProgIdxList[__bProgramPlayingIndex].wSubIndex;                    // for VCD, the __wPlayItem=TrackNO+1;                    if ( __wDiscType & BOOK_VCD )                        __wPlayItem++;                }            }//DEBUG            // must debug, will come here???            else        // Program has no entry            {                // DVD_100aMicky, clear __btProgram first                // as panel will reference it from panel 2.00                /*__btProgram= FALSE;         // no recording program-data                __btPlayingProgram = FALSE;                __bMMMenuID = FM_MENU_NORMAL;*/                // wyc1.10-3, clear all program variables to avoid sometimes the UI in program mode but __btProgram is FALSE.                LINEAR_Program(LINEAR_PROGRAM_CLEAR,NULL_0);//                OSD_OUTPUT_MACRO(MSG_CLEARPROGRAM, FALSE, 0); //CoCo.101            }        }        // 2. for Random mode        // must random give a __wPlayItem        if ( __btRandom )        {#ifndef  NO_MP3            if (__wDiscType & CDROM_M1)            {                // wyc1.07, because old method only search 100 times to try to find playable files dir, and __dwCountSystem will be similar                // when searching this 100 times. So it is possible of finding no playable dir in this searching and __MMPlayingItem.wDirID will be assign                // a unknown value. So add protection to make sure we can get a playable dir index after this loop.                // wyc0.85a, use new structure because of supporting sort/filter now.                __MMPlayingItem.wDirID = (BYTE)(OS_GetSysTimer() % __bMMTotalDirs);                while (__pMMFilterFilesOfDir[__MMPlayingItem.wDirID] == 0)                {                    // wyc1.21, the old method to compute directory / files have bugs and will cause Picture CD go wrong                    // dir / file in random mode. Modify to fix it.                    __MMPlayingItem.wDirID++;                    if ( __MMPlayingItem.wDirID >= __bMMTotalDirs)                        __MMPlayingItem.wDirID = 0;                }                __wPlayItem = (WORD)(OS_GetSysTimer() % __pMMFilterFilesOfDir[__MMPlayingItem.wDirID]);                __wPlayItem+= __wTrackBegin;            }            else#endif            {                __wPlayItem= (WORD)(OS_GetSysTimer() % (__wTrackEnd- __wTrackBegin+ 1));                __wPlayItem+= __wTrackBegin;            }        }        //DVD_047        // for DVD, don't call this, as it will clear current time as 0        // cause KEY_NEXT/PREV will show time 0 then chapter time        if ( !(__wDiscType & BOOK_DVD) )            UTL_ShowTrack ( MSG_TRACK, __wPlayItem, 3 );        // play the __wPlayItem from the beginning#ifndef NO_MP3        if (__wDiscType & CDROM_M1)        {#ifdef  SUPPORT_ENCODE_JPG_PICTURE			if(__SF_SourceGBL[0].bSourceIndex!= SOURCE_SPI) //winnie2.51,the jpg can't do MM_PlayItem from SPI flash				MM_PlayItem(__wPlayItem);#else            MM_PlayItem(__wPlayItem);#endif //SUPPORT_ENCODE_JPG_PICTURE			        }#endif  // #ifndef NO_MP3        // LLY1.01, let CDROM motion go different path        // Since, F/W need to pre-scan some necessary information first        if(__wDiscType & CDROM_M1)        {            if( UTL_CheckPlayItemMode(__wPlayItem)==MODE_PLAYMOTION )            {                // Do initial before playback a new item                UTL_Init_PlayItem(__wPlayItem);                // LLY1.02, check previous and new play item & directory are same                // And, keep desired play item & dir into __wPrevPlayItem and __wPrePlayDir if not same                // to identify previous and new play item & direcory are same                if( (__wPrevPlayDir==__MMPlayingItem.wDirID) && (__wPrevPlayItem==__wPlayItem))                {                    __bSameItem=TRUE;                }                else                {                    __bSameItem=FALSE;                }#ifdef SUPPORT_SERVO_SOURCE //++CoCo2.37p                // LLY1.11, pre-start servo first to avoid servo @ stop state                // Since, motion file pre-scan action will need servo read data action                // And, our normal code will do servo pre-start @ UTL_Start_PlayItem()                UTL_PreStartServo(__dwTimeNow, ACTION_SKIP);#endif //#ifdef SUPPORT_SERVO_SOURCE //++CoCo2.37p                // LLY1.20, integrate parsing SP file action into _MM_MotionTrigger()#if 0//def  SUPPORT_CHAR_SUBPICTURE                // LLY1.11, parsing AVI Subpicture File while playback the non-same AVI file                // Notice: current code assume CHAR_SP_ParserSPFile will be done before AVI file parsing. Otherwise,                // (1) Index table will be destroyed since INFOFILTER_DumpSector() using same DRAM of index table                // (2) SP related setting will be wrong since it will be set within UTL_Read_PreScan_Info(PRESCAN_AVI_INFO)                if(!__bSameItem && __bAttrPlayNew==ATTR_AVI)                {                    CHAR_SP_ParseSPFile();                    printf("Parser SP File\n");                }#endif                // LLY1.20, enable Data Disc motion state as prescan mode to let it can go _MM_MotionTrigger()                // Notice: don't use __bAttrPlay = ATTR_PRESCAN_INFO method                //         Otherwise, we can't integrate SP file parsing into pre-scan stage.                __bMotionState = MOTION_STATE_PRESCAN;#if 0                // LLY1.02, set playing mode attribute as prescan CDROM motion information                __bAttrPlay=ATTR_PRESCAN_INFO;#endif  // #if 0                return;            }        }        UTL_PlayItem (__wPlayItem, 0);    }}//  *********************************************************************//  Function    :   LINEAR_Number//  Description ://  Arguments   :   bNumber     : The//  Return      :   TRUE, number is valid, and perform action//              :   FALSE, number is invalid or out of range//  Change      ://  Side Effect ://  *********************************************************************

⌨️ 快捷键说明

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