00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __FMOD_AUDIO_SOUND_H__
00021 #define __FMOD_AUDIO_SOUND_H__
00022
00023 #include <pandabase.h>
00024 #ifdef HAVE_FMOD //[
00025
00026 #include "audioSound.h"
00027 class FmodAudioManager;
00028 #include <fmod.h>
00029
00030
00031 class EXPCL_FMOD_AUDIO FmodAudioSound : public AudioSound {
00032 public:
00033 ~FmodAudioSound();
00034
00035
00036
00037
00038
00039 void play();
00040 void stop();
00041
00042
00043
00044 void set_loop(bool loop=true);
00045 bool get_loop() const;
00046
00047
00048
00049 void set_loop_count(unsigned long loop_count=1);
00050 unsigned long get_loop_count() const;
00051
00052
00053
00054 void set_time(float start_time=0.0);
00055 float get_time() const;
00056
00057
00058
00059 void set_volume(float volume=1.0);
00060 float get_volume() const;
00061
00062
00063
00064
00065
00066 void set_balance(float balance_right=0.0);
00067 float get_balance() const;
00068
00069
00070 void set_active(bool active=true);
00071 bool get_active() const;
00072
00073 const string& get_name() const;
00074
00075
00076 float length() const;
00077
00078 AudioSound::SoundStatus status() const;
00079
00080 protected:
00081
00082 private:
00083 PT(FmodAudioManager) _manager;
00084 FSOUND_STREAM *_audio;
00085 string _file_name;
00086 float _volume;
00087 float _balance;
00088 unsigned long _loop_count;
00089 mutable float _length;
00090 bool _active;
00091 bool _paused;
00092 int _channel;
00093
00094 FmodAudioSound(FmodAudioManager* manager, FSOUND_STREAM *audio_data,
00095 string file_name, float length=0.0f);
00096
00097
00098 FmodAudioSound(const FmodAudioSound& rhs) {}
00099 const FmodAudioSound& operator=(const FmodAudioSound& rhs) { return *this; }
00100
00101 friend class FmodAudioManager;
00102 };
00103
00104 #include "fmodAudioSound.I"
00105
00106 #endif //]
00107
00108 #endif