diff --git a/src/Instrumentation/marker_beacon.cxx b/src/Instrumentation/marker_beacon.cxx index d2e9774b7..c9f7c9a34 100644 --- a/src/Instrumentation/marker_beacon.cxx +++ b/src/Instrumentation/marker_beacon.cxx @@ -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 ); diff --git a/src/Instrumentation/marker_beacon.hxx b/src/Instrumentation/marker_beacon.hxx index 3a98c11cd..25e435fea 100644 --- a/src/Instrumentation/marker_beacon.hxx +++ b/src/Instrumentation/marker_beacon.hxx @@ -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; diff --git a/src/Main/fg_props.cxx b/src/Main/fg_props.cxx index f18c5fb92..066f0262b 100644 --- a/src/Main/fg_props.cxx +++ b/src/Main/fg_props.cxx @@ -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(); } } diff --git a/src/Main/main.cxx b/src/Main/main.cxx index 896a38bfe..07d232a80 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -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(); diff --git a/src/Main/options.cxx b/src/Main/options.cxx index b46424e53..ceca89101 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -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 }, diff --git a/src/Sound/voice.cxx b/src/Sound/voice.cxx index 04e9a3deb..7ba8b2fb9 100644 --- a/src/Sound/voice.cxx +++ b/src/Sound/voice.cxx @@ -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)