]> git.mxchange.org Git - flightgear.git/blobdiff - src/Sound/soundmgr.hxx
- adjusted for no-value constructor for FGPanel
[flightgear.git] / src / Sound / soundmgr.hxx
index 6b404599e0842fad2600ef67ac27d7e7470b5dae..1d7e51f2d0988ec2a0e12f9856eb97892432427b 100644 (file)
 #include <plib/sl.h>
 #include <plib/sm.h>
 
-FG_USING_STD(map);
-FG_USING_STD(string);
+#include <simgear/timing/timestamp.hxx>
+
+SG_USING_STD(map);
+SG_USING_STD(string);
 
 
 // manages everything we need to know for an individual sound sample
@@ -86,6 +88,9 @@ class FGSoundMgr {
     smMixer *audio_mixer;
     sound_map sounds;
 
+    SGTimeStamp last;
+    double safety;
+
 public:
 
     FGSoundMgr();
@@ -100,15 +105,31 @@ public:
     // is audio working?
     inline bool is_working() const { return !audio_sched->not_working(); }
 
-    // add a sound effect, return the index of the sound
+    // add a sound effect, return true if successful
     bool add( FGSimpleSound *sound, const string& refname );
 
+    // remove a sound effect, return true if successful
+    bool remove( 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 );
 
     // tell the scheduler to play the indexed sample once
     bool play_once( const string& refname );
+
+    // return true of the specified sound is currently being played
+    bool is_playing( const string& refname );
+
+    // immediate stop playing the sound
+    bool stop( const string& refname );
 };