From acfd71d1680831026eac3918e2c8e77a86b160aa Mon Sep 17 00:00:00 2001 From: kervala Date: Mon, 10 May 2010 21:49:30 +0200 Subject: [PATCH] Fixed: #875 Add possibility to change default audio driver --- code/ryzom/client/src/client_cfg.cpp | 12 ++++-------- code/ryzom/client/src/client_cfg.h | 2 +- code/ryzom/client/src/sound_manager.cpp | 6 ++++++ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/code/ryzom/client/src/client_cfg.cpp b/code/ryzom/client/src/client_cfg.cpp index c7364dc69..36b197a52 100644 --- a/code/ryzom/client/src/client_cfg.cpp +++ b/code/ryzom/client/src/client_cfg.cpp @@ -382,9 +382,7 @@ CClientConfig::CClientConfig() /////////// // SOUND // SoundOn = true; // Default is with sound. - // hulud patch force fmod - // DriverSound = SoundDrvAuto; - DriverSound = SoundDrvFMod; + DriverSound = SoundDrvAuto; SoundForceSoftwareBuffer = true; SoundOutGameMusic = "Main Menu Loop.ogg"; SoundSFXVolume = 1.f; @@ -1119,19 +1117,17 @@ void CClientConfig::setValues() // SoundOn READ_BOOL_FV(SoundOn) // Sound Driver -#if !FINAL_VERSION varPtr = ClientCfg.ConfigFile.getVarPtr ("DriverSound"); if (varPtr) { - /* hulud patch force fmod if (nlstricmp(varPtr->asString(), "Auto") == 0) ClientCfg.DriverSound = CClientConfig::SoundDrvAuto; else if (nlstricmp(varPtr->asString(), "FMod") == 0) ClientCfg.DriverSound = CClientConfig::SoundDrvFMod; - */ - ClientCfg.DriverSound = CClientConfig::SoundDrvFMod; + else if (nlstricmp(varPtr->asString(), "OpenAL") == 0) ClientCfg.DriverSound = CClientConfig::SoundDrvOpenAL; + else if (nlstricmp(varPtr->asString(), "DirectSound") == 0) ClientCfg.DriverSound = CClientConfig::SoundDrvDirectSound; + else if (nlstricmp(varPtr->asString(), "XAudio2") == 0) ClientCfg.DriverSound = CClientConfig::SoundDrvXAudio2; } else cfgWarning ("Default value used for 'DriverSound' !!!"); -#endif // FINAL_VERSION // SoundForceSoftwareBuffer READ_BOOL_FV(SoundForceSoftwareBuffer); // SoundOutGameMusic diff --git a/code/ryzom/client/src/client_cfg.h b/code/ryzom/client/src/client_cfg.h index 1670524ab..196374712 100644 --- a/code/ryzom/client/src/client_cfg.h +++ b/code/ryzom/client/src/client_cfg.h @@ -49,7 +49,7 @@ using std::string; struct CClientConfig { enum TDriver3D { DrvAuto = 0, OpenGL, Direct3D }; - enum TDriverSound { SoundDrvAuto = 0, SoundDrvFMod }; + enum TDriverSound { SoundDrvAuto = 0, SoundDrvFMod, SoundDrvOpenAL, SoundDrvDirectSound, SoundDrvXAudio2 }; enum TStageLCTUsage { StageUseNoLCT = 0, StageUseAllLCT, StageUsePosOnlyLCT }; // the config file must be always be available diff --git a/code/ryzom/client/src/sound_manager.cpp b/code/ryzom/client/src/sound_manager.cpp index d2532ccae..972731371 100644 --- a/code/ryzom/client/src/sound_manager.cpp +++ b/code/ryzom/client/src/sound_manager.cpp @@ -464,6 +464,12 @@ void CSoundManager::init(IProgressCallback *progressCallBack) UAudioMixer::TDriver driverType= UAudioMixer::DriverAuto; if(ClientCfg.DriverSound==CClientConfig::SoundDrvFMod) driverType= UAudioMixer::DriverFMod; + else if(ClientCfg.DriverSound==CClientConfig::SoundDrvOpenAL) + driverType= UAudioMixer::DriverOpenAl; + else if(ClientCfg.DriverSound==CClientConfig::SoundDrvDirectSound) + driverType= UAudioMixer::DriverDSound; + else if(ClientCfg.DriverSound==CClientConfig::SoundDrvXAudio2) + driverType= UAudioMixer::DriverXAudio2; _AudioMixer->init(ClientCfg.MaxTrack, ClientCfg.UseEax, ClientCfg.UseADPCM, progressCallBack, false, driverType, ClientCfg.SoundForceSoftwareBuffer); /* int nbVoice = _AudioMixer->getPolyphony(); _AudioMixer->setPriorityReserve(HighPri, max(1, nbVoice /2));