parent
3cb05a9207
commit
2c9d64dcc6
3 changed files with 5 additions and 12 deletions
|
@ -230,16 +230,6 @@ setFreeze (bool f)
|
||||||
{
|
{
|
||||||
frozen = 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
|
// Pause the particle system
|
||||||
simgear::Particles::setFrozen(f);
|
simgear::Particles::setFrozen(f);
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,6 +76,8 @@ void FGSoundManager::init()
|
||||||
_velocityEastFPS = fgGetNode("velocities/speed-east-fps", true);
|
_velocityEastFPS = fgGetNode("velocities/speed-east-fps", true);
|
||||||
_velocityDownFPS = fgGetNode("velocities/speed-down-fps", true);
|
_velocityDownFPS = fgGetNode("velocities/speed-down-fps", true);
|
||||||
|
|
||||||
|
_frozen = fgGetNode("sim/freeze/master");
|
||||||
|
|
||||||
SGPropertyNode_ptr scenery_loaded = fgGetNode("sim/sceneryloaded", true);
|
SGPropertyNode_ptr scenery_loaded = fgGetNode("sim/sceneryloaded", true);
|
||||||
scenery_loaded->addChangeListener(_listener.get());
|
scenery_loaded->addChangeListener(_listener.get());
|
||||||
|
|
||||||
|
@ -159,9 +161,9 @@ bool FGSoundManager::stationaryView() const
|
||||||
// Actual sound update is triggered by the subsystem manager.
|
// Actual sound update is triggered by the subsystem manager.
|
||||||
void FGSoundManager::update(double dt)
|
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 != _enabled)
|
||||||
{
|
{
|
||||||
if (enabled)
|
if (enabled)
|
||||||
|
|
|
@ -63,6 +63,7 @@ private:
|
||||||
bool _is_initialized, _enabled;
|
bool _is_initialized, _enabled;
|
||||||
SGPropertyNode_ptr _sound_working, _sound_enabled, _volume, _device_name;
|
SGPropertyNode_ptr _sound_working, _sound_enabled, _volume, _device_name;
|
||||||
SGPropertyNode_ptr _velocityNorthFPS, _velocityEastFPS, _velocityDownFPS;
|
SGPropertyNode_ptr _velocityNorthFPS, _velocityEastFPS, _velocityDownFPS;
|
||||||
|
SGPropertyNode_ptr _frozen;
|
||||||
std::unique_ptr<Listener> _listener;
|
std::unique_ptr<Listener> _listener;
|
||||||
|
|
||||||
std::map<std::string,VoiceSynthesizer*> _synthesizers;
|
std::map<std::string,VoiceSynthesizer*> _synthesizers;
|
||||||
|
|
Loading…
Reference in a new issue