diff --git a/src/Main/main.cxx b/src/Main/main.cxx index 07d232a80..ca63accb2 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -104,6 +104,8 @@ long global_multi_loop; SGTimeStamp last_time_stamp; SGTimeStamp current_time_stamp; +void fgSetNewSoundDevice(const char *); + // The atexit() function handler should know when the graphical subsystem // is initialized. extern int _bootstrap_OSInit; @@ -509,6 +511,7 @@ static void fgMainLoop( void ) { } else { smgr->stop(); } + globals->get_props()->tie("/sim/sound/device", SGRawValueFunctions(0, fgSetNewSoundDevice), false); } fgRequestRedraw(); @@ -516,6 +519,14 @@ static void fgMainLoop( void ) { SG_LOG( SG_ALL, SG_DEBUG, "" ); } +void fgSetNewSoundDevice(const char *device) +{ + globals->get_soundmgr()->suspend(); + globals->get_soundmgr()->stop(); + globals->get_soundmgr()->init(device); + globals->get_soundmgr()->resume(); +} + // Operation for querying OpenGL parameters. This must be done in a // valid OpenGL context, potentially in another thread. namespace diff --git a/src/Main/options.cxx b/src/Main/options.cxx index ceca89101..e03f1b1f0 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -204,7 +204,7 @@ fgSetDefaults () fgSetBool("/sim/rendering/shading", true); fgSetBool("/sim/rendering/skyblend", true); fgSetBool("/sim/rendering/textures", true); - fgTie( "/sim/rendering/filtering", SGGetTextureFilter, SGSetTextureFilter, false); + fgTie( "/sim/rendering/filtering", SGGetTextureFilter, SGSetTextureFilter, false); fgSetInt("/sim/rendering/filtering", 1); fgSetBool("/sim/rendering/wireframe", false); fgSetBool("/sim/rendering/horizon-effect", false);