📄 ircmd_audio.c
字号:
/**************************************************************************
* *
* Copyright (c) 2002 by Sunplus Technology Co., Ltd. *
* *
* This software is copyrighted by and is the property of Sunplus *
* Technology Co., Ltd. All rights are reserved by Sunplus Technology *
* Co., Ltd. This software may only be used in accordance with the *
* corresponding license agreement. Any unauthorized use, duplication, *
* distribution, or disclosure of this software is expressly forbidden. *
* *
* This Copyright notice MUST not be removed or modified without prior *
* written consent of Sunplus Technology Co., Ltd. *
* *
* Sunplus Technology Co., Ltd. reserves the right to modify this *
* software without notice. *
* *
* Sunplus Technology Co., Ltd. *
* 19, Innovation First Road, Science-Based Industrial Park, *
* Hsin-Chu, Taiwan, R.O.C. *
**************************************************************************/
/*--------------------------------------------------------------------------
| File Name : ircmd_audio.c
|
| Description : realize audio language function in IR audio language key.
|
| Version : 0.1
|
|
| Rev Date Author(s) Status & Comments
|---------------------------------------------------------------------------------
| 0.1 2004/1/14 Terry Creating
|--------------------------------------------------------------------------------*/
#define is_dvd() (cd_type_loaded == CDDVD)//move from ircmd_3dsound.c 2004-4-10 17:24
//wangap add for downmix off volume 2004/3/3
#ifndef AC3_BASS_MANAGEMENT
extern BYTE cspk_volume;
extern BYTE fspk_volume;
extern BYTE sspk_volume;
extern int downmix_off;
#endif
//Maoyong add 2004.02.14 must be same with the one in disp.c
#define MAX_ENG_WORDS 3
static inline void set_audio_pl2(void)
{
#ifdef AUDIO_2CH_5_1CH//zhaoyanhua add 03-11-3 15:07
#ifdef SUPPORT_PROLOGIC_II //axel 2004/1/28 10:39
if(pDSV->dNs_Audio_ch!=5)//when 2channle auido,must open PROLOGIC II
{
if(ChannelFlag == AUDIO_5_1CH)
AudioSetPrologic_IIOutput();
}
else
#endif //SUPPORT_PROLOGIC_II
{
//when 5.1channelaudio, current output mode is PROLOGIC II
// must change to 5.1ch.
#ifdef SUPPORT_PROLOGIC_II //axel 2004/1/28 10:39
if((ChannelFlag == AUDIO_5_1CH)&&(setup_GetPrologicII() != 4))
#else
if(ChannelFlag == AUDIO_5_1CH)
#endif //SUPPORT_PROLOGIC_II
AudioSet5_1chOutput();
}
#endif
}
/**************************************************************************
* Function Name: only_audio_mute
* Purposes:
* audio mute when enter one playing.
* Descriptions:
* mute audio when FF switch to play and play switch to FF.
* Arguments:
* audioNotContinuous:>0:audio is not continuous.
* for example, audioNotContinuous=5:mute 50ms.
*
* Returns: NONE
* See also: NONE
*
**************************************************************************/
void only_audio_mute(void)
{
if ( ( (cd_type_loaded==CDDA) || (cd_type_loaded==CDROM) ) &&
(adv_search_time<=2) && (adv_search_time>=-2) )
{ //Jeff 20020918
audioNotContinuous=5; //to do extra mute(50ms) when enter one playing, Jeff 20020910
}
}
/*
* Terry,2004/1/13 11:58AM
* mute = 1 : mute
* mute = 2 : demute
* other : abort
*/
#if 0
void audio_codec_chg_mute(int mute)
{
if(mute==1)
{
if (!user_mute)
{
audioNotContinuous=5;
AudioSetVolume(0);
#ifdef CHANGE_DSP_SPDIF_OFF
AudioSetSPDIF(0); //S-PDIF off mode command to DSP(0:off)
delay_srv_10ms(5);
#endif//CHANGE_DSP_SPDIF_OFF
}
}else if(mute==2)
{
//to unmute immediatelly when no audio-language could be selected.
//Because valid selection is (determined and set) in deep (Audio_stream_Chg-Select_ASTN),
//we undo former mute work here.
#ifdef CHANGE_DSP_SPDIF_OFF //nono 2003-12-23 20:14
setup_SetSPDIFConfig();
AudioSetPause();
AudioSetPlay();
#endif//#ifdef CHANGE_DSP_SPDIF_OFF
audioNotContinuous=0;
AudioDemute();
}
}
#endif
#ifdef SUPPORT_MP4
void set_audio_language_Ns(UINT8 Ns)
{
//pDSV->dAv_AST_Ns = Ns-1;
pDSV->dAv_AST_Ns = Ns;//nono 4-8-25 15:49
}
#endif
//terry,2004/4/8 05:38PM
#define is_svcd() (cd_type_loaded==CDSVCD)
#ifdef SUPPORT_MP4
#define is_mp4() (GetCurrentFileType()==CDROM_MP4)
#else
#define is_mp4() (0)
#endif
#ifdef CHANNEL_SVCD_VALID//EASTECH
#define is_channel() ( (!is_dvd())&&(!is_mp4()) ) //(!is_svcd())&& Modified by Tom
#else
#define is_channel() ( (!is_svcd())&&(!is_dvd())&&(!is_mp4()) )
#endif
#define is_language() ( is_svcd()||is_mp4() )
/*
* Terry,2004/1/13 11:46AM
*/
/**************************************************************************
* Function Name: ircmd_audio_language
* Purposes:
* realize audio language function using IR language key,
* switch different audio track for dvd .
* Descriptions:
*
* Arguments:
* id: audio stream.
* Audio_stream_Chg: Ouput: 0~7:audio stream id 0xf:fail
* The operation to set the stream number of
the audio and to change SPRM.
* Returns: NONE
* See also: NONE
*
**************************************************************************/
#ifdef SUPPORT_LINE_OUT_MUTE
extern void use_rom_line_out_mute(void);
extern void use_rom_line_out_demute(void);
#endif
void ircmd_audio_language(void)
{
#ifndef MAKE_ONLY_UPDATE_CODE//MAKE_ONLY_UPDATE_CODE:20050305 linrc only for make romA.bin(BootLoad).
UINT16 id = 0;
//----------------------------------------------------------------
// Conditions in which we wish to override the whole function
//----------------------------------------------------------------
#ifdef AUDIO_KEY_CONTROL_CHANNEL //libing 2005-4-21 22:00
if((cd_type_loaded == CDVCD10)||(cd_type_loaded == CDVCD20))//||(cd_type_loaded==CDSVCD))
{
ircmd_channel();
return;
}
if( is_channel() )
{
#ifdef CHANNEL_CD_MP3_INVALID
if(Is_MP3_STATE()==1 || Is_JPEG_STATE() ) //add by Tom
{
invalid_key();
return;
}
#endif //#ifdef CHANNEL_CD_MP3_INVALID
ircmd_channel();
return;
}
#endif //#ifdef AUDIO_KEY_CONTROL_CHANNEL
#ifdef DVB1000_NON_OS //moved from dvb_gui_util.c for supporting multi-APID by liuchuanyi 05/04/18
if(system_state==SYSTEM_TS)
{
dvbAPIDSwitch();
return;
}
#endif //#ifdef DVB1000_NON_OS
//-------------------------------------------------------------------------
// Conditions in which we want to show invalid key or just ignore the key
//-------------------------------------------------------------------------
//kevinmonkey 060606 if IR command flows to this place, check stream number.
//currently meant for mpeg2 and AVI with subpicture/subtitle or multi audio track
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -