Revive master sound enable switch.
This commit is contained in:
parent
109d04b605
commit
575f576aa9
2 changed files with 41 additions and 28 deletions
src/Sound
|
@ -47,6 +47,7 @@ void Listener::valueChanged(SGPropertyNode * node)
|
|||
|
||||
FGSoundManager::FGSoundManager()
|
||||
: _is_initialized(false),
|
||||
_enabled(false),
|
||||
_listener(new Listener(this))
|
||||
{
|
||||
SGPropertyNode_ptr scenery_loaded = fgGetNode("sim/sceneryloaded", true);
|
||||
|
@ -136,7 +137,18 @@ bool FGSoundManager::stationary() const
|
|||
// Actual sound update is triggered by the subsystem manager.
|
||||
void FGSoundManager::update(double dt)
|
||||
{
|
||||
if (_is_initialized && _sound_working->getBoolValue() && _sound_enabled->getBoolValue())
|
||||
if (_is_initialized && _sound_working->getBoolValue())
|
||||
{
|
||||
bool enabled = _sound_enabled->getBoolValue();
|
||||
if (enabled != _enabled)
|
||||
{
|
||||
if (enabled)
|
||||
resume();
|
||||
else
|
||||
suspend();
|
||||
_enabled = enabled;
|
||||
}
|
||||
if (enabled)
|
||||
{
|
||||
SGGeod viewPosGeod(SGGeod::fromDegFt(_viewPosLon->getDoubleValue(),
|
||||
_viewPosLat->getDoubleValue(),
|
||||
|
@ -165,5 +177,6 @@ void FGSoundManager::update(double dt)
|
|||
SGSoundMgr::update(dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // ENABLE_AUDIO_SUPPORT
|
||||
|
|
|
@ -48,7 +48,7 @@ public:
|
|||
private:
|
||||
bool stationary() const;
|
||||
|
||||
bool _is_initialized;
|
||||
bool _is_initialized, _enabled;
|
||||
SGPropertyNode_ptr _sound_working, _sound_enabled, _volume, _device_name;
|
||||
SGPropertyNode_ptr _currentView;
|
||||
SGPropertyNode_ptr _viewPosLon, _viewPosLat, _viewPosElev;
|
||||
|
|
Loading…
Add table
Reference in a new issue