Panda3D
|
00001 // Filename: nullAudioSound.h 00002 // Created by: skyler (June 6, 2001) 00003 // Prior system by: cary 00004 // 00005 //////////////////////////////////////////////////////////////////// 00006 // 00007 // PANDA 3D SOFTWARE 00008 // Copyright (c) Carnegie Mellon University. All rights reserved. 00009 // 00010 // All use of this software is subject to the terms of the revised BSD 00011 // license. You should have received a copy of this license along 00012 // with this source code in a file named "LICENSE." 00013 // 00014 //////////////////////////////////////////////////////////////////// 00015 00016 #ifndef __NULL_AUDIO_SOUND_H__ 00017 #define __NULL_AUDIO_SOUND_H__ 00018 00019 #include "audioSound.h" 00020 00021 00022 // This class intentionally does next to nothing. 00023 // It's used as a placeholder when you don't want a sound 00024 // system. 00025 class EXPCL_PANDA_AUDIO NullAudioSound : public AudioSound { 00026 // All of these methods are stubbed out to some degree. 00027 // If you're looking for a starting place for a new AudioManager, 00028 // please consider looking at the milesAudioManager. 00029 00030 public: 00031 ~NullAudioSound(); 00032 00033 void play(); 00034 void stop(); 00035 00036 void set_loop(bool); 00037 bool get_loop() const; 00038 00039 void set_loop_count(unsigned long); 00040 unsigned long get_loop_count() const; 00041 00042 void set_time(PN_stdfloat); 00043 PN_stdfloat get_time() const; 00044 00045 void set_volume(PN_stdfloat); 00046 PN_stdfloat get_volume() const; 00047 00048 void set_balance(PN_stdfloat); 00049 PN_stdfloat get_balance() const; 00050 00051 void set_play_rate(PN_stdfloat); 00052 PN_stdfloat get_play_rate() const; 00053 00054 void set_active(bool); 00055 bool get_active() const; 00056 00057 void set_finished_event(const string& event); 00058 const string& get_finished_event() const; 00059 00060 const string& get_name() const; 00061 00062 PN_stdfloat length() const; 00063 00064 void set_3d_attributes(PN_stdfloat px, PN_stdfloat py, PN_stdfloat pz, PN_stdfloat vx, PN_stdfloat vy, PN_stdfloat vz); 00065 void get_3d_attributes(PN_stdfloat *px, PN_stdfloat *py, PN_stdfloat *pz, PN_stdfloat *vx, PN_stdfloat *vy, PN_stdfloat *vz); 00066 void set_3d_min_distance(PN_stdfloat dist); 00067 PN_stdfloat get_3d_min_distance() const; 00068 void set_3d_max_distance(PN_stdfloat dist); 00069 PN_stdfloat get_3d_max_distance() const; 00070 00071 AudioSound::SoundStatus status() const; 00072 00073 // why protect the constructor?!? 00074 //protected: 00075 NullAudioSound(); 00076 00077 public: 00078 static TypeHandle get_class_type() { 00079 return _type_handle; 00080 } 00081 static void init_type() { 00082 AudioSound::init_type(); 00083 register_type(_type_handle, "NullAudioSound", 00084 AudioSound::get_class_type()); 00085 } 00086 virtual TypeHandle get_type() const { 00087 return get_class_type(); 00088 } 00089 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00090 00091 private: 00092 static TypeHandle _type_handle; 00093 00094 friend class NullAudioManager; 00095 }; 00096 00097 #endif /* __NULL_AUDIO_SOUND_H__ */