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

📄 player.c

📁 MTK 1389e版 MINI组合音响代码
💻 C
📖 第 1 页 / 共 4 页
字号:
           {
               _bIRKey = IR_VOCAL_ASSIST;
            }
        }
        else if ( ((bDiscType >= SV_VCD3_0) && (bDiscType <= SV_VCD6_1)) || 
            ((bDiscType >= SV_CDDA) && (bDiscType <= SV_HDCD)))
        {
            if (_bIRKey == IR_OSD_LANGUAGE)
               _bIRKey = IR_AUDIO;
            else if (_bIRKey == IR_AUDIO)
               _bIRKey = IR_NONE;
        }
        else   //DVD
        {
            if (_bIRKey == IR_OSD_LANGUAGE)
               _bIRKey = IR_NONE;
      }
       #endif 
      #endif     
    }
  }
}
#if defined(DVD_AMP)//when mute on ,every key can mute off
  // if(_bPlayerMute &&_bIRKey != IR_NONE&&_bIRKey != IR_FUNCTION)
   if(_bPlayerMute &&(_bIRKey== IR_CH_VOL_SUB||_bIRKey== IR_CH_VOL_ADD))
   	_bIRKey = IR_MUTE;
#endif

/*
	if(fgIsInSetupMenu())   // lk-060721  //改部分在设定菜单状态的时候会使IR_CH_VOL_ADD和IR_CH_VOL_SUB键
	                                                         // 无功能,所以需屏蔽该部分
	{
	                                      
		if((_bIRKey==IR_CH_VOL_ADD)||(_bIRKey==IR_CH_VOL_SUB))
		{
		_bIRKey=IR_NONE;
		}

	}
*/

}

/***************************************************************************
     Function : void vUIInit(BOOL fgInit)
  Dsecription : called from Timer task before RISC start
    Parameter : None
       Return : None
***************************************************************************/
void vUIInit(BOOL fgInit) large
{

// Harrison's modified
  _bKeyState = KEY_INIT;

  vUserInit(fgInit);

  // - Reset Player
  vPlayerInit();
  SmInit();
  #ifdef HK_OnlyCD
   {            
          vSetSharedInfo(wSIItemPos(SI_SHM_CFG_GRP, 30), bSharedInfo(SI_TVE_OUT_MODE));
          vSetSharedInfo(SI_TVE_OUT_MODE, 0xff);
          vNotifySharedInfo(SI_TVE_OUT_MODE, 0, 0);
    }
  #endif
}

