]> git.mxchange.org Git - flightgear.git/blobdiff - src/Sound/soundmgr.hxx
Updated --help message.
[flightgear.git] / src / Sound / soundmgr.hxx
index b475aaf0c438ccf246b1a30d4964a321ed592ccf..c8809d0020c0a85ff12b42941403123f1830cf13 100644 (file)
 #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
@@ -80,25 +84,48 @@ 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;
     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 );
@@ -109,6 +136,10 @@ public:
     // 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 );