Add a setting to select the sound device name

actorid
Chris Robinson 13 years ago
parent b8be867e6e
commit 752e89a268

@ -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)
{

@ -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 =

Loading…
Cancel
Save