65 #ifndef __FMOD_AUDIO_MANAGER_H__ 66 #define __FMOD_AUDIO_MANAGER_H__ 76 #include <fmod_errors.h> 80 extern void fmod_audio_errcheck(
const char *context, FMOD_RESULT n);
89 virtual bool is_valid();
91 virtual PT(
AudioSound) get_sound(
const Filename &,
bool positional =
false,
int mode=SM_heuristic);
94 virtual int get_speaker_setup();
95 virtual void set_speaker_setup(SpeakerModeCategory cat);
100 virtual void set_wavwriter(
bool);
105 virtual void stop_all_sounds();
115 virtual void audio_3d_set_listener_attributes(PN_stdfloat px, PN_stdfloat py, PN_stdfloat pz,
116 PN_stdfloat vx, PN_stdfloat xy, PN_stdfloat xz,
117 PN_stdfloat fx, PN_stdfloat fy, PN_stdfloat fz,
118 PN_stdfloat ux, PN_stdfloat uy, PN_stdfloat uz);
121 virtual void audio_3d_get_listener_attributes(PN_stdfloat *px, PN_stdfloat *py, PN_stdfloat *pz,
122 PN_stdfloat *vx, PN_stdfloat *vy, PN_stdfloat *vz,
123 PN_stdfloat *fx, PN_stdfloat *fy, PN_stdfloat *fz,
124 PN_stdfloat *ux, PN_stdfloat *uy, PN_stdfloat *uz);
131 virtual void audio_3d_set_distance_factor(PN_stdfloat factor);
132 virtual PN_stdfloat audio_3d_get_distance_factor()
const;
136 virtual void audio_3d_set_doppler_factor(PN_stdfloat factor);
137 virtual PN_stdfloat audio_3d_get_doppler_factor()
const;
141 virtual void audio_3d_set_drop_off_factor(PN_stdfloat factor);
142 virtual PN_stdfloat audio_3d_get_drop_off_factor()
const;
146 virtual void set_concurrent_sound_limit(
unsigned int limit = 0);
147 virtual unsigned int get_concurrent_sound_limit()
const;
148 virtual void reduce_sounds_playing_to(
unsigned int count);
149 virtual void uncache_sound(
const Filename &);
150 virtual void clear_cache();
151 virtual void set_cache_limit(
unsigned int count);
152 virtual unsigned int get_cache_limit()
const;
163 static FMOD::System *_system;
166 static bool _system_is_valid;
168 static PN_stdfloat _distance_factor;
169 static PN_stdfloat _doppler_factor;
170 static PN_stdfloat _drop_off_factor;
172 FMOD::ChannelGroup *_channelgroup;
174 FMOD_VECTOR _position;
175 FMOD_VECTOR _velocity;
176 FMOD_VECTOR _forward;
180 std::string _dlsname;
181 FMOD_CREATESOUNDEXINFO _midi_info;
190 FMOD_OUTPUTTYPE _saved_outputtype;
196 static void init_type() {
197 AudioManager::init_type();
198 register_type(_type_handle,
"FmodAudioManager", AudioManager::get_class_type());
201 return get_class_type();
205 return get_class_type();
virtual bool configure_filters(FilterProperties *config)
Configures the global DSP filter chain.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void set_volume(PN_stdfloat volume=1.0)
0.0 to 1.0 scale of volume converted to Fmod's internal 0.0 to 255.0 scale.
Stores a configuration for a set of audio DSP filters.
bool get_active() const
Returns whether the sound has been marked "active".
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void update()
Must be called every frame.
EXPCL_FMOD_AUDIO AudioManager * Create_FmodAudioManager()
Factory Function.
The name of a file, such as a texture file or an Egg file.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void set_active(bool active=true)
Sets whether the sound is marked "active".
TypeHandle is the identifier used to differentiate C++ class types.
A MovieAudio is actually any source that provides a sequence of audio samples.
PN_stdfloat get_volume() const
Gets the current volume of a sound.