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

📄 linear.c

📁 车载电子影音系统dvd播放系统原程序代码
💻 C
📖 第 1 页 / 共 5 页
字号:
            }
#endif    //#ifdef    GOTOTIME_LEFTTORIGHT
            return TRUE;
        }
    }

    // key 10+ still can't clear the program mode
    // Key number(KEY_Nx) will clear the program status
    // is playing program list
    if ( __btPlayingProgram && !__btInputProgram && !(wNumber & 0x8000))
    {
        LINEAR_Program(LINEAR_PROGRAM_CLEAR,NULL);
    }


//Kevin0.86, GDI mode program UI doesn't process number keys
#ifdef CT908_UI 
	if ( __btProgram ) 
	{       
		return TRUE;
	}
#else
    if ( __btProgram )
    {
        // means entry is modified
        __bModifyEntry = TRUE;

        // if first input number, and active program entry has data, must put the data to
        // number array in DVD. And put the number array '-' in VCD mode.
        if (__wDiscType & BOOK_DVD)
        {
            if ((__bInputNumIndex == 0) && (__wProgramData[__bProgramCurrentIndex / 2] != NULL))
            {
                __bProgramInputNum[1] = 11;
                __bProgramInputNum[2] = LOBYTE(__wProgramData[__bProgramCurrentIndex / 2]) / 10;
                __bProgramInputNum[3] = LOBYTE(__wProgramData[__bProgramCurrentIndex / 2]) % 10;
            }
            // if first input but active program entry doesn't have dada, clear the number array to '-'
            else if ((__bInputNumIndex == 0) && (__wProgramData[__bProgramCurrentIndex / 2] == NULL))
                LINEAR_ClearProgramEntry(LINEAR_CLEARNUMBER,1,3);
        }
        else
        {
            if ((__bInputNumIndex == 0) && (__wProgramData[__bProgramCurrentIndex] != NULL))
                LINEAR_ClearProgramEntry(LINEAR_CLEARNUMBER,1,2);
            // if first input but active program entry doesn't have dada, clear the number array to '-'
            else if ((__bInputNumIndex == 0) && (__wProgramData[__bProgramCurrentIndex] == NULL))
                LINEAR_ClearProgramEntry(LINEAR_CLEARNUMBER,1,3);
        }

        // wyc.pro, input and record the digit number, F/W supports input from right and left two methods
#ifdef PROGRAM_LEFTTORIGHT
        __bProgramInputNum[__bInputNumIndex] = (BYTE)wNumber;
#else
        if (__wDiscType & BOOK_DVD)
        {
            __bProgramInputNum[0] = __bProgramInputNum[1];
            __bProgramInputNum[1] = (BYTE)wNumber;
        }
        else
        {
            for (__bTemp=0;__bTemp<=1;__bTemp++)
                __bProgramInputNum[__bTemp] = __bProgramInputNum[__bTemp+1];
            __bProgramInputNum[2] = (BYTE)wNumber;
        }
#endif // PROGRAM_LEFTTORIGHT
        __bInputNumIndex++;
        if (__wDiscType & BOOK_DVD)
        {
#ifdef PROGRAM_LEFTTORIGHT
            // if input title completely, do follow things
            if (__bInputNumIndex == 2)
            {
                // means input chapter number digit now
                if (__bProgramCurrentIndex % 2)
                {
                    DVD_ParseInfo ( DVD_TOTAL_CHAPTERS, & __dwTemp, __bTitleNum );
                    _LinearEntryOperation(LINEAR_DIGIT_TO_ENTRY, CHAPTER_NUMBER);
                    // if inputted title is valid
                    if ((__bChapterNum <=  (BYTE)__dwTemp) && (__bChapterNum != NULL))
                    {
                        __bInputNumIndex = 0;
                        LINEAR_ClearProgramEntry(LINEAR_CLEARNUMBER,0,1);
                        // if not the last entry
                        if (__bProgramCurrentIndex < (PROGRAM_TRACK*2-1))
                        {
                            __bProgramCurrentIndex++;
                            __bTitleNum = __bChapterNum = 0;
                            if (HIBYTE(__wProgramData[__bProgramCurrentIndex/2]) != NULL)
                            {
                                __bProgramInputNum[0] = HIBYTE(__wProgramData[__bProgramCurrentIndex/2]) / 10;
                                __bProgramInputNum[1] = HIBYTE(__wProgramData[__bProgramCurrentIndex/2]) % 10;
                            }
                        }
                        // if it is last entry, use chapter number to show on OSD and not goto next entry
                        else
                        {
                            __bProgramInputNum[0] = LOBYTE(__wProgramData[__bProgramCurrentIndex/2]) / 10;
                            __bProgramInputNum[1] = LOBYTE(__wProgramData[__bProgramCurrentIndex/2]) % 10;
                        }
                    }
                    else
                    {
                        // if chapter is invalid, clear chapter number
                        __bInputNumIndex = 0;
                        __bChapterNum = NULL;
                        LINEAR_ClearProgramEntry(LINEAR_CLEARNUMBER,0,1);
                        __wProgramData[__bProgramCurrentIndex / 2] = MAKEWORD(__bChapterNum,HIBYTE(__wProgramData[__bProgramCurrentIndex / 2]));
                    }
                }
                else // means input title number digit now
                {
                    DVD_ParseInfo ( DVD_TOTAL_TITLES, & __dwTemp, NULL );
                    _LinearEntryOperation(LINEAR_DIGIT_TO_ENTRY,TITLE_NUMBER);
                    // if inputted title is valid
                    if ((__bTitleNum <=  (BYTE)__dwTemp) && (__bTitleNum != NULL))
                    {
                        __bChapterNum = 0;
                        DVD_ParseInfo ( DVD_TOTAL_CHAPTERS, & __dwTemp, __bTitleNum );
                        LINEAR_ClearProgramEntry(LINEAR_CLEARNUMBER,0,1);
                        __bInputNumIndex = 0;
                        __bProgramCurrentIndex++;
                        if ((LOBYTE(__wProgramData[__bProgramCurrentIndex / 2]) != NULL) && (LOBYTE(__wProgramData[__bProgramCurrentIndex / 2]) <=  (BYTE)__dwTemp))
                        {
                            __bProgramInputNum[0] = LOBYTE(__wProgramData[__bProgramCurrentIndex / 2]) / 10;
                            __bProgramInputNum[1] = LOBYTE(__wProgramData[__bProgramCurrentIndex / 2]) % 10;
                            _LinearEntryOperation(LINEAR_DIGIT_TO_ENTRY,CHAPTER_NUMBER);
                        }
                        else
                        {
                            __bChapterNum = NULL;
                            __wProgramData[__bProgramCurrentIndex / 2] = MAKEWORD(__bChapterNum,__bTitleNum);
                            LINEAR_ClearProgramEntry(LINEAR_CLEARNUMBER,0,1);
                        }
                    }
                    else
                    {
                        // if title is invalid or NULL, clear title number
                        __bInputNumIndex = 0;
                        __bTitleNum = NULL;
                        LINEAR_ClearProgramEntry(LINEAR_CLEARNUMBER,0,1);
                        __wProgramData[__bProgramCurrentIndex / 2] = MAKEWORD(LOBYTE(__wProgramData[__bProgramCurrentIndex / 2]),__bTitleNum);
                    }
                } //  (__bInputNumIndex == 2)
            } //if (__bInputNumIndex == 2)
#endif // PROGRAM_LEFTTORIGHT
            // show the input number
            OSD_OUTPUT_MACRO ( MSG_PROGRAM, 1, 0xFF );
        }
        else  // non-DVD program
        {
#ifdef PROGRAM_LEFTTORIGHT
            if (__bInputNumIndex == 3)
            {
                // if inputted track is valid
                _LinearEntryOperation(LINEAR_DIGIT_TO_ENTRY,TRACK_NUMBER);
                if (__wProgramData[__bProgramCurrentIndex] <=  _LinearReturnMaxTrack(NULL) )
                {
                    // use __wTemp to store the track number
                    __wTemp = 100*__bProgramInputNum[0]+10*__bProgramInputNum[1] + __bProgramInputNum[2];
                    __bInputNumIndex = 0;
                    if (__wTemp != NULL)
                    {
                        __wProgramData[__bProgramCurrentIndex] = __wTemp;
                        // if not the last program entry, can go to next program entry
                        if (__bProgramCurrentIndex < PROGRAM_TRACK - 1)
                        {
                            // cursor go to next program entry
                            __bProgramCurrentIndex++;
                            // if next cursor has data in it, we must put the data into number array
                            if (__wProgramData[__bProgramCurrentIndex] != NULL)
                            {
                                __bProgramInputNum[0] = (BYTE)(__wProgramData[__bProgramCurrentIndex] / 100);
                                __bProgramInputNum[1] = (BYTE)((__wProgramData[__bProgramCurrentIndex] % 100) / 10);
                                __bProgramInputNum[2] = (BYTE)((__wProgramData[__bProgramCurrentIndex] % 100) % 10);
                            }
                            else // if next program entry has no data, must clear number array to '-'
                                LINEAR_ClearProgramEntry(LINEAR_CLEARNUMBER,0,2);
                        }
                    }
                    else // clear this program entry
                    {
                        if (__bProgramCurrentIndex <= PROGRAM_TRACK - 1)
                        {
                            __wProgramData[__bProgramCurrentIndex] = NULL;
                            LINEAR_ClearProgramEntry(LINEAR_CLEARNUMBER,0,2);
                        }
                    }
                    // when go to next program, the cursor will stay in last program entry
                    if (__bProgramCurrentIndex > PROGRAM_TRACK - 1)
                        __bProgramCurrentIndex = PROGRAM_TRACK - 1;
                }
                else //if ((100*__bProgramInputNum[0] ...
                {
                    __wProgramData[__bProgramCurrentIndex] = NULL;
                    __bInputNumIndex = 0;
                    LINEAR_ClearProgramEntry(LINEAR_CLEARNUMBER,0,2);

                } //if ((10*__bProgramInputNum[2]
            } //if (__bInputNumIndex == 3)
#endif //PROGRAM_LEFTTORIGHT
            // show the input number
            OSD_OUTPUT_MACRO ( MSG_PROGRAM, 0, 0xFF );
        }
        // end ..
        return TRUE;
    }

