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

📄 linear.c

📁 ct952 source code use for Digital Frame Photo
💻 C
📖 第 1 页 / 共 5 页
字号:
//////////////////////////////////////////////////////////////// ***** Big Modification History Area *****// LLY.274p, some big modification:// [1] Rename all MP3 relative info. because module name has changed !!//  - MP3_ProcessHighLight()  -->  FM_ProcessHighLight()  --> MM_ProcessHighLight//  - __wTotalAlbums  --> __wFMTotalDirs;// Micky2.80a//  - remove MULTI_DISC_SYSTEM codes// LLY2.80a//  - remove ADD_BACKGND_FOR_CDDA codes/////////////////////////////////////////////////////////////#include "winav.h"#include "digest.h"//ccc#include "cc.h"#include "utl.h"#include "input.h"#include "hal.h"#include "osd.h"#include "infofilter.h"#include "linear.h"#include "chips.h"#include "disp.h"#include "dvdinfo.h" // wyc.pro#include "navigate.h" // wyc.pro#include "cell.h" // ** TCH1.61a; for REPEAT_AB//#include "message.h"//DVD_031, MP3#include "Mmanager.h" //"mp3.h"#include "SrcFilter.h"#include "thumb.h"  // LLY2.80#include "char_subpict.h"#include "parser.h"//Kevin0.86, program index list array for font mode / GDI modePROG_INDEX      __ProgIdxList[MAX_PROG_ITEM];//Kevin1.00, move from cc.c to hereBIT             __btProgram;//Micky2.80, review global variables init.= FALSE;             // Program Mode ON/OFF (Only valid in PBC OFF)BIT             __btInputProgram;//Micky2.80, review global variables init.= FALSE;        // PROGRAM in INPUT modeBIT             __btPlayingProgram;//Micky2.80, review global variables init.= FALSE;      // Now is playing PROGRAMBIT             __btNextPlayProgram;//Micky2.80, review global variables init.= FALSE;     // Ready for play PROPRAM;//Kevin0.86, move frm cc.c to hereBYTE            __bProgramMaxEntry;//Micky2.80, review global variables init. = 0;// wyc2.80, move the variables' decalre from CC to LINEAR.BYTE     __bProgramCurrentIndex;BYTE     __bProgramPlayingIndex;extern DWORD    __dwGoToTime;                   // Time that use GOTO positionextern DWORD    __dwResumeTime;             // Time that record final stop point//extern BIT      __btInputProgram;           // PROGRAM in INPUT mode//extern BIT      __btPlayingProgram;         // Now is playing PROGRAM//extern BIT      __btNextPlayProgram;        // Ready for play PROPRAM;//Kevin0.86, comment//extern WORD     __wProgramData [PROGRAM_TRACK];  // update max. program entry to PROGRAM_TRACK//extern BYTE     __bProgramMaxEntry;extern BYTE     __bNVPlayMode;extern BYTE     __bSameItem;extern WORD     __wPrevPlayDir;extern WORD     __wPrevPlayItem;// end ..// wyc.172-CDDA, extern the flag to represent CDDA is play across tracks automatically.extern BYTE     __bCDDAAutoChTrk;// DVD_276Micky, bit reduce///extern BIT      __btTrueKey;// wyc1.07a. remove this variale.//extern BYTE     __bKeyRepeat;        // in isr.cextern DWORD IDATA     __dwTimeKey;          // time reference; First Number Keyextern BIT      __btPlayFromBegin;        // Told F/W it should play Track-Begin firstextern BIT      __btFromStopMode;         // GOTO position comes from a "STOP" modeextern BIT      __btNewTime;              // A flag that means it's a NEW timeextern  BYTE    __bTimeMin, __bTimeSec;         // GOTOTime Usageextern  BYTE    __bGoToTimeNO;                  // count the I/P Number in GoToTimeextern  BYTE    __bModePlay;// LLY.036extern  BYTE    __bTimeHour;    // GoTo Time usageDWORD           __dwPreGetTime= 0;           // Previous get time, time referenceextern DWORD        __dwTimeA, __dwTimeB;           // record the times for repeatAB//DVD_051Micky, Number >10extern WORD    __wNumberQueue;extern DWORD __dwNumberPrevious;        // record previous valid number key#ifdef SUPPORT_MP4#ifndef NO_DISC_MODE //CoCo2.37pextern WORD __wChapter;extern WORD __wChapter_Ns_Title;#endif //#ifndef NO_DISC_MODE //CoCo2.37p#endif //SUPPORT_MP4// wyc1.06-909, extern variable//**********************************************************************//  Function    : LINEAR_ChangeTrack//  Description : Play the next/prev track or the specified track number//              : the prev/next track is decided according to the REPEAT mode//              : (Exception PROGRAM->input entries->PLAY)//  Parameters  : bKey: KEY_NEXT/KEY_PREV//              :       bTrackNO: 1 Means auto play to next track from LINEAR_Trigger, 0 means press key to next track.//              :       KEY_NUMBER, must reference bTrackNO//              :       bTrackNO: specified track number to play(logical track)//              :                 0, means current __wPlayItem(current track)//  Return      : TRUE, stay in playing mode//              : FALSE, stop playing//  Changed     : __wPlayItem, __bModePlay//**********************************************************************BYTE LINEAR_ChangeTrack(BYTE bKey, WORD wTrackNO){    BYTE        bCmd;//unused, bTemp;    // __btNextPlayProgram=TRUE, is set when PROGRAM->Entries->PLAY    // When KEY_NEXT is pressed or current track play end    // it must directly play the first program entry// test, when repeat none// play last track, then select track 1 or last// PROGRAM->ANY TRACK, will cancel program mode????    // 1. when KEY_NEXT or KEY_PREV is pressed    // must check the repeat mode!!!    // 2. for key number, it will directly play the specified track    // don't care the current repeat mode    if ( bKey == KEY_NUMBER)    {        if ( !wTrackNO) // KEY_N0, play the first track            wTrackNO = 1;        // Key number (KEY_Nx) will clear the random mode// Micky2.79, tune the usage of __bCountStop, don't reference DOUBLE_STOP// KEY_NUMBER only clear Random mode when playing and real stop.// __btRandom is on when playing and pre-stop.        if (__btRandom && (__bCountStop ==0) )        {            __btRandom= FALSE;            OSD_OUTPUT_MACRO(MSG_RANDOM, __btRandom, 3);        }    }    else    {        // ** 0.16; Random mode don't care of REPEATMODE        // wyc0.91, if don't check repeat mode when programming, then repeat one will failed in program playing mode. So recover        // to original code to fix it.        if ( ! __btRandom )// && (!__btPlayingProgram))        {            // check current repeat mode            bKey = _CheckRepeatMode( bKey );            // ** TCH2.81; begin...            if  ( bKey == KEY_REPEAT )            {                bKey= KEY_NUMBER;       // let's go original path                wTrackNO= __wPlayItem;            }            else            // ** TCH2.81; end...            if ( bKey == KEY_NUMBER )   // REPEAT_ONE, repeat the current track            {            #ifdef  SUPPORT_ENCODE_JPG_PICTURE //winnie2.51, added to play jpg from SPI flash               //means play current jpg from SPI flash                if(__SF_SourceGBL[0].bSourceIndex == SOURCE_SPI)                __bOSDSSPicIdx=0;                else             #endif                {                // means play current __wPlayItem                wTrackNO=0; // CD-DA track number same as play item number                }            }            else            if ( bKey == KEY_STOP)      // REPEAT_NONE, will enter STOP mode                return FALSE;        }    }    switch ( bKey )    {        case    KEY_NEXT:           // play the next track        case    KEY_PREV:           // play the prev. track            // wyc2.30-909s, when no program entries, don't fo program playing flow. Otherwise will happen problem when program one entry and            // play, disable this program entry and prev, then no program entry now but still go program finding entry flow and will wrong.            if ((__btPlayingProgram) && (__bProgramMaxEntry!=0))            {                if (__btNextPlayProgram)                {                    __btNextPlayProgram=FALSE;                }                else                {                    // wyc.pro __wProgramData[1] -> __bProgramCurrentIndex                    // merge the key prev and next operation                    if (bKey == KEY_NEXT)                        __bProgramPlayingIndex++;                    else if (bKey == KEY_PREV)                    {                        __bProgramPlayingIndex--;                        //Alan2.37, for Mantis #2341                        while (0 == __ProgIdxList[__bProgramPlayingIndex].wSubIndex)                            __bProgramPlayingIndex--;                    }                }                // wyc.pro __wProgramData[0] -> __bProgramMaxEntry , __wProgramData[1] -> __bProgramCurrentIndex                // and set when __bProgramCurrentIndex >= PROGRAM_TRACK, goto stop mode                //LJY0.60p, "__bProgramPlayingIndex < 0" always false.                if (( __bProgramPlayingIndex >= __bProgramMaxEntry ))// || (__bProgramPlayingIndex < 0))                {                    // wyc.101a, to fix when program playing mode, repeae disc is not available problem                    // wyc1.10, make KEY_NEXT / KEY_PREV repeat playing in program playing mode. Auto play will stop when program playing to last entry.                    // Also add control to make repeat mode will continue playing and make .                    // Also make playing program always repeat.//                    if ( (!__btPlayingProgram) && (__bKeySource != KEY_FROM_ISR) && (__bRepeat != REPEAT_DISC) )                    if ( (__bKeySource != KEY_FROM_ISR) && (__bRepeat == REPEAT_NONE) )                    {                        // wyc1.06-909, when playing to last dir/file in MM mode, set __bLastPlayItem to let MM can reference it to not                        // enter thumbnail mode when last play item is JPG file.                        // wyc1.20-909, rename                        __bLastPlayItem = TRUE;                        __bFWKey = KEY_STOP;                        return TRUE;                    }                    else                    {                        if (bKey == KEY_NEXT)                            __bProgramPlayingIndex = 0;                        else if (bKey == KEY_PREV)                            __bProgramPlayingIndex = __bProgramMaxEntry - 1;                    }                }                // wyc.pro  __wProgramData[1] -> __bProgramCurrentIndex                // wyc.pro1 check if array is null, if null go to next program entry, and modify the function name                if (bKey == KEY_NEXT)                    __bTemp = _LinearEntryOperation(LINEAR_FIND_ENTRY,1);                else if (bKey == KEY_PREV)                    __bTemp = _LinearEntryOperation(LINEAR_FIND_ENTRY,0);                // confirm the porgram has data                if (__bTemp == 1)                {#ifndef NO_DISC_MODE //CoCo2.37p                    if (__wDiscType & BOOK_DVD)                    {//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);                        // wyc.101 add the return code                        return TRUE;                    }                    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;                    }                }                else                {                    // wyc1.10-3, when select some entries to program playing and then remove them, then system will enter stop mode.                    // Now make it go normal playing and clear program mode.                    //__bISRKey = KEY_STOP;                    LINEAR_Program(LINEAR_PROGRAM_CLEAR,NULL_0);                    __wPlayItem++;                }                // for VCD, the __wPlayItem=TrackNO+1;                if  ( __wDiscType & BOOK_VCD )                    __wPlayItem++;            }            else            {                // directly play the next play track                // __wPlayItem value is according to disc type                // wyc.pro merge key prev and next                if (bKey == KEY_NEXT)                {                    // LLY1.50, add next chapter control for Nero Digital#ifdef  SUPPORT_MP4                    if( MM_GetFileType(__MMPlayingItem.wDirID, __wPlayItem) == EXTNAME_MP4 )                    {                        // if exit next chapter, change to it                        if(__wChapter < __wChapter_Ns_Title)                        {                            // [1] Calculate the desired time for next changer beginning                            __dwGoToTime = PARSER_GetMP4ChapterTime(PARSER_MP4_CHAP_NEXT);                            // 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;

⌨️ 快捷键说明

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