]> git.mxchange.org Git - flightgear.git/blobdiff - src/Sound/soundmgr.hxx
Added static port system and a new altimeter model connected to it.
[flightgear.git] / src / Sound / soundmgr.hxx
index d47e9730a1f292d2a2c25de9a5e3ee5c857e76dc..3e89b225bbc63a3ad70b5359580caa6602436946 100644 (file)
@@ -57,7 +57,6 @@ private:
     slEnvelope *volume_envelope;
     double pitch;
     double volume;
-    int clients;
 
 public:
 
@@ -65,18 +64,13 @@ public:
     FGSimpleSound( unsigned char *buffer, int len );
     ~FGSimpleSound();
 
-    void play_once( slScheduler *sched );
-    void play_looped( slScheduler *sched );
+    void play( slScheduler *sched, bool looped );
+    void stop( slScheduler *sched, bool quick = true );
 
-    inline void play( slScheduler *sched, bool looped ) {
-       if (looped) play_looped( sched );
-       else play_once( sched );
-    }
-    inline void stop( slScheduler *sched ) {
-        sched->stopSample( sample );
-    }
+    inline void play_once( slScheduler *sched ) { play( sched, false); }
+    inline void play_looped( slScheduler *sched ) { play( sched, true); }
     inline bool is_playing( ) {
-       return (sample->getPlayCount() > 0 );
+        return ( sample->getPlayCount() > 0 );
     }
 
     inline double get_pitch() const { return pitch; }
@@ -120,7 +114,6 @@ class FGSoundMgr : public FGSubsystem
     sound_map sounds;
     sample_map samples;
 
-    SGTimeStamp last;
     double safety;
 
 public:
@@ -150,7 +143,19 @@ public:
     /**
      * Run the audio scheduler.
      */
-    void update(int dt);
+    void update(double dt);
+
+
+    /**
+     * Pause all sounds.
+     */
+    void pause ();
+
+
+    /**
+     * Resume all sounds.
+     */
+    void resume ();
 
 
     // is audio working?