/***************************************************************************
     Function : void vUITimer(void)
  Dsecription : called from Timer task
    Parameter : None
       Return : None
***************************************************************************/
void vUITimer(void) large
{
  /* non-key dependant event for play module */
  vPlayerTimer();

  /* VFD */
#ifndef HYNIX_VFD
  vVfdTimerState(FALSE);
#endif

 #ifdef FLNAME_CIRCLE_DISPLAY                         //linshangbo   041405     bg
 if(fgIsIsoPlay())
  {
    _bFlNameTimer++;
    if(_bFlNameTimer>=50)
    	{
        vFlNameCircleDisplay(FALSE);
       _bFlNameTimer=25;
       }
   }
  #endif                                                                      //linshangbo   041405     end

  /* note this must be placed after VfdTimer() and before vIrTimer() */
  vGetCurrKey();
#ifdef SLEEP_FUNCTION   //XIAO  03-04-14
  if(_fgPowerDown == TRUE) 
  {
     _fgPowerDown = FALSE;
     _bSetSleepState = SLEEP_OFF;
     _bIRKey = IR_POWER;
  }
#endif
///////////////////////////////////



/*
///////////////////////////////////
#ifdef   MEMORY_SCREENOFF              //lk-060717
if(_bPowerDownTimer1)
{ 	
	_bPowerDownTimer1--;
	
	if(_bPowerDownTimer1==0)
	{
	//	_bPowerDownTimer=0x1F47;   //0xDA70+0x1F47 =63927 ,一个vUITimer循环要26ms左右,所以共计时=63927 *29ms=30.89分钟
		_bPowerDownTimer=0x200;
		
	}

	//如果第一次记忆后碟片马上又播放,即第一次没有记住,则判断后进行下一次记忆 
	if(fgIsPlay(bSharedInfo(SI_PBC_STATE)))    
	{	
		 if(fgIsVcdPlay()||fgIsCddaPlay())    //VCD和CD的时候有可能会有记不住的情况,
	      {
		_bPowerDownTimer1=0;                   //跳出以后的if(_bPowerDownTimer1)判断
			_bPowerDownTimer=0;           //清待机计时标志
			_fgMemoryPointOneTime=0;     //如果一次没有记住,且碟片还在播放则置_fgMemoryPointOneTime,重新开始记忆
			_bPlayPostKey=IR_PAUSE;         //暂停后等待下一次的屏保 
		}
		
	  }
}
#endif

///////////////////////////////////
#ifdef   MEMORY_SCREENOFF            //lk-060717
if(_bPowerDownTimer)
{
	_bPowerDownTimer--;
	if(_bPowerDownTimer==0)
	{
	   
			_bPlayPostKey=IR_POWER;
		
	}
}
#endif
//////////////////////////////////

*/


/*
///////////////////////////////////
#ifdef   MEMORY_SCREENOFF
if(_bPowerDownTimer1)
{
	_bPowerDownTimer1--;
	if(_bPowerDownTimer1==0)
	{
	//	_bPowerDownTimer=0x1F47;
	_bPowerDownTimer=0x500;
	_bPlayPostKey=IR_MEMORY;
		
	}
}
#endif
//////////////////////////////////

///////////////////////////////////
#ifdef   MEMORY_SCREENOFF
if(_bPowerDownTimer)
{
	_bPowerDownTimer--;
	if(_bPowerDownTimer==0)
	{
		_bPlayPostKey=IR_POWER;
	}
}
#endif
*/
//////////////////////////////////

#ifdef PLAYER_GOTO
  if (fgIsInGoto())
  {
    if( (_bPrevNtscPal != bSharedInfo(SI_NTSC_PAL)) && (_bIRKey == IR_NONE) )
    {
      _bIRKey = IR_GOTO;
      fgSetPlayPostKey(IR_GOTO); 
    }    
  }
  else
    _bPrevNtscPal = bSharedInfo(SI_NTSC_PAL);
#endif

  /* TODO: check if it is safe to execute UOP command here */
#ifdef BBK_LAST_MEMORY //BillDen
  if(_fgAutoJY)
  {
    _bIRKey = IR_PLAY;       //_fgAutoJY=TRUE,则自动从头开始播放,不记忆播放
    _fgAutoJY = FALSE;	
  }	
#endif
  if (_bIRKey != IR_NONE)
  {
  #if 0//defined(DVD_RECEIVER)  //XIAO 03-09-24
     if (fgIsScrSaverOn() && _bIRKey == IR_RE_FUN)
        _bIRKey = IR_AUDIO;  //唤醒屏保
  #endif  	
    vIrTimer();
  }

  /* Take care share memory here */
#ifdef ACCEL_SI_PROC
  _bShmUpdCnt = SHM_PROC_CNT;
#endif

#ifdef ACCEL_SI_PROC
  while (_bShmUpdCnt > 0)
#endif
  {
    SmTimer();
  }

  /* Handle OSD return here */
  vOsdCoreTimer();

  /* check player error code */
  if (_bPlayerErrCode != PLAYER_ERR_NO_ERROR)
  {
#ifdef SHOW_ERROR_CODE
    vOsdShowError(OSD_ERROR_CODE, _bPlayerErrCode);
#endif
    _bPlayerErrCode = PLAYER_ERR_NO_ERROR;
  }



}

