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

📄 setup.c

📁 车载电子影音系统dvd播放系统原程序代码
💻 C
📖 第 1 页 / 共 5 页
字号:

    switch (__bKey)
    {
    case KEY_SETUP:
        if (!__bSetupMode)
        {
#if defined (SUPPORT_PSCAN_PROMPT_SETUP) || defined (SUPPORT_PSCAN_PROMPT_OSD)
            // Brian1.08, when none-setup mode PSCAN prompt dialog is displayed, don't enter Setup mode.

            if (__bOSDPromptMode)
                return __bKey;
#endif

#ifdef PRESTOP_BEFORE_SETUP_AND_PROGRAM //XuLi.230
#ifndef NO_DIGEST
            if(__btDIGEST)	//Xuli1.26, clear digest UI before enter setup, or else setup will restore this UI and recover after exit setup.
            {
                OSD_OUTPUT_MACRO(MSG_DIGEST, 0, 0);
            }
#endif	
#endif
            // Brian0.83
            // inform OSD that we are entering Setup
            // OSD module should update _bCurrentUI and _bPreviousUI
//            OSD_Output(MSG_OSDAPP, OSD_APPMODE_SETUP, 0xFF); 
            OSD_OUTPUT_MACRO(MSG_OSDAPP, OSD_APPMODE_SETUP, 0xFF); //Brian1.02

#ifdef SETUP_REDUCE_LUMINANCE
            // Set luminance to be more dark
            //W99AV_WriteRegW(LAR, 0x80);
            W99AV_WriteRegW(LAR, 0xFB); // brian.161 make it "more" dark
#endif

#ifndef REMOVE_SETUP_SPEAKER_TEST
            // test tone always auto
            __SetupInfo.bAudioTestTone = SETUP_AUDIO_SPEAKER_TEST_AUTO;
#endif

#ifndef REMOVE_SETUP_SPEAKER_TEST
            _bTestToneStage = 0; // initial
            _bDSPTestTone = 0;
#endif

			__bSetupMode = TRUE;

			// put Menu Initial here, because we want the pointer _pMenuIndex points to the correct 
			// menu at the beginning
			OSD_MENU_INITIAL(MENU_TYPE_SETUP);

#ifdef PRESTOP_BEFORE_SETUP_AND_PROGRAM //XuLi.230
		__bPreCountStop=__bCountStop;
#endif

            _bAudioTypeChange = FALSE; // Brian1.00
			_bParentalControlChange = FALSE;

            if (!(__wDiscType & BOOK_DVD))
            {
                if (__wDiscType==NO_DISC_IN_DRIVE)
                    _SetMenuEnable(0);
                else
                {
                    // Brian2.79, use __bCountStop to determine the status
                    if (__bCountStop < 2) // means playing or pre-stop
                        _SetMenuEnable(1);
                    else // stop
                        _SetMenuEnable(0);

                    // Brian1.00,
                    // RISC won't switch display before deccode is completed,
                    // so we can remove this check.
                    /*
                    // Fix the potential problem when VCD Still enter SETUP
                    if (__bModePlay & MODE_STILL)
                    {
                        __dwCheckTime= UTL_GetSysTimer();
                        while ( ( UTL_GetSysTimer()- __dwCheckTime ) < (COUNT_500_MSEC) )
                        {
                            if (W99AV_ReadInfo(W99AV_INFO_MACRO_BLOCK, &__dwTemp))
                            {
                                if (__dwTemp==0)
                                    break;

#ifdef SUPPORT_CDIF
                                if(__bServoAutoCtrl)
                                    SERVO_Monitor();  
                                else
                                    MONITOR_CheckBuffer(); //LJY277.3rd
#else
                                SERVO_Monitor();
#endif // SUPPORT_CDIF
                            }
                        }
                    }

                    */

                }

                // LLY.276, postpond the input key until JPG decoding ok
                {
                extern void _FM_PostpondKey(BYTE bKey);
                _FM_PostpondKey(__bKey);
                }
                /*
                // brian.277, thumbnail mode doesn't need to enter PAUSE
                // for it is already stopped &&
                // if we do pause, DSP will be pasued too and can't decode the JPEG,
                // may leave the current picture blank in the thumbnail screen
                if (__btPlaying && !__bThumbnailMode)
                */
                if (__btPlaying) // Brian2.81, thumbnail support KEY_PAUSE
                {
// brian.171a, change to KEY_PLAY then KEY_PAUSE
// This is a workaround to make SCF/SCB, FF look like paused (before the real KEY_PAUSE issue is solved)
// However add this would also make it change to PLAY mode when exit Setup. This is a side effect.
// When KEY_PAUSE issue is sovled for SCF/SCB, FF, we could remove this part
#ifdef  PLAY_AFTER_EXIT_SETUP	
                    // this for none-DVD
                    if (__bAttrPlay&TYPE_CDROM_AUDIO) // Brian1.25, audio only could directly enter pause mode. Otherwise ==> // Kevin, MP3 SCF/SCB->Setup->Exit Setup=> jump to next file (below (KEY_PLAY) will reset audio s.t. A2-Rem < 720) 
                        __bModeCmd = KEY_PLAY;
  
#ifndef PRESTOP_BEFORE_SETUP_AND_PROGRAM      //xuli2.34, Because MP3 still toggle KEY_PAUSE when enter/exit SETUP, need set __bModeCmd to KEY_PLAY before issue KEY_PAUSE, or else KEY_PAUSE will be INVALID.     					
                    if ( __bModeCmd != KEY_PLAY)  // if it is already in play mode, don't need to issue KEY_PLAY again
                        CC_DoKeyAction (KEY_PLAY);
#endif	//#ifndef PRESTOP_BEFORE_SETUP_AND_PROGRAM					
#endif	//#ifdef  PLAY_AFTER_EXIT_SETUP

#ifndef PRESTOP_BEFORE_SETUP_AND_PROGRAM //XuLi.230
                     CC_DoKeyAction (KEY_PAUSE);
#endif
                }

                // Brian1.10, add kevin's support for MP3 Fast Forward.
#ifdef  PLAY_AFTER_EXIT_SETUP
                //MP3 Fast Forward case, SCF->enter SETUP->exit SETUP => Normal Play
                if (__bAttrPlay==ATTR_MP3)
                {   
                    // always set to normal play
                    __bScanLevel=0;
                    W99AV_WriteDM(W99AV_DM_MP3_FF_SPEED, __bScanLevel<<1);
                }
#endif

#ifndef NO_DIGEST //LJY1.20, support 4M flash, remove digest
                //LJY1.00, fix the noise problem while it entered setup in digest mode.
                if(__btDIGEST)
				{
		            CHIPS_OpenAudio(FALSE);
                    HAL_CheckCDIF(HAL_CDIF_FREEZE_TIME, NULL);
				}
#endif

            }
            else if (__btPlaying)
            {
// brian.171a, chnage to KEY_PLAY then KEY_PAUSE
#ifdef  PLAY_AFTER_EXIT_SETUP
#ifndef PRESTOP_BEFORE_SETUP_AND_PROGRAM //XuLi.230
                // this is for DVD
                if (__bModeCmd != KEY_PLAY) // if it is already in play mode, don't need to issue KEY_PLAY again
                    CC_DoKeyAction (KEY_PLAY);
#endif	//#ifndef PRESTOP_BEFORE_SETUP_AND_PROGRAM			
#endif	//#ifdef  PLAY_AFTER_EXIT_SETUP
                
#ifndef PRESTOP_BEFORE_SETUP_AND_PROGRAM //XuLi.230
                CC_DoKeyAction (KEY_PAUSE);
#endif
                _SetMenuEnable(2);  //run-time mode
            }
            else
            {
                // Brian2.79, use __bCountStop to determine the status
                if (__bCountStop < 2) // means playing or pre-stop
                    _SetMenuEnable(2);
                else // stop
                    _SetMenuEnable(0);
            }

#ifdef PRESTOP_BEFORE_SETUP_AND_PROGRAM	//XuLi.230
		if(!(__wDiscType & CDROM_M1))				
		{	
			if (
#ifndef NO_DIGEST
			__btDIGEST||
#endif
			__btPlaying || __btPause
			||(__btPBC && (__wPlayItem>99))
			)
			{
				if((__bModeCmd!=KEY_PLAY) || (__btPause))				
				{
					OSD_OUTPUT_MACRO(MSG_PLAYING, 0, 0); //xuli1.26, clear right-upper corner OSD, e.x. PAUSE/SCF/SCB/FF, or else it will be recover when exit SETUP
				}			
				CC_DoKeyAction(KEY_STOP);
				OSD_OUTPUT_MACRO(MSG_STOP, 0, 3); // Brian2.37 //xuli0909, forbid OSD trigger time
				OSD_Output (MSG_LOGO, NULL, 0xff);
			}
        	}
		else if(__btPlaying)
			CC_DoKeyAction (KEY_PAUSE);
#endif	//#ifdef PRESTOP_BEFORE_SETUP_AND_PROGRAM	

            //Brian1.06
            _SetAnalogEnable();
            
            GDI_SetTextColor(TEXT_SHADOW_COLOR_1, 1);
            GDI_SetTextColor(TEXT_SHADOW_COLOR_2, 1);

			__bOSDLanguage = __SetupInfo.bOSDLanguage;

			_bPasswordOK = FALSE;

            // Brian0.87, set one field display when enter Setup
            // Micky1.07, RISC support another feature, DVD still won't do one-field control
            // must write the value as 0x20000.
            W99AV_WriteDRAMData(W99AV_DRAM_ONE_FIELD, 0x20000);//10000);
            // Add delay to reduce the chance of OSD flash in P-SCAN mode
            UTL_DelayTime(COUNT_500_MSEC, FALSE);

            OSDSETUP_Display();
            
            __bKey= KEY_NO_KEY; 
        }
        else
        {
            //if (_bDoBackDoor)
            //{
            //    _ExitBackDoor();
            //}
            //else
            {
// Brian0.90 move into _ExitSetup
/*
                GDI_ClearRegion(__bCurrentRegionId);
#ifdef GDI_4_BIT_OSD
                // reload palette for 4-bit region as early as possible
                // this colud save some trouble: the pink-screen-flash problem
                GDI_SetGDIPalEntry();
#endif

                // Brian0.87, disable one field display when exit Setup
                W99AV_WriteDRAMData(W99AV_DRAM_ONE_FIELD, 0x0);
*/
                _ExitSetup();
                
                
            }
            __bKey= KEY_NO_KEY; 
            
        }
        break;
    case KEY_UP:

        OSDMENU_MenuOperation(__bKey);
#ifndef REMOVE_SETUP_SPEAKER_TEST
		OSDSETUP_ProcessSpeaker();
#endif

        __bKey=KEY_NO_KEY;
        break;
    case KEY_DOWN:

		OSDMENU_MenuOperation(__bKey);
#ifndef REMOVE_SETUP_SPEAKER_TEST
		OSDSETUP_ProcessSpeaker();
#endif

        __bKey=KEY_NO_KEY;
        break;

#ifdef SUPPORT_SETUP_HORIZONTAL_ICON_MENU
    // Brian1.08a, horizontal layout could use STOP key to go to paranet menu
    case KEY_STOP:
#endif
    case KEY_LEFT:

#ifndef REMOVE_SETUP_SPEAKER_TEST
        if (__wMENUCurrentItemId == SETUP_AUDIO_SPEAKER_TEST)
		{
            // moving from SPEAKER TEST to AUDIO SETUP
			GDI_ShowSpeaker(SPEAKER_CLEAR);
		}
#endif

        OSDMENU_MenuOperation(__bKey);

#ifndef REMOVE_SETUP_SPEAKER_TEST
        if (__wMENUCurrentItemId == SETUP_AUDIO_SPEAKER_TEST)
		{
            // moving from Auto/Left/Right/.../Subwoofer to SPEAKER TEST
            // clear speaker highlight by displaying the picture again
			GDI_ShowSpeaker(SPEAKER_ALL);

            if (_bDSPTestTone)
            {
            // Mute Test tone
            CHIPS_SoftMute();
            UTL_DelayTime(COUNT_50_MSEC, FALSE); // Brian1.23 //Brian1.11d-2, fix "bo" noise when TestTone --> Exit Setup
            W99AV_WriteRegDW (AUDIOCFG1R, 0x6, 0);
            //_SetTestTone(MUTE_CHANNEL); // use (soft) mute
            _bAudioTypeChange = TRUE;
            // brian.277a-3rd
            _bTestToneStage = 0; // set to 0, will not trigger Auto mode stage
            }

		}
#endif


        
        __bKey = KEY_NO_KEY;
        break;
    case KEY_RIGHT:
	case KEY_ENTER:
    case KEY_PLAY:          // Brian2.81, CC module doesn't transfer key anymore
    case KEY_PLAY_PAUSE:    // Brian2.81, CC module doesn't handle compound keys

		if (__wMENUCurrentItemId == SETUP_CUSTOM_PARENTAL && !_bPasswordOK)
		{

			OSDSETUP_PasswordDlg();
		}
		else if (__wMENUCurrentItemId == SETUP_CUSTOM_CHANGE_PASSWORD)
		{

			OSDSETUP_ChangePasswordDlg();
		}
		else if (__wMENUCurrentItemId == SETUP_LANGUAGE_MENU_OTHERS ||
			     __wMENUCurrentItemId == SETUP_LANGUAGE_AUDIO_OTHERS ||
				 __wMENUCurrentItemId == SETUP_LANGUAGE_SP_OTHERS)
		{

			OSDSETUP_LanguageCodeDlg();
		}
//Alex 1.08,20031013 if CurrentItemId is YUU_PSCAN, RGB_PSCAN , or VGA , show OSDSETUP_PscanDlg
#ifdef SUPPORT_PSCAN_PROMPT_SETUP

        else if(   (__wMENUCurrentItemId == SETUP_SCREEN_VIDEO_OUTPUT_YUV_PSCAN ||
			        __wMENUCurrentItemId == SETUP_SCREEN_VIDEO_OUTPUT_RGB_PSCAN ||
				    __wMENUCurrentItemId == SETUP_SCREEN_VIDEO_OUTPUT_VGA)     &&                  
                   (__bInputPassword==FALSE  )&&
                   (__SetupInfo.bVideoOutput != SETUP_SCREEN_VIDEO_OUTPUT_YUV_PSCAN &&
			        __SetupInfo.bVideoOutput != SETUP_SCREEN_VIDEO_OUTPUT_RGB_PSCAN &&
				    __SetupInfo.bVideoOutput != SETUP_SCREEN_VIDEO_OUTPUT_VGA)  )
		{
            __bOSDPromptPreKey=KEY_ACTIVE;
			OSDSETUP_ScreenVideoOutputPscanDlg();
            
		}
  
#endif// #ifdef SUPPORT_PSCAN_PROMPT_SETUP

		else
		{
			OSDMENU_MenuOperation(__bKey);

#ifndef REMOVE_SETUP_SPEAKER_TEST
			// speacial case: when from Root to Item, and the item is "Speaker Test"
			if (__wMENUCurrentItemId == SETUP_AUDIO_SPEAKER_TEST)
			{

				GDI_ShowSpeaker(SPEAKER_ALL);
                if (_bDSPTestTone)
                {
                // Mute Test tone
                CHIPS_SoftMute();
                UTL_DelayTime(COUNT_50_MSEC, FALSE); // Brian1.23 //Brian1.11d-2, fix "bo" noise when TestTone --> Exit Setup
                W99AV_WriteRegDW (AUDIOCFG1R, 0x6, 0);
                //_SetTestTone(MUTE_CHANNEL); // use (soft) mute
                _bAudioTypeChange = TRUE;
                // brian.277a-3rd
                _bTestToneStage = 0; // set to 0, will not trigger Auto mode stage
                }

			}
            else
            {
                // check if it is one of the speaker test item, if it is, do the Test tone
                _SpeakerTest();

            }
#endif	//#ifndef REMOVE_SETUP_SPEAKER_TEST

		}

		if (__bKey == KEY_ENTER)
		{
			// save changed value to serial EEPROM
			if (!__bInputPassword) 
			{
				// because in Input or Change Password mode, the current Item is still the Item not on the Value
				// so we don't want and don't need to save the value to EEPROM, but there is no protection

⌨️ 快捷键说明

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