#include <plib/sl.h>
#include <plib/sm.h>
-FG_USING_STD(map);
-FG_USING_STD(string);
+#include <simgear/timing/timestamp.hxx>
+
+#include <Main/fgfs.hxx>
+
+SG_USING_STD(map);
+SG_USING_STD(string);
// manages everything we need to know for an individual sound sample
typedef sound_map::const_iterator const_sound_map_iterator;
-class FGSoundMgr {
+class FGSoundMgr : public FGSubsystem
+{
slScheduler *audio_sched;
smMixer *audio_mixer;
sound_map sounds;
+ SGTimeStamp last;
+ double safety;
+
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(int dt);
+
// is audio working?
- inline bool is_working() const { return !audio_sched->not_working(); }
+ inline bool is_working() const { return !audio_sched->notWorking(); }
// add a sound effect, return true if successful
bool add( FGSimpleSound *sound, const string& refname );
// return true of the specified sound exists in the sound manager system
bool exists( const string& refname );
+ // return a pointer to the FGSimpleSound if the specified sound
+ // exists in the sound manager system, otherwise return NULL
+ FGSimpleSound *find( const string& refname );
+
// tell the scheduler to play the indexed sample in a continuous
// loop
bool play_looped( const string& refname );