1
0
Fork 0

Merge /u/ltoenning/flightgear_sim/ branch fix/2146 into next

https://sourceforge.net/p/flightgear/flightgear/merge-requests/190/
This commit is contained in:
James Turner 2020-03-13 13:53:30 +00:00
commit 8edcaa4853
3 changed files with 5 additions and 12 deletions

View file

@ -230,16 +230,6 @@ setFreeze (bool f)
{
frozen = f;
// Stop sound on a pause
SGSoundMgr *smgr = globals->get_subsystem<SGSoundMgr>();
if ( smgr != NULL ) {
if ( f ) {
smgr->suspend();
} else if (fgGetBool("/sim/sound/working")) {
smgr->resume();
}
}
// Pause the particle system
simgear::Particles::setFrozen(f);
}

View file

@ -76,6 +76,8 @@ void FGSoundManager::init()
_velocityEastFPS = fgGetNode("velocities/speed-east-fps", true);
_velocityDownFPS = fgGetNode("velocities/speed-down-fps", true);
_frozen = fgGetNode("sim/freeze/master");
SGPropertyNode_ptr scenery_loaded = fgGetNode("sim/sceneryloaded", true);
scenery_loaded->addChangeListener(_listener.get());
@ -159,9 +161,9 @@ bool FGSoundManager::stationaryView() const
// Actual sound update is triggered by the subsystem manager.
void FGSoundManager::update(double dt)
{
if (is_active() && _is_initialized && _sound_working->getBoolValue())
if (is_working() && _is_initialized && _sound_working->getBoolValue())
{
bool enabled = _sound_enabled->getBoolValue();
bool enabled = _sound_enabled->getBoolValue() && !_frozen->getBoolValue();
if (enabled != _enabled)
{
if (enabled)

View file

@ -63,6 +63,7 @@ private:
bool _is_initialized, _enabled;
SGPropertyNode_ptr _sound_working, _sound_enabled, _volume, _device_name;
SGPropertyNode_ptr _velocityNorthFPS, _velocityEastFPS, _velocityDownFPS;
SGPropertyNode_ptr _frozen;
std::unique_ptr<Listener> _listener;
std::map<std::string,VoiceSynthesizer*> _synthesizers;