]> git.mxchange.org Git - flightgear.git/commitdiff
Sound manager changes from David Megginson.
authorcurt <curt>
Mon, 29 Oct 2001 04:40:43 +0000 (04:40 +0000)
committercurt <curt>
Mon, 29 Oct 2001 04:40:43 +0000 (04:40 +0000)
src/Sound/fg_fx.cxx
src/Sound/soundmgr.cxx
src/Sound/soundmgr.hxx

index a060b311df804da537f71d0c7399bb854ac75ebc..675a6c0571617dd53f6cb2903e1075143274326f 100644 (file)
@@ -140,7 +140,7 @@ FGFX::unbind ()
 void
 FGFX::update ()
 {
-  FGSoundMgr * mgr = globals->get_soundmgr();
+  // FGSoundMgr * mgr = globals->get_soundmgr();
 
 
   ////////////////////////////////////////////////////////////////////
index 76f041bec9209d0336742e020476b22f93b726a2..0103efd4ca7b13a62d2efb7b588e5fa886c92e10 100644 (file)
@@ -75,6 +75,7 @@ FGSoundMgr::FGSoundMgr() {
 }
 
 // destructor
+
 FGSoundMgr::~FGSoundMgr() {
     sound_map_iterator current = sounds.begin();
     sound_map_iterator end = sounds.end();
@@ -90,7 +91,7 @@ FGSoundMgr::~FGSoundMgr() {
 
 
 // initialize the sound manager
-bool FGSoundMgr::init() {
+void FGSoundMgr::init() {
     last.stamp();
     safety = FG_MAX_SOUND_SAFETY;
 
@@ -106,16 +107,21 @@ bool FGSoundMgr::init() {
     }
     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();
 
@@ -133,12 +139,8 @@ bool FGSoundMgr::update() {
     // 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;
-    }
 }
 
 
index 1d7e51f2d0988ec2a0e12f9856eb97892432427b..78b09f639d1135e8329fe004cafbfa322422103f 100644 (file)
@@ -41,6 +41,8 @@
 
 #include <simgear/timing/timestamp.hxx>
 
+#include <Main/fgfs.hxx>
+
 SG_USING_STD(map);
 SG_USING_STD(string);
 
@@ -82,7 +84,8 @@ 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;
@@ -96,11 +99,30 @@ 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();
+
 
     // is audio working?
     inline bool is_working() const { return !audio_sched->not_working(); }