1
0
Fork 0

Change of thoughts since it makes life easier:

/sim/sound/working		enable/disable the use of OpenAL
/sin/sound/enabled		master mute/unmute
This commit is contained in:
ehofman 2009-11-30 12:05:20 +00:00 committed by Tim Moore
parent 64de526267
commit fde1a925fe
6 changed files with 16 additions and 16 deletions

View file

@ -100,7 +100,7 @@ FGMarkerBeacon::init ()
SGPropertyNode *node = fgGetNode(branch.c_str(), num, true );
// Inputs
sound_pause = fgGetNode("/sim/sound/pause", false);
sound_working = fgGetNode("/sim/sound/working", true);
lon_node = fgGetNode("/position/longitude-deg", true);
lat_node = fgGetNode("/position/latitude-deg", true);
alt_node = fgGetNode("/position/altitude-ft", true);
@ -176,7 +176,7 @@ FGMarkerBeacon::update(double dt)
}
if ( has_power() && serviceable->getBoolValue()
&& !sound_pause->getBoolValue()) {
&& sound_working->getBoolValue()) {
// marker beacon blinking
bool light_on = ( outer_blink || middle_blink || inner_blink );

View file

@ -55,7 +55,7 @@ class FGMarkerBeacon : public SGSubsystem
SGPropertyNode_ptr audio_btn;
SGPropertyNode_ptr audio_vol;
SGPropertyNode_ptr serviceable;
SGPropertyNode_ptr sound_pause;
SGPropertyNode_ptr sound_working;
bool need_update;

View file

@ -226,7 +226,7 @@ setFreeze (bool f)
if ( smgr != NULL ) {
if ( f ) {
smgr->suspend();
} else if (!fgGetBool("/sim/sound/pause")) {
} else if (fgGetBool("/sim/sound/working")) {
smgr->resume();
}
}

View file

@ -480,19 +480,19 @@ static void fgMainLoop( void ) {
// Update the sound manager last so it can use the CPU while the GPU
// is processing the scenery (doubled the frame-rate for me) -EMH-
#ifdef ENABLE_AUDIO_SUPPORT
static SGPropertyNode *sound_pause = fgGetNode("/sim/sound/pause");
static SGPropertyNode *sound_enabled = fgGetNode("/sim/sound/enabled");
static SGSoundMgr *smgr = globals->get_soundmgr();
static bool smgr_suspend = false;
if (smgr_suspend != sound_pause->getBoolValue()) {
if (smgr_suspend == false) { // request to suspend
static bool smgr_enabled = true;
if (smgr_enabled != sound_enabled->getBoolValue()) {
if (smgr_enabled == true) { // request to suspend
smgr->suspend();
} else {
smgr->resume();
}
smgr_suspend = sound_pause->getBoolValue();
smgr_enabled = sound_enabled->getBoolValue();
}
if (smgr_suspend == false) {
if (smgr_enabled == true) {
static SGPropertyNode *volume = fgGetNode("/sim/sound/volume");
smgr->set_volume(volume->getFloatValue());
smgr->update(delta_time_sec);
@ -504,7 +504,7 @@ static void fgMainLoop( void ) {
if (!scenery_loaded && globals->get_tile_mgr()->isSceneryLoaded()
&& cur_fdm_state->get_inited()) {
fgSetBool("sim/sceneryloaded",true);
if (fgGetBool("/sim/sound/enabled")) {
if (fgGetBool("/sim/sound/working")) {
smgr->activate();
} else {
smgr->stop();

View file

@ -189,7 +189,7 @@ fgSetDefaults ()
fgSetBool("/sim/hud/visibility", false);
fgSetBool("/sim/panel/visibility", true);
fgSetBool("/sim/sound/enabled", true);
fgSetBool("/sim/sound/pause", false);
fgSetBool("/sim/sound/working", true);
// Flight Model options
fgSetString("/sim/flight-model", "jsb");
@ -1293,8 +1293,8 @@ struct OptionDesc {
{"enable-hud", false, OPTION_BOOL, "/sim/hud/visibility", true, "", 0 },
{"disable-panel", false, OPTION_BOOL, "/sim/panel/visibility", false, "", 0 },
{"enable-panel", false, OPTION_BOOL, "/sim/panel/visibility", true, "", 0 },
{"disable-sound", false, OPTION_BOOL, "/sim/sound/enabled", false, "", 0 },
{"enable-sound", false, OPTION_BOOL, "/sim/sound/enabled", true, "", 0 },
{"disable-sound", false, OPTION_BOOL, "/sim/sound/working", false, "", 0 },
{"enable-sound", false, OPTION_BOOL, "/sim/sound/working", true, "", 0 },
{"sound-device", true, OPTION_STRING, "/sim/sound/device-name", false, "", 0 },
{"airport", true, OPTION_STRING, "/sim/presets/airport-id", false, "", 0 },
{"runway", true, OPTION_FUNC, "", false, "", fgOptRunway },

View file

@ -35,7 +35,7 @@ FGVoiceMgr::FGVoiceMgr() :
_host(fgGetString(VOICE "/host", "localhost")),
_port(fgGetString(VOICE "/port", "1314")),
_enabled(fgGetBool(VOICE "/enabled", false)),
_pausedNode(fgGetNode("/sim/sound/pause", true))
_pausedNode(fgGetNode("/sim/sound/working", true))
{
#if defined(ENABLE_THREADS)
if (!_enabled)
@ -83,7 +83,7 @@ void FGVoiceMgr::update(double)
if (!_enabled)
return;
_paused = _pausedNode->getBoolValue();
_paused = !_pausedNode->getBoolValue();
for (unsigned int i = 0; i < _voices.size(); i++) {
_voices[i]->update();
#if !defined(ENABLE_THREADS)