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

📄 linear.c

📁 ct952 source code use for Digital Frame Photo
💻 C
📖 第 1 页 / 共 5 页
字号:
                        // first time                         __bRepeatAB= REPEAT_A;                         __dwTimeB= 0;                        // LLY0.95, keep Time A value in second unit for DivX/ AVI file                        // Since, we must give time for parser to get corresonding sectot ID (base on index table)                        if(__bAttrPlay == ATTR_AVI)                        {                            // LLY1.01, keep time A in sec format from STC/90000.                            HAL_ReadInfo(HAL_INFO_STC, &__dwTemp);                            __dwTimeA=__dwTemp/90000;                            // LLY2.36, keep corresping STC value here to avoid STC/90K= sec, then *90K=STC again                            // LLY2.61, keep A point frame count in a independent variable                            // Since, __dwGoTimeFrameCnt will be used for stop time                            // ie. the value will be changed if repeat A-B --> enter/exit setup (do stop/ resume)                            //__dwGoTimeSTC = __dwTemp;                            __dwTimeA_STC = __dwTemp;                            //printf("Time A STC: %lx\n", __dwTimeA_STC);                        }                        else                        {                            // LLY2.35, keep Time A value in second unit for WMA                            // Since, we must give time for parser to get corresponding sector ID                            if(__bAttrPlay == ATTR_WMA)                            {                                // Must /75 since _UTL_CalTime_FromFrameCnt() return value is second*75                                __dwTimeA=_UTL_CalTime_FromFrameCnt()/75;                            }                            else // Others, keep current decoded sector ID                            {                                // LLY2.05, call API to get current decoded sector                                __dwTimeA = UTL_GetDecodedTime();                            }                            // LLY2.05, also keep the time A's frame count for CDROM/ DVDROM audio only file                            if(__bAttrPlay & TYPE_CDROM_AUDIO)                            {                                // LLY2.35, get decoded frame count from DSP directly                                // LLY2.61, keep A point frame count in a independent variable                                // Since, __dwGoTimeFrameCnt will be used for stop time                                // ie. the value will be changed if repeat A-B --> enter/exit setup (do stop/ resume)                                //__dwGoTimeFrameCnt = UTL_SectorsToFrameCnt(__dwTimeA-__dwTimeBegin);                                //HAL_ReadAM(HAL_AM_FRAME_SAMPLE_SEC_CNT, &__dwGoTimeFrameCnt);                                HAL_ReadAM(HAL_AM_FRAME_SAMPLE_SEC_CNT, &__dwTimeA_FrameCnt);                            }                        }#ifndef NO_DISC_MODE //CoCo2.37p                        if (__wDiscType & BOOK_DVD)                        {                            NV_Action ( ACTION_REPEATAB, __bRepeatAB );                        }#endif //#ifndef NO_DISC_MODE //CoCo2.37p                        OSD_OUTPUT_MACRO ( MSG_REPEATAB, REPEAT_A, 0xFF );                        break;                    case    REPEAT_A:                        // wyc1.06-909, only press KEY_PRPEATAB when REPEATA mode can make MSG_REPEATAB active.                        __bActiveMessage = MSG_REPEATAB;                        __bRepeatAB= REPEAT_AB;#ifndef NO_DISC_MODE //CoCo2.37p                        if (__wDiscType & BOOK_DVD)                        {                            NV_Action ( ACTION_REPEATAB, __bRepeatAB ); // ** TCH1.61a;                        }                        else#endif //#ifndef NO_DISC_MODE //CoCo2.37p                        {                            // LLY2.05, call API to get current decoded sector                            __dwTimeB = UTL_GetDecodedTime();                            /*                            UTL_GetCurrentTime ();                            //LJY1.24a, using UTL_EstimateBufferTime() for code refinement.                            __dwTemp = UTL_EstimateBufferTime();                            __dwTimeB = __dwTimeNow - __dwTemp;                            */                            // LLY1.11, it's un-necessary to minus the time torelence                            // Since, it maybe the old code for 8051 platform.#if 0                            // since in B point need do more check                            // add time torelence                            // so it's possible that the __dwTimeB < __dwTimeA for same track    //                            __dwTimeB-=105L;                            //__dwTimeB-=30L;#endif  // #if 0                        }                        __btPlayFromBegin=FALSE;                        __dwGoToTime=__dwTimeA;                        // wyc1.06-909, when repeat AB message is active, then call OSD to show it.                        if (__bActiveMessage == MSG_REPEATAB)                        {                        OSD_OUTPUT_MACRO(MSG_REPEATAB, REPEAT_AB, 0xFF);                        }                        break;                    case    REPEAT_AB:                            __bRepeatAB= REPEAT_NONE;                            OSD_OUTPUT_MACRO(MSG_REPEATAB, REPEAT_NONE, 1);                            break;                }                return TRUE;    }    return FALSE;}//  *********************************************************************//  Function    :   LINEAR_Program//  Description :   It will process PROGRAM mode ON/OFF, Add/Clear Entry//  Arguments   :   bFunction   : the Program Function//  Return      ://  Side Effect :   It will use the value __wNumberPrevious//  *********************************************************************BYTE LINEAR_Program(BYTE bFunction, BYTE bKey){    switch(bFunction)    {        case    LINEAR_PROGRAM_MODE:                // wyc1.07, support KEY_PROGRAM when JPG slide show.                if ( __btPBC#ifndef NO_DIGEST //LJY1.20, support 4M flash, remove digest                    || __btDIGEST#endif#ifndef NO_DISC_MODE //CoCo2.37p                    || ((__wDiscType & BOOK_DVD)&&(__bNVPlayMode))#endif //#ifndef NO_DISC_MODE //CoCo2.37p                    )// wyc.101_2nd , add define FORCE_SWITCH_NONPBC and add code to support FORCE_SWITCH_NONPBC#ifdef FORCE_SWITCH_NONPBC                // wyc.160#ifndef NO_DIGEST //LJY1.20, support 4M flash, remove digest                if (__btDIGEST) return FALSE;#endif#else                return FALSE;#endif // FORCE_SWITCH_NONPBC                // clear time key                // disable key 10+ before entering PROGRAM mode                __dwTimeKey=0;/* LJY.pc908.060, removed                // PROGRAM / GOTIME can't exist at the same time//alex1.23,20040218 combine gototime , search,bookmark, Remove __btGotoTime , use __bSearhMode in Linear_Program function         //if (__btGoToTime)                if(__bSearchMode)                {   // Clear GOTIME                    //__btGoToTime= FALSE;                    __bSearchMode=SEARCH_MODE_OFF;                    OSD_OUTPUT_MACRO(MSG_SETGOTOTIME, OSD_CANCEL_TIME, 0);                }*/                if (__btPlayingProgram)  //wyc.102, When program playing mode and press KEY_PROGRAM, enter program input/playing mode                {/* LJY.pc908.060, removed                    //second PROGRAM key,                    //already playing program list now                    //show the existing program list now                    // wyc.101 use define to replace number in OSD macro                    //  press program key in program playing mode                    if (__wDiscType & BOOK_DVD)                    {                        OSD_OUTPUT_MACRO(MSG_SETPROGRAM, OSD_DVD_CLEAR_BACKGROUND, 0xFF);                    }                    else                    {                        OSD_OUTPUT_MACRO(MSG_SETPROGRAM, OSD_VCD_CLEAR_BACKGROUND, 0xFF);                    }*/                    // For panel                    // Must set input program mode at last                    __btInputProgram=TRUE;                    return TRUE;                }                // enter program mode                {                    //DVD_051Micky, Number >10                    __wNumberQueue=0x0000;                    // initial the variable and array value for program                    __btInputProgram=TRUE;                    __btProgram= TRUE;                    UTL_ModeInitial ( MODE_PROGRAM );                    // only double program command to clear the program entry data                    if (__bProgramMaxEntry == 0)                    {                        LINEAR_ProgramEntryOperation(LINEAR_CLEAR_ALL_ENTRY,NULL_0,NULL_0,NULL_0);                    }#ifdef    FORCE_CLEAR_LOGO                    if ( __bModeCmd == KEY_STOP )                        UTL_SetPlayMode ( MODE_PLAYMOTION );#endif    // FORCE_CLEAR_LOGO                    return TRUE;                }                return FALSE;        case    LINEAR_PROGRAM_CLEAR:        case    LINEAR_PROGRAM_CLEAR_MIN:                // wyc1.05-2, when pressing KEY_STOP in FM, it will call LINEAR_Program(LINEAR_PROGRAM_CLEAR) to clear program entries. In FM mode we                // don't clear program entries and only need to set __bProgramPlayingIndex to 0 because of we need to re-program playing from beginning.                __bProgramPlayingIndex=0;   //Kevin1.00, add                if (bFunction == LINEAR_PROGRAM_CLEAR_MIN)                    return TRUE;                LINEAR_ProgramEntryOperation(LINEAR_CLEAR_ALL_ENTRY,NULL_0,NULL_0,NULL_0);                __bProgramMaxEntry = 0;                __bProgramCurrentIndex = 0;                __btProgram= FALSE;                // To clear the display of program                __dwTimeKey= 0;              // clear it if had pur "10+" key                __btInputProgram=FALSE;                __btPlayingProgram=FALSE;                __btNextPlayProgram=FALSE;                // wyc1.10-3, clear to normal mode to avoid program variable not identical                // wyc1.10-pro, only clear to normal mode when original is program edit mode. Because JPG                // playing mode don't need to clear to normal mode and need to stay in FM_MENU_NONE mode.                // wyc1.21, fix input number in program playing mode, then UI incorrect problem.                // wyc0.60-909, rename to MM_MENU_XXX                // wyc0.80, remove variable __bMMHide                if ((__wDiscType & CDROM_M1) && (__bMMMenuID == MM_MENU_EDITPROG))                    MM_InitialMenu(MM_MENU_NORMAL, TRUE);// LJY.pc908.060, removed                // wyc0.80, need to call this function, otherwise JPG program playing -> open display mode -> KEY_PROGRAM -> normal JPG playing.                // but program icon in slide show don't disappearred.                OSD_OUTPUT_MACRO(MSG_PROGRAM, 0, 0);    //Kevin1.07a, update PlayingProgram display icon//                OSD_OUTPUT_MACRO (MSG_CLEARPROGRAM, FALSE, 0);      //HLHAN1.01A                return TRUE;        case LINEAR_COUNT_ENTRY:            // wyc.276, make Picture CD mode will not clear repear mode to avoid entering program mode in Picture CD then will not repeat all problem.            if (__wDiscType & CDROM_PICTURECD)                __bRepeat = REPEAT_DISC;            else                __bRepeat = REPEAT_NONE;            __bProgramMaxEntry = 0;            __bProgramCurrentIndex = 0;            __bProgramPlayingIndex = 0;            __wTemp = 0;#ifdef FORCE_SWITCH_NONPBC            // wyc.160            __btPBC = FALSE;#ifndef NO_DISC_MODE //CoCo2.37p            __bNVPlayMode = FALSE;#endif //#ifndef NO_DISC_MODE //CoCo2.37p            OSD_OUTPUT_MACRO(MSG_PBC,__btPBC,0x0);#endif // FORCE_SWITCH_NONPBC            for (__bTemp=0;__bTemp < MAX_PROG_ITEM;__bTemp++)            {                if (__ProgIdxList[__bTemp].wSubIndex)                {                    if (__wTemp == 0)                    {                        __bProgramPlayingIndex = __bTemp;                        __wTemp = 1;                    }                    // use __bTemp+1 is to avoid when only one program entry in index 0,                    // the __bProgramMaxEntry will be NULL_0. So __bProgramMaxEntry is the                    // max. program item+1                    __bProgramMaxEntry = __bTemp+1;                }            }            return TRUE;    }    return FALSE;}/////////////////////////////   protected frunction//  *********************************************************************//  Function    :   _CheckRepeatMode//  Description :   Check the repeat mode status to decide play next or not//  Arguments   :   bKey    , the key action//  Return      :   KEY_NEXT, increase the track number//              :   KEY_PREV, decrease the track number//              :   KEY_NUMBER, play the current track//              :   KEY_STOP, stop playing//  Side Effect ://  *********************************************************************BYTE _CheckRepeatMode(BYTE  bKey){//WINDVD_027 add begin    if ( (bKey!=KEY_NEXT) && (bKey!=KEY_PREV) && (bKey!=KEY_NUMBER) )        return bKey;//WINDVD_027 add end#ifdef  SUPPORT_MP4    // LLY1.50, don't do repeat mode check if current MP4 file playback is not @ boundary    // Since, it still to do next/ prev chapter    if(MM_GetFileType(__MMPlayingItem.wDirID, __wPlayItem)==EXTNAME_MP4)    {        if( (bKey==KEY_NEXT) || (bKey==KEY_PREV) )        {            if( (__wChapter > 1) && (__wChapter<__wChapter_Ns_Title) )            {                return bKey;            }        }    }#endif  // #ifdef SUPPORT_MP4    switch(__bRepeat)    {    case    REPEAT_NONE:        // do not play the next track when        // play to las

⌨️ 快捷键说明

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