00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef MILESAUDIOSOUND_H
00016 #define MILESAUDIOSOUND_H
00017
00018 #include "pandabase.h"
00019 #ifdef HAVE_RAD_MSS //[
00020
00021 #include "audioSound.h"
00022 #include "milesAudioManager.h"
00023 #include "mss.h"
00024
00025
00026
00027
00028
00029
00030 class EXPCL_MILES_AUDIO MilesAudioSound : public AudioSound {
00031 protected:
00032 MilesAudioSound(MilesAudioManager *manager, const string &file_name);
00033
00034 public:
00035 virtual void set_loop(bool loop=true);
00036 virtual bool get_loop() const;
00037
00038 virtual void set_loop_count(unsigned long loop_count=1);
00039 virtual unsigned long get_loop_count() const;
00040
00041 virtual PN_stdfloat get_volume() const;
00042 virtual PN_stdfloat get_balance() const;
00043 virtual PN_stdfloat get_play_rate() const;
00044
00045 virtual void set_time(PN_stdfloat start_time=0.0);
00046
00047 virtual void set_active(bool active=true);
00048 virtual bool get_active() const;
00049
00050 virtual void set_finished_event(const string &event);
00051 virtual const string &get_finished_event() const;
00052
00053 virtual const string &get_name() const;
00054
00055 virtual void cleanup();
00056
00057 protected:
00058 PT(MilesAudioManager) _manager;
00059 string _file_name;
00060
00061 PN_stdfloat _volume;
00062 PN_stdfloat _balance;
00063 PN_stdfloat _play_rate;
00064 unsigned long _loop_count;
00065
00066
00067
00068
00069
00070 bool _active;
00071
00072
00073
00074
00075 bool _paused;
00076
00077
00078
00079
00080 string _finished_event;
00081
00082
00083
00084 PN_stdfloat _start_time;
00085 bool _got_start_time;
00086
00087 public:
00088 static TypeHandle get_class_type() {
00089 return _type_handle;
00090 }
00091 static void init_type() {
00092 AudioSound::init_type();
00093 register_type(_type_handle, "MilesAudioSound",
00094 AudioSound::get_class_type());
00095 }
00096 virtual TypeHandle get_type() const {
00097 return get_class_type();
00098 }
00099 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00100
00101 private:
00102 static TypeHandle _type_handle;
00103
00104 friend class MilesAudioManager;
00105 };
00106
00107 #include "milesAudioSound.I"
00108
00109 #endif //]
00110
00111 #endif