_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();
}
- 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 );
#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();
// 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());
void FGKR_87::init () {
- SGSoundMgr *smgr = globals->get_soundmgr();
+ SGSoundMgr *smgr = globals->get_subsystem<SGSoundMgr>();
_sgr = smgr->find("avionics", true);
_sgr->tie_to_listener();
}
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();
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;
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();
subsystem_mgr->add(name, subsystem, type, min_time_sec);
}
-SGSoundMgr *
-FGGlobals::get_soundmgr () const
-{
- return get_subsystem<SGSoundMgr>();
-}
-
SGEventMgr *
FGGlobals::get_event_mgr () const
{
class SGEventMgr;
class SGSubsystemMgr;
class SGSubsystem;
-class SGSoundMgr;
class FGControls;
class FGTACANList;
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; }
_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();
}
_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;
}
_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();
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();