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:
parent
64de526267
commit
fde1a925fe
6 changed files with 16 additions and 16 deletions
|
@ -100,7 +100,7 @@ FGMarkerBeacon::init ()
|
||||||
|
|
||||||
SGPropertyNode *node = fgGetNode(branch.c_str(), num, true );
|
SGPropertyNode *node = fgGetNode(branch.c_str(), num, true );
|
||||||
// Inputs
|
// Inputs
|
||||||
sound_pause = fgGetNode("/sim/sound/pause", false);
|
sound_working = fgGetNode("/sim/sound/working", true);
|
||||||
lon_node = fgGetNode("/position/longitude-deg", true);
|
lon_node = fgGetNode("/position/longitude-deg", true);
|
||||||
lat_node = fgGetNode("/position/latitude-deg", true);
|
lat_node = fgGetNode("/position/latitude-deg", true);
|
||||||
alt_node = fgGetNode("/position/altitude-ft", true);
|
alt_node = fgGetNode("/position/altitude-ft", true);
|
||||||
|
@ -176,7 +176,7 @@ FGMarkerBeacon::update(double dt)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( has_power() && serviceable->getBoolValue()
|
if ( has_power() && serviceable->getBoolValue()
|
||||||
&& !sound_pause->getBoolValue()) {
|
&& sound_working->getBoolValue()) {
|
||||||
|
|
||||||
// marker beacon blinking
|
// marker beacon blinking
|
||||||
bool light_on = ( outer_blink || middle_blink || inner_blink );
|
bool light_on = ( outer_blink || middle_blink || inner_blink );
|
||||||
|
|
|
@ -55,7 +55,7 @@ class FGMarkerBeacon : public SGSubsystem
|
||||||
SGPropertyNode_ptr audio_btn;
|
SGPropertyNode_ptr audio_btn;
|
||||||
SGPropertyNode_ptr audio_vol;
|
SGPropertyNode_ptr audio_vol;
|
||||||
SGPropertyNode_ptr serviceable;
|
SGPropertyNode_ptr serviceable;
|
||||||
SGPropertyNode_ptr sound_pause;
|
SGPropertyNode_ptr sound_working;
|
||||||
|
|
||||||
bool need_update;
|
bool need_update;
|
||||||
|
|
||||||
|
|
|
@ -226,7 +226,7 @@ setFreeze (bool f)
|
||||||
if ( smgr != NULL ) {
|
if ( smgr != NULL ) {
|
||||||
if ( f ) {
|
if ( f ) {
|
||||||
smgr->suspend();
|
smgr->suspend();
|
||||||
} else if (!fgGetBool("/sim/sound/pause")) {
|
} else if (fgGetBool("/sim/sound/working")) {
|
||||||
smgr->resume();
|
smgr->resume();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -480,19 +480,19 @@ static void fgMainLoop( void ) {
|
||||||
// Update the sound manager last so it can use the CPU while the GPU
|
// 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-
|
// is processing the scenery (doubled the frame-rate for me) -EMH-
|
||||||
#ifdef ENABLE_AUDIO_SUPPORT
|
#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 SGSoundMgr *smgr = globals->get_soundmgr();
|
||||||
static bool smgr_suspend = false;
|
static bool smgr_enabled = true;
|
||||||
if (smgr_suspend != sound_pause->getBoolValue()) {
|
if (smgr_enabled != sound_enabled->getBoolValue()) {
|
||||||
if (smgr_suspend == false) { // request to suspend
|
if (smgr_enabled == true) { // request to suspend
|
||||||
smgr->suspend();
|
smgr->suspend();
|
||||||
} else {
|
} else {
|
||||||
smgr->resume();
|
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");
|
static SGPropertyNode *volume = fgGetNode("/sim/sound/volume");
|
||||||
smgr->set_volume(volume->getFloatValue());
|
smgr->set_volume(volume->getFloatValue());
|
||||||
smgr->update(delta_time_sec);
|
smgr->update(delta_time_sec);
|
||||||
|
@ -504,7 +504,7 @@ static void fgMainLoop( void ) {
|
||||||
if (!scenery_loaded && globals->get_tile_mgr()->isSceneryLoaded()
|
if (!scenery_loaded && globals->get_tile_mgr()->isSceneryLoaded()
|
||||||
&& cur_fdm_state->get_inited()) {
|
&& cur_fdm_state->get_inited()) {
|
||||||
fgSetBool("sim/sceneryloaded",true);
|
fgSetBool("sim/sceneryloaded",true);
|
||||||
if (fgGetBool("/sim/sound/enabled")) {
|
if (fgGetBool("/sim/sound/working")) {
|
||||||
smgr->activate();
|
smgr->activate();
|
||||||
} else {
|
} else {
|
||||||
smgr->stop();
|
smgr->stop();
|
||||||
|
|
|
@ -189,7 +189,7 @@ fgSetDefaults ()
|
||||||
fgSetBool("/sim/hud/visibility", false);
|
fgSetBool("/sim/hud/visibility", false);
|
||||||
fgSetBool("/sim/panel/visibility", true);
|
fgSetBool("/sim/panel/visibility", true);
|
||||||
fgSetBool("/sim/sound/enabled", true);
|
fgSetBool("/sim/sound/enabled", true);
|
||||||
fgSetBool("/sim/sound/pause", false);
|
fgSetBool("/sim/sound/working", true);
|
||||||
|
|
||||||
// Flight Model options
|
// Flight Model options
|
||||||
fgSetString("/sim/flight-model", "jsb");
|
fgSetString("/sim/flight-model", "jsb");
|
||||||
|
@ -1293,8 +1293,8 @@ struct OptionDesc {
|
||||||
{"enable-hud", false, OPTION_BOOL, "/sim/hud/visibility", true, "", 0 },
|
{"enable-hud", false, OPTION_BOOL, "/sim/hud/visibility", true, "", 0 },
|
||||||
{"disable-panel", false, OPTION_BOOL, "/sim/panel/visibility", false, "", 0 },
|
{"disable-panel", false, OPTION_BOOL, "/sim/panel/visibility", false, "", 0 },
|
||||||
{"enable-panel", false, OPTION_BOOL, "/sim/panel/visibility", true, "", 0 },
|
{"enable-panel", false, OPTION_BOOL, "/sim/panel/visibility", true, "", 0 },
|
||||||
{"disable-sound", false, OPTION_BOOL, "/sim/sound/enabled", false, "", 0 },
|
{"disable-sound", false, OPTION_BOOL, "/sim/sound/working", false, "", 0 },
|
||||||
{"enable-sound", false, OPTION_BOOL, "/sim/sound/enabled", true, "", 0 },
|
{"enable-sound", false, OPTION_BOOL, "/sim/sound/working", true, "", 0 },
|
||||||
{"sound-device", true, OPTION_STRING, "/sim/sound/device-name", false, "", 0 },
|
{"sound-device", true, OPTION_STRING, "/sim/sound/device-name", false, "", 0 },
|
||||||
{"airport", true, OPTION_STRING, "/sim/presets/airport-id", false, "", 0 },
|
{"airport", true, OPTION_STRING, "/sim/presets/airport-id", false, "", 0 },
|
||||||
{"runway", true, OPTION_FUNC, "", false, "", fgOptRunway },
|
{"runway", true, OPTION_FUNC, "", false, "", fgOptRunway },
|
||||||
|
|
|
@ -35,7 +35,7 @@ FGVoiceMgr::FGVoiceMgr() :
|
||||||
_host(fgGetString(VOICE "/host", "localhost")),
|
_host(fgGetString(VOICE "/host", "localhost")),
|
||||||
_port(fgGetString(VOICE "/port", "1314")),
|
_port(fgGetString(VOICE "/port", "1314")),
|
||||||
_enabled(fgGetBool(VOICE "/enabled", false)),
|
_enabled(fgGetBool(VOICE "/enabled", false)),
|
||||||
_pausedNode(fgGetNode("/sim/sound/pause", true))
|
_pausedNode(fgGetNode("/sim/sound/working", true))
|
||||||
{
|
{
|
||||||
#if defined(ENABLE_THREADS)
|
#if defined(ENABLE_THREADS)
|
||||||
if (!_enabled)
|
if (!_enabled)
|
||||||
|
@ -83,7 +83,7 @@ void FGVoiceMgr::update(double)
|
||||||
if (!_enabled)
|
if (!_enabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_paused = _pausedNode->getBoolValue();
|
_paused = !_pausedNode->getBoolValue();
|
||||||
for (unsigned int i = 0; i < _voices.size(); i++) {
|
for (unsigned int i = 0; i < _voices.size(); i++) {
|
||||||
_voices[i]->update();
|
_voices[i]->update();
|
||||||
#if !defined(ENABLE_THREADS)
|
#if !defined(ENABLE_THREADS)
|
||||||
|
|
Loading…
Add table
Reference in a new issue