Pull Sound-manager out of FGGlobals
This commit is contained in:
parent
ba56c42eb4
commit
52fd6986f8
12 changed files with 14 additions and 21 deletions
|
@ -113,7 +113,7 @@ ADF::init ()
|
|||
_power_btn_node->setBoolValue(true); // front end didn't implement a power button
|
||||
|
||||
// sound support (audible ident code)
|
||||
SGSoundMgr *smgr = globals->get_soundmgr();
|
||||
SGSoundMgr *smgr = globals->get_subsystem<SGSoundMgr>();
|
||||
_sgr = smgr->find("avionics", true);
|
||||
_sgr->tie_to_listener();
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ void AtisSpeaker::valueChanged(SGPropertyNode * node)
|
|||
}
|
||||
|
||||
|
||||
FGSoundManager * smgr = dynamic_cast<FGSoundManager*>(globals->get_soundmgr());
|
||||
FGSoundManager * smgr = globals->get_subsystem<FGSoundManager>();
|
||||
assert(smgr != NULL);
|
||||
|
||||
SG_LOG(SG_INSTR,SG_INFO,"AtisSpeaker voice is " << voice );
|
||||
|
@ -571,7 +571,7 @@ void CommRadioImpl::unbind()
|
|||
#if defined(ENABLE_FLITE)
|
||||
_atis.node()->removeChangeListener(&_atisSpeaker);
|
||||
if (_sampleGroup.valid()) {
|
||||
globals->get_soundmgr()->remove(getSampleGroupRefname());
|
||||
globals->get_subsystem<SGSoundMgr>()->remove(getSampleGroupRefname());
|
||||
}
|
||||
#endif
|
||||
_metarBridge->unbind();
|
||||
|
@ -617,7 +617,9 @@ void CommRadioImpl::update(double dt)
|
|||
// the speaker has created a new atis sample
|
||||
if (!_sampleGroup.valid()) {
|
||||
// create a sample group for our instrument on the fly
|
||||
_sampleGroup = globals->get_soundmgr()->find(getSampleGroupRefname(), true);
|
||||
SGSoundMgr * smgr = globals->get_subsystem<SGSoundMgr>();
|
||||
|
||||
_sampleGroup = smgr->find(getSampleGroupRefname(), true);
|
||||
_sampleGroup->tie_to_listener();
|
||||
if (_addNoise) {
|
||||
SGSharedPtr<SGSoundSample> noise = new SGSoundSample("Sounds/radionoise.wav", globals->get_fg_root());
|
||||
|
|
|
@ -114,7 +114,7 @@ FGKR_87::~FGKR_87() {
|
|||
|
||||
|
||||
void FGKR_87::init () {
|
||||
SGSoundMgr *smgr = globals->get_soundmgr();
|
||||
SGSoundMgr *smgr = globals->get_subsystem<SGSoundMgr>();
|
||||
_sgr = smgr->find("avionics", true);
|
||||
_sgr->tie_to_listener();
|
||||
}
|
||||
|
|
|
@ -101,7 +101,7 @@ FGMarkerBeacon::init ()
|
|||
if (serviceable->getType() == simgear::props::NONE)
|
||||
serviceable->setBoolValue( true );
|
||||
|
||||
SGSoundMgr *smgr = globals->get_soundmgr();
|
||||
SGSoundMgr *smgr = globals->get_subsystem<SGSoundMgr>();
|
||||
_sgr = smgr->find("avionics", true);
|
||||
_sgr->tie_to_listener();
|
||||
|
||||
|
|
|
@ -1070,7 +1070,7 @@ do_add_model (const SGPropertyNode * arg)
|
|||
static bool
|
||||
do_play_audio_sample (const SGPropertyNode * arg)
|
||||
{
|
||||
SGSoundMgr *smgr = globals->get_soundmgr();
|
||||
SGSoundMgr *smgr = globals->get_subsystem<SGSoundMgr>();
|
||||
if (!smgr) {
|
||||
SG_LOG(SG_GENERAL, SG_WARN, "play-audio-sample: sound-manager not running");
|
||||
return false;
|
||||
|
|
|
@ -231,7 +231,7 @@ setFreeze (bool f)
|
|||
frozen = f;
|
||||
|
||||
// Stop sound on a pause
|
||||
SGSoundMgr *smgr = globals->get_soundmgr();
|
||||
SGSoundMgr *smgr = globals->get_subsystem<SGSoundMgr>();
|
||||
if ( smgr != NULL ) {
|
||||
if ( f ) {
|
||||
smgr->suspend();
|
||||
|
|
|
@ -508,12 +508,6 @@ FGGlobals::add_subsystem (const char * name,
|
|||
subsystem_mgr->add(name, subsystem, type, min_time_sec);
|
||||
}
|
||||
|
||||
SGSoundMgr *
|
||||
FGGlobals::get_soundmgr () const
|
||||
{
|
||||
return get_subsystem<SGSoundMgr>();
|
||||
}
|
||||
|
||||
SGEventMgr *
|
||||
FGGlobals::get_event_mgr () const
|
||||
{
|
||||
|
|
|
@ -53,7 +53,6 @@ class SGTime;
|
|||
class SGEventMgr;
|
||||
class SGSubsystemMgr;
|
||||
class SGSubsystem;
|
||||
class SGSoundMgr;
|
||||
|
||||
class FGControls;
|
||||
class FGTACANList;
|
||||
|
@ -190,8 +189,6 @@ public:
|
|||
|
||||
SGEventMgr *get_event_mgr () const;
|
||||
|
||||
SGSoundMgr *get_soundmgr () const;
|
||||
|
||||
inline double get_sim_time_sec () const { return sim_time_sec; }
|
||||
inline void inc_sim_time_sec (double dt) { sim_time_sec += dt; }
|
||||
inline void set_sim_time_sec (double t) { sim_time_sec = t; }
|
||||
|
|
|
@ -40,7 +40,7 @@ void AudioIdent::init()
|
|||
_timer = 0.0;
|
||||
_ident = "";
|
||||
_running = false;
|
||||
_sgr = globals->get_soundmgr()->find("avionics", true);
|
||||
_sgr = globals->get_subsystem<SGSoundMgr>()->find("avionics", true);
|
||||
_sgr->tie_to_listener();
|
||||
}
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ FGFX::FGFX ( const std::string &refname, SGPropertyNode *props ) :
|
|||
_avionics_ext = _props->getNode("sim/sound/avionics/external-view", true);
|
||||
_internal = _props->getNode("sim/current-view/internal", true);
|
||||
|
||||
_smgr = globals->get_soundmgr();
|
||||
_smgr = globals->get_subsystem<SGSoundMgr>();
|
||||
if (!_smgr) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ FGFLITEVoice::FGFLITEVoice(FGVoiceMgr * mgr, const SGPropertyNode_ptr node, cons
|
|||
|
||||
_synthesizer = new FLITEVoiceSynthesizer(voice.c_str());
|
||||
|
||||
SGSoundMgr *smgr = globals->get_soundmgr();
|
||||
SGSoundMgr *smgr = globals->get_subsystem<SGSoundMgr>();
|
||||
_sgr = smgr->find(sampleGroupRefName, true);
|
||||
_sgr->tie_to_listener();
|
||||
|
||||
|
|
|
@ -208,7 +208,7 @@ FGVoicePlayer::bind (SGPropertyNode *node, const char* default_dir_prefix)
|
|||
void
|
||||
FGVoicePlayer::init ()
|
||||
{
|
||||
SGSoundMgr *smgr = globals->get_soundmgr();
|
||||
SGSoundMgr *smgr = globals->get_subsystem<SGSoundMgr>();
|
||||
_sgr = smgr->find("avionics", true);
|
||||
_sgr->tie_to_listener();
|
||||
speaker.update_configuration();
|
||||
|
|
Loading…
Add table
Reference in a new issue