15 #ifndef __AUDIO_MANAGER_H__ 16 #define __AUDIO_MANAGER_H__ 31 enum SpeakerModeCategory {
65 virtual int get_speaker_setup();
66 virtual void set_speaker_setup(SpeakerModeCategory cat);
78 virtual void shutdown();
86 virtual bool is_valid() = 0;
89 virtual PT(
AudioSound) get_sound(
const Filename &file_name,
bool positional =
false,
int mode=SM_heuristic) = 0;
90 virtual PT(
AudioSound) get_sound(
MovieAudio *source,
bool positional =
false,
int mode=SM_heuristic) = 0;
98 virtual void uncache_sound(
const Filename &file_name) = 0;
99 virtual void clear_cache() = 0;
100 virtual void set_cache_limit(
unsigned int count) = 0;
101 virtual unsigned int get_cache_limit()
const = 0;
106 virtual void set_volume(PN_stdfloat volume) = 0;
107 virtual PN_stdfloat get_volume()
const = 0;
116 virtual void set_active(
bool flag) = 0;
117 virtual bool get_active()
const = 0;
124 virtual void set_concurrent_sound_limit(
unsigned int limit = 0) = 0;
125 virtual unsigned int get_concurrent_sound_limit()
const = 0;
132 virtual void reduce_sounds_playing_to(
unsigned int count) = 0;
137 virtual void stop_all_sounds() = 0;
140 virtual void update();
147 virtual void audio_3d_set_listener_attributes(PN_stdfloat px, PN_stdfloat py, PN_stdfloat pz,
148 PN_stdfloat vx, PN_stdfloat vy, PN_stdfloat vz,
149 PN_stdfloat fx, PN_stdfloat fy, PN_stdfloat fz,
150 PN_stdfloat ux, PN_stdfloat uy, PN_stdfloat uz);
151 virtual void audio_3d_get_listener_attributes(PN_stdfloat *px, PN_stdfloat *py, PN_stdfloat *pz,
152 PN_stdfloat *vx, PN_stdfloat *vy, PN_stdfloat *vz,
153 PN_stdfloat *fx, PN_stdfloat *fy, PN_stdfloat *fz,
154 PN_stdfloat *ux, PN_stdfloat *uy, PN_stdfloat *uz);
161 virtual void audio_3d_set_distance_factor(PN_stdfloat factor);
162 virtual PN_stdfloat audio_3d_get_distance_factor()
const;
166 virtual void audio_3d_set_doppler_factor(PN_stdfloat factor);
167 virtual PN_stdfloat audio_3d_get_doppler_factor()
const;
172 virtual void audio_3d_set_drop_off_factor(PN_stdfloat factor);
173 virtual PN_stdfloat audio_3d_get_drop_off_factor()
const;
176 MAKE_PROPERTY(dls_pathname, get_dls_pathname);
178 virtual void output(std::ostream &out)
const;
179 virtual void write(std::ostream &out)
const;
182 virtual void set_speaker_configuration(LVecBase3 *speaker1, LVecBase3 *speaker2=
nullptr, LVecBase3 *speaker3=
nullptr, LVecBase3 *speaker4=
nullptr, LVecBase3 *speaker5=
nullptr, LVecBase3 *speaker6=
nullptr, LVecBase3 *speaker7=
nullptr, LVecBase3 *speaker8=
nullptr, LVecBase3 *speaker9=
nullptr);
185 static void register_AudioManager_creator(Create_AudioManager_proc* proc);
194 static Create_AudioManager_proc* _create_AudioManager;
195 AtomicAdjust::Pointer _null_sound;
203 static void init_type() {
204 TypedReferenceCount::init_type();
206 TypedReferenceCount::get_class_type());
209 return get_class_type();
211 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
217 inline std::ostream &
218 operator << (std::ostream &out,
const AudioManager &mgr) {
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
A base class for things which need to inherit from both TypedObject and from ReferenceCount.
Stores a configuration for a set of audio DSP filters.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
The name of a file, such as a texture file or an Egg file.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TypeHandle is the identifier used to differentiate C++ class types.
A MovieAudio is actually any source that provides a sequence of audio samples.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.