]> git.mxchange.org Git - flightgear.git/commitdiff
Change of thoughts since it makes life easier:
authorehofman <ehofman>
Mon, 30 Nov 2009 12:05:20 +0000 (12:05 +0000)
committerTim Moore <timoore@redhat.com>
Mon, 30 Nov 2009 21:45:23 +0000 (22:45 +0100)
/sim/sound/working enable/disable the use of OpenAL
/sin/sound/enabled master mute/unmute

src/Instrumentation/marker_beacon.cxx
src/Instrumentation/marker_beacon.hxx
src/Main/fg_props.cxx
src/Main/main.cxx
src/Main/options.cxx
src/Sound/voice.cxx

index d2e9774b702dacc4f0c6a81eaa4172d609e7fff5..c9f7c9a34b54855a40204d432efe6af211a278b5 100644 (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 );
index 3a98c11cd7accea4ae07f3174e125f3febe3df39..25e435feae4b4d93d96e49e4bfd8a25b1f48d118 100644 (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;
 
index f18c5fb92d2578683d339988e7f39555e94af300..066f0262b0e56d85f14bc3df5ed308221a9f7d9d 100644 (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();
         }
     }
index 896a38bfed983cc530f406758cea8b59a72d2a77..07d232a80cf45e2a5883021298449a9923e7d718 100644 (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();
index b46424e53e71c4bc059bb4a0f0c63b6247bf4ab3..ceca89101118ad9d04c3ec6614bb9c705967776c 100644 (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 },
index 04e9a3debaac352d34bd4eb73acc6aa48ddc6359..7ba8b2fb9c8020987d773d2384144cb41e9797c1 100644 (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)