void
FGFX::update ()
{
- FGSoundMgr * mgr = globals->get_soundmgr();
+ // FGSoundMgr * mgr = globals->get_soundmgr();
////////////////////////////////////////////////////////////////////
}
// destructor
+
FGSoundMgr::~FGSoundMgr() {
sound_map_iterator current = sounds.begin();
sound_map_iterator end = sounds.end();
// initialize the sound manager
-bool FGSoundMgr::init() {
+void FGSoundMgr::init() {
last.stamp();
safety = FG_MAX_SOUND_SAFETY;
}
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();
// 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;
- }
}
#include <simgear/timing/timestamp.hxx>
+#include <Main/fgfs.hxx>
+
SG_USING_STD(map);
SG_USING_STD(string);
typedef sound_map::const_iterator const_sound_map_iterator;
-class FGSoundMgr {
+class FGSoundMgr : public FGSubsystem
+{
slScheduler *audio_sched;
smMixer *audio_mixer;
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(); }