#ifdef PLAYER_POWERDOWN
/***************************************************************************
     Function : void vUIPowerDownTimer(void)
  Dsecription : called from Timer task when power down
    Parameter : None
       Return : None
***************************************************************************/
void vUIPowerDownTimer(void) large
{
  /* VFD */
  vVfdTimerState(TRUE);
  /* get current key */
  if (_bVfdKeyScan != IR_NONE)
  {
    _bIRKey = _bVfdKeyScan;
    _bVfdKeyScan = IR_NONE;
  }
  /* note the _bIRKey0 is put in the IR interrupt */
  else if (EXIST_IR_KEY())
  {
    GET_IR_KEY(_bIRKey);

 #if  !defined(DVD_RECEIVER)    //xiao 03-04-29
    if (_bIRKey != IR_POWER)
    {
      _bIRKey = IR_NONE;;
    }
  }

  /* only power key and eject key is valid */
//  if ((_bIRKey != IR_POWER) && (_bIRKey != IR_EJECT))
  if ((_bIRKey != IR_POWER)
  {
    _bIRKey = IR_NONE;
  }
  else /* if (_bIRKey == IR_POWER) */
  {
    /* update VFD immediately */

    /* stop UI task */
    vUIStop();
  }
 #else 
   }  //if (EXIST_IR_KEY())
#if   defined(DVD_AMP)//when mute on ,every key can mute off
   //if(_bPlayerMute &&_bIRKey != IR_NONE&&_bIRKey != IR_FUNCTION) _bIRKey = IR_MUTE;
  #endif
#if defined(DVD_AMP)//when mute on ,every key can mute off
  // if(_bPlayerMute &&_bIRKey != IR_NONE&&_bIRKey != IR_FUNCTION)
   if(_bPlayerMute &&(_bIRKey== IR_CH_VOL_SUB||_bIRKey== IR_CH_VOL_ADD))
   	_bIRKey = IR_MUTE;
#endif

  //======================================================
    if (_bSysState != PD_STATE)  //Temp Message show time
    {
    #ifdef USE_RDS
     if(_bTimeCnt!=0xff)
     {
       if(_bTimeCnt!=0)//about rds
      {
       	_bTimeCnt--;
      }
     }
     #endif
     #ifdef DEL_NOISE
     if(Lag_Timer>0&&Lag_Timer!=0xff)
     {
        Lag_Timer--;
        if(Lag_Timer==0)
        {
           Lag_Timer =0xff;
        }
     }
     #endif
       if (_bChCount != 0)
       {
         if (_bChTimer != 0)
         {
            _bChTimer--;
            if (_bChTimer == 0)
            {
               _bChCount--;
               _bChTimer = CH_OSD_TIMER;         
            }
         }
       }
    }  
    else
    {
  //==============Key Shift in PowerDown statue==============
//      if (_bIRKey == IR_EJECT)// || _bIRKey == IR_PLAY_ENTER)
//          _bIRKey = IR_POWER;
    }
 #endif  
}
#endif


#ifdef MT1379_MANUFACTURE_TEST       
extern void vShowTestVer() large;
#endif

/***************************************************************************
     Function : void vUIStart(void)
  Dsecription : called from Timer task after RISC start
    Parameter : None
       Return : None
***************************************************************************/
void vUIStart(void) large
{
#ifdef PLAY_AUDIO_CLIP
  /* vSendUopCmd(UOP_AUDIO_CLIP, SV_ACLIP_FLASH, ACLIP_TADA, 0); */
#endif
#ifdef MT1379_MANUFACTURE_TEST       
vShowTestVer();
#endif

  vOsdCoreInit();
  vOsdSetLang(bEepromReadByte(OSD_LANG_POSITION));

  /* power on is mute, remember turn on volume */



  #if 0//def SUPPORT_WAIXIAO
  vAdspVolume(bEepromReadByte(MAIN_VOLUME_POS));
  #else 
  vAdspVolume(AUD_DEFAULT_VOL);   //1389adsp音量
 #endif

  // Check EEPROM size
#ifdef I2C_EEPROM
  if (EEPROM_TOTAL_SIZE > EEPROM_MAX_SIZE)
  {
    _bPlayerErrCode = PLAYER_ERR_EEPROM_CONFIG;
  }
#endif

  // Check user share memory size
  if ((SH_USER_DATA_MAX - SI_USER_START) >= SI_USER_DATA_GRP_NO * 32)
  {
    _bPlayerErrCode = PLAYER_ERR_USER_DATA;
  }
}

/***************************************************************************
     Function : void vUIStop(void)
  Dsecription : called from Timer task before RISC stop
    Parameter : None
       Return : None
***************************************************************************/
void vUIStop(void) large
{
  _rUI.bState = UI_STOP;

}

/***************************************************************************
     Function : void vUIExit(void)
  Dsecription : called from Timer task after RISC stop
    Parameter : None
       Return : None
***************************************************************************/
void vUIExit(void) large
{
  vVfdBrightSwitch(VFD_BRIGHT_OFF);
}

