diff --git a/src/Sound/fg_fx.cxx b/src/Sound/fg_fx.cxx index a060b311d..675a6c057 100644 --- a/src/Sound/fg_fx.cxx +++ b/src/Sound/fg_fx.cxx @@ -140,7 +140,7 @@ FGFX::unbind () void FGFX::update () { - FGSoundMgr * mgr = globals->get_soundmgr(); + // FGSoundMgr * mgr = globals->get_soundmgr(); //////////////////////////////////////////////////////////////////// diff --git a/src/Sound/soundmgr.cxx b/src/Sound/soundmgr.cxx index 76f041bec..0103efd4c 100644 --- a/src/Sound/soundmgr.cxx +++ b/src/Sound/soundmgr.cxx @@ -75,6 +75,7 @@ FGSoundMgr::FGSoundMgr() { } // destructor + FGSoundMgr::~FGSoundMgr() { sound_map_iterator current = sounds.begin(); sound_map_iterator end = sounds.end(); @@ -90,7 +91,7 @@ FGSoundMgr::~FGSoundMgr() { // initialize the sound manager -bool FGSoundMgr::init() { +void FGSoundMgr::init() { last.stamp(); safety = FG_MAX_SOUND_SAFETY; @@ -106,16 +107,21 @@ bool FGSoundMgr::init() { } sounds.clear(); - if ( audio_sched->not_working() ) { - return false; - } else { - return true; - } +} + +void FGSoundMgr::bind () +{ + // no properties yet +} + +void FGSoundMgr::unbind () +{ + // no properties yet } // run the audio scheduler -bool FGSoundMgr::update() { +void FGSoundMgr::update() { SGTimeStamp current; current.stamp(); @@ -133,12 +139,8 @@ bool FGSoundMgr::update() { // cout << "safety = " << safety << endl; audio_sched -> setSafetyMargin ( FG_SOUND_SAFETY_MULT * safety ) ; - if ( !audio_sched->not_working() ) { + if ( !audio_sched->not_working() ) audio_sched -> update(); - return true; - } else { - return false; - } } diff --git a/src/Sound/soundmgr.hxx b/src/Sound/soundmgr.hxx index 1d7e51f2d..78b09f639 100644 --- a/src/Sound/soundmgr.hxx +++ b/src/Sound/soundmgr.hxx @@ -41,6 +41,8 @@ #include +#include
+ SG_USING_STD(map); SG_USING_STD(string); @@ -82,7 +84,8 @@ typedef sound_map::iterator sound_map_iterator; typedef sound_map::const_iterator const_sound_map_iterator; -class FGSoundMgr { +class FGSoundMgr : public FGSubsystem +{ slScheduler *audio_sched; smMixer *audio_mixer; @@ -96,11 +99,30 @@ public: FGSoundMgr(); ~FGSoundMgr(); - // initialize the sound manager - bool init(); - // run the audio scheduler - bool update(); + /** + * Initialize the sound manager. + */ + void init(); + + + /** + * Bind properties for the sound manager. + */ + void bind (); + + + /** + * Unbind properties for the sound manager. + */ + void unbind (); + + + /** + * Run the audio scheduler. + */ + void update(); + // is audio working? inline bool is_working() const { return !audio_sched->not_working(); }