#endif //#ifdef CT908_U
    // show the input number
    OSD_OUTPUT_MACRO ( MSG_NUMBER, wNumber, 1 );

    // ** 0.16; Move to LINEAR_ChangeTrack
/*
    // Key number (KEY_Nx) will clear the random mode
    if ( __btRandom )
    {
        __btRandom= FALSE;
        OSD_OUTPUT_MACRO(MSG_RANDOM, __btRandom, 3);
    }
*/

    // LLY0.83b-2, return the status of LINEAR_ChangeTrack()
    //LINEAR_ChangeTrack ( KEY_NUMBER, wNumber);
    //return TRUE;
    return LINEAR_ChangeTrack(KEY_NUMBER, wNumber);
}

//  *********************************************************************
//  Function    :   LINEAR_Action
//  Description :
//  Arguments   :   KEY_GOTOTIME/ KEY_GOTOTIME_PLAY/ KEY_REPEAT_AB
//  Return      :
//  Side Effect :
//  *********************************************************************
BIT LINEAR_Action(BYTE bKey, DWORD dwParam)
{
    __btIntroMode=FALSE;
    switch(bKey)
    {
// f/w 0.34
        case    KEY_NUMBER:
                return LINEAR_Number((WORD)dwParam);

        case    KEY_GOTOTIME:
                // PROGRAM / GOTIME can't exist at the same time
                if (__btProgram)
                {
                    LINEAR_Program(LINEAR_PROGRAM_CLEAR,NULL);
                }
                // Micky1.23, LINEAR_Action(KEY_GOTOTIME) must reference __bSearchMode do action, can't modify __bSearchMode.
/*
//                if ( __btGoToTime )
                if(__bSearchMode==SEARCH_MODE_TIME)//alex1.23,20040218 combine gototime , search,bookmark
                {
                    OSD_OUTPUT_MACRO ( MSG_SETGOTOTIME, OSD_CANCEL_TIME, 0 );
                    //__btGoToTime= FALSE;
                    __bSearchMode=SEARCH_MODE_OFF;//alex1.23,20040218 combine gototime , search,bookmark
                }
                else
*/
                {
                    // enable GOTOTIME in all kinds of play mode.
                    // But after KEY_PLAY trigger, will goto normal play mode.

                    // clear time key
                    // disable key 10+ before entering GOTOTIME mode
                    __dwTimeKey=0;
                    //LJY1.24a, marked for reviewing initialization of MODE_LINEAR.
                    //UTL_ModeInitial ( MODE_LINEAR );
                    //__btGoToTime= TRUE;
                    __bSearchMode=SEARCH_MODE_TIME;//alex1.23,20040218 combine gototime , search,bookmark

                    //Kevin2.80, move before OSD_OUTPUT_MACRO ( MSG_SETGOTOTIME, OSD_INPUT_TIME, 0xFF ), 'cause 908 GOTOTIME UI needs the reset of the following
                    __bTimeHour=0;  // LLY.036
                    __bTimeMin= 0;
                    __bTimeSec= 0;
                    __bGoToTimeNO= 0;                           

                    OSD_OUTPUT_MACRO ( MSG_SETGOTOTIME, OSD_INPUT_TIME, 0xFF ); //always show goto time
                }
                return TRUE;
        case    KEY_GOTOTIME_PLAY:
        {
                //__dwGoToTime will be input at entry
                //__dwGoToTime is relative to the first playable track

//DVD_049Micky
// remove it, as now won't disable IR
//                EX0= 1;  //enable IR interrupt

                //check if out of range
                // DVD_161icky, remove it,(-150L)
                // fix A-Bex(TCD-784)T26, pre-stop at 2 second, can't resume.
                // as last track should be able to play to __dwTimeDiscEnd.
//                if ( dwParam >= (__dwTimeDiscEnd-150) )    //last 2 seconds
            // Micky1.25-2, move out the action to CC.c
            /*
                if ( dwParam >= (__dwTimeDiscEnd) )
                {

                    // ** 0.17; Add it, otherwise PANEL don't know the status
                    //if ( __btGoToTime )
                    if ( __bSearchMode==SEARCH_MODE_TIME)//alex1.23,20040218 combine gototime , search,bookmark
                    {
                    //__btGoToTime= FALSE;

⌨️ 快捷键说明

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