1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-19 15:09:43 +00:00

Add a setting to select the sound device name

This commit is contained in:
Chris Robinson 2012-04-07 15:28:38 -07:00
parent b8be867e6e
commit 752e89a268
2 changed files with 18 additions and 1 deletions

View file

@ -7,6 +7,7 @@
#include <OgreRoot.h>
#include <components/esm_store/store.hpp>
#include <components/settings/settings.hpp>
#include "../mwworld/environment.hpp"
#include "../mwworld/world.hpp"
@ -64,7 +65,19 @@ namespace MWSound
for(size_t i = 0;i < names.size();i++)
std::cout <<" "<<names[i]<< std::endl;
mOutput->init();
std::string devname = Settings::Manager::getString("device", "Sound");
try
{
mOutput->init(devname);
}
catch(std::exception &e)
{
if(devname.empty())
throw;
std::cout <<"Failed to open device \""<<devname<<"\", trying default"<< std::endl;
mOutput->init();
Settings::Manager::setString("device", "Sound", "");
}
}
catch(std::exception &e)
{

View file

@ -53,3 +53,7 @@ fog end factor = 1.0
[Terrain]
# Max. number of lights that affect the terrain. Setting to 1 will only reflect sunlight
num lights = 8
[Sound]
# Device name. Blank means default
device =