/***************************************************************************
     Function : BYTE bGetPlayPostKeyPriority(BYTE bKey)
  Dsecription :
    Parameter : None
       Return : None
***************************************************************************/
static BYTE bGetPlayPostKeyPriority(BYTE bKey)
{
  BYTE bPriority = 0xff;

  switch (bKey)
  {
    case IR_POWER:
    case IR_EJECT:
    case IR_MANUAL_EJECT:
      bPriority = 0;

    case IR_PASSWORD:
    case IR_HDN_PASSWORD:
      bPriority = 1;
      break;

    case IR_CMD_DONE:
    case IR_TIME_OUT:
    case IR_DONE:
    case IR_UPG:
    case IR_SELECT_DONE:
      bPriority = 2;
      break;

    default:
      if (bKey < IR_KEY_MAX)
      {
        bPriority = 3;
      }
      break;
  }

  return (bPriority);
}

/***************************************************************************
     Function : void fgSetPlayPostKey(BYTE bKey)
  Dsecription :
    Parameter : None
       Return : None
***************************************************************************/
BOOL fgSetPlayPostKey(BYTE bKey) large
{
  BYTE bNewPri, bCurrPri;

  if (bKey == _bPlayPostKey)
  {
    return (TRUE);
  }

  bNewPri = bGetPlayPostKeyPriority(bKey);
  bCurrPri = bGetPlayPostKeyPriority(_bPlayPostKey);

  if (bNewPri > bCurrPri)
  {
    return (FALSE);
  }

  if (fgIsNoInputState() == FALSE)
  {
    if (bNewPri == 1)
    {
      vSetExitInputState();
    }
  }

  _bPlayPostKey = bKey;

  return (TRUE);
}

#ifdef AUDIO_STREAM_CHANGE_MUTE
/***************************************************************************
     Function : void vSetAudioStreamChange(BYTE bOpt1, BYTE bOpt2, BYTE bOpt3) large
  Dsecription :
    Parameter : None
       Return : None
***************************************************************************/
void vSetAudioStreamChange(BYTE bCnt, BYTE bOpt1, BYTE bOpt2, BYTE bOpt3) large
{
  vSetSharedInfo(SH_CHG_AST_CNT, bCnt);
  vSetSharedInfo(SH_CHG_AST_OPT1, bOpt1);
  vSetSharedInfo(SH_CHG_AST_OPT2, bOpt2);
  vSetSharedInfo(SH_CHG_AST_OPT3, bOpt3);

  _fgAstChg = TRUE;
}
#endif /* AUDIO_STREAM_CHANGE_MUTE */

#ifdef EN_DISC_ID_CHK
/***************************************************************************
     Function : void vSetAudioStreamChange(BYTE bOpt1, BYTE bOpt2, BYTE bOpt3) large
  Dsecription : call from main loop
    Parameter : fgFound, TRUE: ID is found, FALSE: ID is not found
       Return : None
***************************************************************************/
#pragma disable
void vSetDiscIDCheckResult(BOOL fgFound) large
{
  vSetDiscInitFlag(DISC_INIT_LOCK_CHK);
  
  if (fgFound)
  {
    _rOsdStateCtx.bDiscIDFound = TRUE;
  }
  else
  {
    _rOsdStateCtx.bDiscIDFound = FALSE;

    // since no ID id found, no need to check password
    vSetDiscInitFlag(DISC_INIT_WAIT_PWD_IN);
    vSetDiscInitFlag(DISC_INIT_PWD_OK);
  }
}
#endif /* EN_DISC_ID_CHK */

#ifdef PICTURE_QULITY_KEY
void vBBKTimer(void) large 
{
  if(_bOSDClearCounter != 120) {
  	if(_bOSDClearCounter == 0) {
  		vOsdPosClear(OSD_POS_AUD_CTRL);
		_bOSDClearCounter = 120;
		_bPictureMode = EV_PICTURE_OFF;
		_fgInPictureMode = FALSE;
  	}
  	else if(_bOSDClearCounter > 120)
  		_bOSDClearCounter = 120;
  	else if(_bOSDClearCounter > 0)
  		_bOSDClearCounter --;
  	
  }
}
#endif

#ifndef SCART_SELECTION
void vScartSet(void) large
{
  WriteBIM(0x68, (bReadBIM(0x68) & 0xbf)|0x40);
  WriteBIM(0x6b,(bReadBIM(0x6b) & 0xbf)|( 0x40));
}
void vScartClr(void) large
{
  WriteBIM(0x68, (bReadBIM(0x68) & 0xbf)|0x40);
  WriteBIM(0x6b,(bReadBIM(0x6b) & 0xbf)|(0));
}
#endif

⌨️ 快捷键说明

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