1
0
Fork 0

update to allow selection of a new sound device

This commit is contained in:
ehofman 2009-11-30 14:24:16 +00:00 committed by Tim Moore
parent fde1a925fe
commit 86cd525200
2 changed files with 12 additions and 1 deletions

View file

@ -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<const char *>(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

View file

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