فهرست منبع

NullAudioManager/Sound should have a TypeHandle

David Rose 19 سال پیش
والد
کامیت
bebd388711

+ 4 - 0
panda/src/audio/config_audio.cxx

@@ -20,6 +20,8 @@
 #include "dconfig.h"
 #include "audioManager.h"
 #include "audioSound.h"
+#include "nullAudioManager.h"
+#include "nullAudioSound.h"
 
 Configure(config_audio);
 NotifyCategoryDef(audio, "");
@@ -89,6 +91,8 @@ ConfigureFn(config_audio) {
   AudioManager::init_type();
   AudioSound::init_type();
   AudioDSP::init_type();
+  NullAudioManager::init_type();
+  NullAudioSound::init_type();
 }
 
 

+ 1 - 0
panda/src/audio/nullAudioManager.cxx

@@ -19,6 +19,7 @@
 
 #include "nullAudioManager.h"
 
+TypeHandle NullAudioManager::_type_handle;
 
 //namespace {
     //static const string blank="";

+ 17 - 0
panda/src/audio/nullAudioManager.h

@@ -76,6 +76,23 @@ public:
   virtual void audio_3d_set_drop_off_factor(float factor);
   virtual float audio_3d_get_drop_off_factor() const;
 
+
+public:
+  static TypeHandle get_class_type() {
+    return _type_handle;
+  }
+  static void init_type() {
+    AudioManager::init_type();
+    register_type(_type_handle, "NullAudioManager",
+                  AudioManager::get_class_type());
+  }
+  virtual TypeHandle get_type() const {
+    return get_class_type();
+  }
+  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
+
+private:
+  static TypeHandle _type_handle;
 };
 
 #endif /* __NULL_AUDIO_MANAGER_H__ */

+ 1 - 0
panda/src/audio/nullAudioSound.cxx

@@ -19,6 +19,7 @@
 
 #include "nullAudioSound.h"
 
+TypeHandle NullAudioSound::_type_handle;
 
 namespace {
   static const string blank="";

+ 17 - 0
panda/src/audio/nullAudioSound.h

@@ -78,6 +78,23 @@ public:
 //protected:
   NullAudioSound();
 
+public:
+  static TypeHandle get_class_type() {
+    return _type_handle;
+  }
+  static void init_type() {
+    AudioSound::init_type();
+    register_type(_type_handle, "NullAudioSound",
+                  AudioSound::get_class_type());
+  }
+  virtual TypeHandle get_type() const {
+    return get_class_type();
+  }
+  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
+
+private:
+  static TypeHandle _type_handle;
+
   friend class NullAudioManager;
 };