str_os_downmix_setup.inc
上传用户:caisangzi8
上传日期:2013-10-25
资源大小:15756k
文件大小:11k
源码类别:

DVD

开发平台:

C/C++

  1. #include "user_init.h"
  2. #include "global.h"
  3. #include "osd.h"
  4. #include "auddrv.h" //2004AUDDRV oliver 20041004 for using audio driver purpose
  5. //#include "audif.h"
  6. extern void setup_saveVal(void);
  7. void
  8. str_os_downmix_setup(int sub_id)
  9. {
  10. #ifdef DVD_SETUP_REENG
  11. UINT16 P=0;
  12. UINT16 I=0;
  13. #endif
  14.                     if (sub_id==STR_OS_LTRT_SETUP) {
  15.                         #ifndef AC3_BASS_MANAGEMENT
  16.                         downmix_off=0;
  17.                         #endif 
  18.                         AUDIF_Set_OutputMode(OUT_51DownmixLtRt, 0);//2004AUDDRV AudioSetOutputMode(0x08, 0); //Set Output mode(8:AC3 downmix Lt/Rt)
  19.                         if (full_scrn & SETUP)
  20.                             setup_ShowAC3Config();
  21.                         //set front speak gain to max., bec4 now the volume is controled only by master volume
  22.                         #ifdef CNTR_5SPK_VOLUME //wangfeng 2003-11-07 17:45
  23.                         AUDIF_Set_FSPKGain(40);//2004AUDDRV AudioSetFSPKGain(40);
  24.                         #else
  25.                         AUDIF_Set_FSPKGain(8);//2004AUDDRV AudioSetFSPKGain(8);
  26.                         #endif
  27.                         
  28.   #ifdef DVD_SETUP_REENG //jslin //20040827
  29.                      //if (setup_VA[SETUP_VA_KEY] != MIN_ITEM_SEL) {//(SETUP_KEY!=2) {
  30.                             //recover key-status
  31.                             AUDIF_Set_Key(setup_VA[SETUP_VA_KEY]);//2004AUDDRV AudioSetKey(setup_VA[SETUP_VA_KEY]); //audio_key:-6 ~ 6, map to 1~15
  32.                         //}
  33.                     #else
  34.                      //if (SETUP_KEY!=2) {
  35.                             //recover key-status
  36.                             AUDIF_Set_Key(SETUP_KEY);//2004AUDDRV AudioSetKey(SETUP_KEY); //audio_key:-6 ~ 6, map to 1~15
  37.                         //}
  38.                     #endif //end of DVD_SETUP_REENG    
  39.                     } else
  40.                         if (sub_id==STR_OS_STEREO) {
  41.                             #ifndef AC3_BASS_MANAGEMENT
  42.                                                         downmix_off=0;
  43.                                                         #endif 
  44.                             AUDIF_Set_OutputMode(OUT_51DownmixL0R0, 0);//2004AUDDRV AudioSetOutputMode(0x07, 0); //Set Output mode(7:AC3 downmix L0 R0)
  45.                             if ((full_scrn & SETUP)
  46.                             #ifdef AUDIO_2CH_5_1CH//zhaoyanhua 03-11-2 20:01
  47.                                 || (ChannelFlag == 0)
  48.                             #endif
  49.                                 )
  50.                                 setup_ShowAC3Config();
  51.             
  52.                             //set front speak gain to max., bec4 now the volume is controled only by master volume
  53.                             #ifdef VOL_80
  54.                             AUDIF_Set_FSPKGain(40);
  55.                             #endif
  56.                             #ifdef CNTR_5SPK_VOLUME //wangfeng 2003-11-07 17:45
  57.                             AUDIF_Set_FSPKGain(40);//2004AUDDRV AudioSetFSPKGain(40);
  58.                             #else
  59.                             AUDIF_Set_FSPKGain(8);//2004AUDDRV AudioSetFSPKGain(8);
  60.                             #endif
  61.   #ifdef DVD_SETUP_REENG //jslin //20040827
  62.                      //if (setup_VA[SETUP_VA_KEY] != MIN_ITEM_SEL) {//(SETUP_KEY!=2) {
  63.                             //recover key-status
  64.                             AUDIF_Set_Key(setup_VA[SETUP_VA_KEY]);//2004AUDDRV AudioSetKey(setup_VA[SETUP_VA_KEY]); //audio_key:-6 ~ 6, map to 1~15
  65.                         //}
  66.                     #else
  67.                         //if (SETUP_KEY!=2) {
  68.                                 //recover key-status
  69.                             AUDIF_Set_Key(SETUP_KEY);//2004AUDDRV AudioSetKey(SETUP_KEY); //audio_key:-6 ~ 6, map to 1~15
  70.                         //}
  71.                     #endif //end of DVD_SETUP_REENG        
  72.                         } else
  73.                             if (sub_id==STR_OS_VSURROUND_SETUP) {
  74.                                 #ifndef AC3_BASS_MANAGEMENT
  75.                                                                 downmix_off=0;
  76.                                                                 #endif 
  77.                                 AUDIF_Set_OutputMode(OUT_51DownmixLsRs, 0);//2004AUDDRV AudioSetOutputMode(0x09, 0); //Set Output mode(9:2 channel, surround effect)
  78.                                 if (full_scrn & SETUP)
  79.                                     setup_ShowAC3Config();
  80.                                 //set front speak gain to max., bec4 now the volume is controled only by master volume
  81.                                 #ifdef CNTR_5SPK_VOLUME //wangfeng 2003-11-07 17:45
  82.                                 AUDIF_Set_FSPKGain(40);//2004AUDDRV AudioSetFSPKGain(40);
  83.                                 #else
  84.                                 AUDIF_Set_FSPKGain(8);//2004AUDDRV AudioSetFSPKGain(8);
  85.                                 #endif
  86. #ifdef DVD_SETUP_REENG
  87.                                 //if (setup_VA[SETUP_VA_KEY] != MIN_ITEM_SEL) {//(SETUP_KEY!=2) {
  88.                                     //recover key-status
  89.                                     AUDIF_Set_Key(setup_VA[SETUP_VA_KEY]);//2004AUDDRV AudioSetKey(setup_VA[SETUP_VA_KEY]); //audio_key:-6 ~ 6, map to 1~15
  90.                                 //}
  91. #else
  92.                                 //if (SETUP_KEY!=2) {
  93.                                     //recover key-status
  94.                                     AUDIF_Set_Key(SETUP_KEY);//2004AUDDRV AudioSetKey(SETUP_KEY); //audio_key:-6 ~ 6, map to 1~15
  95.                                 //}
  96.                             #endif //end of SETUP_DVD_REENG
  97.                             } else {
  98. #ifndef AUDIO_2CH_5_1CH    //terry,2004/1/7 07:43PM
  99.                                 //off
  100.                                 #ifndef AC3_BASS_MANAGEMENT
  101.                                  downmix_off=1;
  102.                                 #endif
  103.                                  
  104.                            //added by JS //for DVD_SETUP_REENG //20040827
  105.                            #ifdef DVD_SETUP_REENG
  106. P=setup_getItemPos(STR_OS_AUD_OUT);
  107. I=P&0xff;
  108. P=P>>8;
  109.                 
  110.                                 if ( (setup_item[P][I][setup_VA[SETUP_VA_AUD_OUT]]==STR_OS_STEREO_PCM) &&//(SETUP_SPDIF==SPDIFPCM) && //Jeff 20020521
  111.                                     ( coding_mode_now&(AUDIF_CODING_MODE_AC3|AUDIF_CODING_MODE_DTS|AUDIF_CODING_MODE_DTSCD))
  112.                                     )
  113.                                 {
  114.                                     //Force to do down-mix load when some decoders with multi-spk ability Jeff 20020415
  115.                                     AUDIF_Set_OutputMode(OUT_51DownmixL0R0, 0);//2004AUDDRV AudioSetOutputMode(7, 0); //Set Output mode(7:2 channel)
  116.                                 }                            
  117.                            #else      
  118.                                 if ( (SETUP_SPDIF==SPDIFPCM) && //Jeff 20020521
  119.                                     ( coding_mode_now&(AUDIF_CODING_MODE_AC3|
  120.                                     AUDIF_CODING_MODE_DTS|
  121.                                     AUDIF_CODING_MODE_DTSCD))
  122.                                     )
  123.                                 {
  124.                                     //Force to do down-mix load when some decoders with multi-spk ability Jeff 20020415
  125.                                     AUDIF_Set_OutputMode(OUT_51DownmixL0R0, 0);//2004AUDDRV AudioSetOutputMode(7, 0); //Set Output mode(7:2 channel)
  126.                                 } 
  127.                            #endif //end of DVD_SETUP_REENG      
  128.                            else 
  129. #endif                                
  130.                                 {
  131.                                     AUDIF_Set_OutputMode(OUT_51Channel, 0);//2004AUDDRV AudioSetOutputMode(6, 0); //Set Output mode(4:AC3 5.1 channel)
  132.                                 }
  133.                             //    printf("-----------DOWMIX OFF --n");
  134.                                 if( (full_scrn & SETUP)
  135.                                 #ifdef AUDIO_2CH_5_1CH
  136.                                     ||(ChannelFlag)
  137.                                 #endif
  138.                                     )
  139.                                     setup_ShowAC3Config();
  140. #ifdef DVD_SETUP_REENG
  141.                              //set center speaker delay, 1:center speaker
  142.                                 AUDIF_Set_SpkDelay(1, setup_VA[SETUP_VA_CSPK_DELAY]-MIN_ITEM_SEL);//2004AUDDRV AudioSetSpkDelay(1, setup_VA[SETUP_VA_CSPK_DELAY]-MIN_ITEM_SEL);
  143.                              //set surround speaker delay, 2:surround speaker
  144.                                 AUDIF_Set_SpkDelay(2, (setup_VA[SETUP_VA_SSPK_DELAY]-MIN_ITEM_SEL)*3);//2004AUDDRV AudioSetSpkDelay(2, (setup_VA[SETUP_VA_SSPK_DELAY]-MIN_ITEM_SEL)*3);
  145.                                 #ifndef AC3_BASS_MANAGEMENT
  146.                              //set front speaker gain
  147.                                 AUDIF_Set_FSPKGain(setup_VA[SETUP_VA_FSPK]-MIN_ITEM_SEL);//2004AUDDRV AudioSetFSPKGain(setup_VA[SETUP_VA_FSPK]-MIN_ITEM_SEL);
  148.                                 //set center speaker gain
  149.                                 AUDIF_Set_CSPKGain(setup_VA[SETUP_VA_CSPK]-MIN_ITEM_SEL);//2004AUDDRV AudioSetCSPKGain(setup_VA[SETUP_VA_CSPK]-MIN_ITEM_SEL);
  150.                                 //set surround speaker gain
  151.                                 AUDIF_Set_SSPKGain(setup_VA[SETUP_VA_SSPK]-MIN_ITEM_SEL);//2004AUDDRV AudioSetSSPKGain(setup_VA[SETUP_VA_SSPK]-MIN_ITEM_SEL);
  152.                                 #endif //#ifndef AC3_BASS_MANAGEMENT
  153. #else
  154.                              //set center speaker delay, 1:center speaker
  155.                                 AUDIF_Set_SpkDelay(1, SETUP_SPK_CENTER_DELAY-2);//2004AUDDRV AudioSetSpkDelay(1, SETUP_SPK_CENTER_DELAY-2);
  156.                              //set surround speaker delay, 2:surround speaker
  157.                                 AUDIF_Set_SpkDelay(2, (SETUP_SPK_SURROUND_DELAY-2)*3);//2004AUDDRV AudioSetSpkDelay(2, (SETUP_SPK_SURROUND_DELAY-2)*3);
  158.                                 #ifndef AC3_BASS_MANAGEMENT
  159.                              //set front speaker gain
  160.                                 AUDIF_Set_FSPKGain(SETUP_SPK_FRONT-2);//2004AUDDRV AudioSetFSPKGain(SETUP_SPK_FRONT-2);
  161.                                 //set center speaker gain
  162.                                 AUDIF_Set_CSPKGain(SETUP_SPK_CENTER-2);//2004AUDDRV AudioSetCSPKGain(SETUP_SPK_CENTER-2);
  163.                                 //set surround speaker gain
  164.                                 AUDIF_Set_SSPKGain(SETUP_SPK_SURROUND-2);//2004AUDDRV AudioSetSSPKGain(SETUP_SPK_SURROUND-2);
  165.                                 #endif //#ifndef AC3_BASS_MANAGEMENT
  166. #endif //end of DVD_SETUP_REENG
  167.                                 //Set AC3Digital Dynamic range
  168.                                 #ifndef NO_AC3_DYNAMIC_RANGE
  169.                                 set_AC3DynamicRange();
  170.                                 #endif //#ifndef NO_AC3_DYNAMIC_RANGE
  171.                             }
  172. #ifdef DVD_SETUP_REENG
  173. setup_saveVal();//this may need to be modified if called by IR command function
  174. #else
  175.     run_save_sel_cmd(MULTISPKPAGE, AC3DOWNMIXITEM);//nono 2003-7-31 21:59
  176. #endif //end of DVD_SETUP_REENG
  177. }