activate atc settings in the sound mixer dialog
This commit is contained in:
parent
641f000860
commit
61ffbf4615
2 changed files with 26 additions and 3 deletions
|
@ -59,6 +59,11 @@ FGATC::FGATC() :
|
||||||
{
|
{
|
||||||
SGSoundMgr *smgr = globals->get_soundmgr();
|
SGSoundMgr *smgr = globals->get_soundmgr();
|
||||||
_sgr = smgr->find("atc", true);
|
_sgr = smgr->find("atc", true);
|
||||||
|
|
||||||
|
_volume = fgGetNode("/sim/sound/atc/volume", true);
|
||||||
|
_enabled = fgGetNode("/sim/sound/atc/enabled", true);
|
||||||
|
_atc_external = fgGetNode("/sim/sound/atc/external-view", true);
|
||||||
|
_internal = fgGetNode("/sim/current-view/internal", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
FGATC::~FGATC() {
|
FGATC::~FGATC() {
|
||||||
|
@ -107,6 +112,18 @@ void FGATC::Update(double dt) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ENABLE_AUDIO_SUPPORT
|
||||||
|
bool active = _atc_external->getBoolValue() ||
|
||||||
|
_internal->getBoolValue();
|
||||||
|
|
||||||
|
if ( active && _enabled->getBoolValue() ) {
|
||||||
|
_sgr->set_volume( _volume->getFloatValue() );
|
||||||
|
_sgr->resume(); // no-op if already in resumed state
|
||||||
|
} else {
|
||||||
|
_sgr->suspend();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if(_transmit) {
|
if(_transmit) {
|
||||||
_counter = 0.0;
|
_counter = 0.0;
|
||||||
_max_count = 5.0; // FIXME - hardwired length of message - need to calculate it!
|
_max_count = 5.0; // FIXME - hardwired length of message - need to calculate it!
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
#include <simgear/constants.h>
|
#include <simgear/constants.h>
|
||||||
#include <simgear/compiler.h>
|
#include <simgear/compiler.h>
|
||||||
|
#include <simgear/props/props.hxx>
|
||||||
#include <simgear/misc/sgstream.hxx>
|
#include <simgear/misc/sgstream.hxx>
|
||||||
#include <simgear/math/sg_geodesy.hxx>
|
#include <simgear/math/sg_geodesy.hxx>
|
||||||
#include <simgear/debug/logstream.hxx>
|
#include <simgear/debug/logstream.hxx>
|
||||||
|
@ -247,6 +248,11 @@ private:
|
||||||
bool _transmitting; // we are transmitting
|
bool _transmitting; // we are transmitting
|
||||||
double _counter;
|
double _counter;
|
||||||
double _max_count;
|
double _max_count;
|
||||||
|
|
||||||
|
SGPropertyNode_ptr _volume;
|
||||||
|
SGPropertyNode_ptr _enabled;
|
||||||
|
SGPropertyNode_ptr _atc_external;
|
||||||
|
SGPropertyNode_ptr _internal;
|
||||||
};
|
};
|
||||||
|
|
||||||
std::istream& operator>> ( std::istream& fin, ATCData& a );
|
std::istream& operator>> ( std::istream& fin, ATCData& a );
|
||||||
|
|
Loading…
Add table
Reference in a new issue