Panda3D
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | Static Protected Attributes | Friends

AudioManager Class Reference

Inheritance diagram for AudioManager:
TypedReferenceCount TypedObject ReferenceCount MemoryBase MemoryBase NullAudioManager

List of all members.

Public Types

enum  SpeakerId {
  SPK_none, SPK_frontleft, SPK_frontright, SPK_center,
  SPK_sub, SPK_backleft, SPK_backright, SPK_sideleft,
  SPK_sideright, SPK_COUNT
}
enum  SpeakerModeCategory {
  SPEAKERMODE_raw, SPEAKERMODE_mono, SPEAKERMODE_stereo, SPEAKERMODE_quad,
  SPEAKERMODE_surround, SPEAKERMODE_5point1, SPEAKERMODE_7point1, SPEAKERMODE_prologic,
  SPEAKERMODE_max, SPEAKERMODE_COUNT
}
enum  StreamMode { SM_heuristic, SM_sample, SM_stream }

Public Member Functions

virtual PN_stdfloat audio_3d_get_distance_factor () const
virtual PN_stdfloat audio_3d_get_doppler_factor () const
virtual PN_stdfloat audio_3d_get_drop_off_factor () const
virtual void audio_3d_get_listener_attributes (PN_stdfloat *px, PN_stdfloat *py, PN_stdfloat *pz, PN_stdfloat *vx, PN_stdfloat *vy, PN_stdfloat *vz, PN_stdfloat *fx, PN_stdfloat *fy, PN_stdfloat *fz, PN_stdfloat *ux, PN_stdfloat *uy, PN_stdfloat *uz)
virtual void audio_3d_set_distance_factor (PN_stdfloat factor)
virtual void audio_3d_set_doppler_factor (PN_stdfloat factor)
virtual void audio_3d_set_drop_off_factor (PN_stdfloat factor)
virtual void audio_3d_set_listener_attributes (PN_stdfloat px, PN_stdfloat py, PN_stdfloat pz, PN_stdfloat vx, PN_stdfloat vy, PN_stdfloat vz, PN_stdfloat fx, PN_stdfloat fy, PN_stdfloat fz, PN_stdfloat ux, PN_stdfloat uy, PN_stdfloat uz)
virtual void clear_cache ()=0
virtual bool configure_filters (FilterProperties *config)
 Configures the global DSP filter chain.
virtual TypeHandle force_init_type ()
virtual bool get_active () const =0
virtual unsigned int get_cache_limit () const =0
virtual unsigned int get_concurrent_sound_limit () const =0
virtual TypeHandle get_type () const
virtual PN_stdfloat get_volume () const =0
virtual int getSpeakerSetup ()
virtual bool is_valid ()=0
virtual void output (ostream &out) const
 PT (AudioSound) get_null_sound()
virtual PT (AudioSound) get_sound(MovieAudio *source
virtual PT (AudioSound) get_sound(const string &file_name
virtual void reduce_sounds_playing_to (unsigned int count)=0
virtual void set_active (bool flag)=0
virtual void set_cache_limit (unsigned int count)=0
virtual void set_concurrent_sound_limit (unsigned int limit=0)=0
virtual void set_speaker_configuration (LVecBase3 *speaker1, LVecBase3 *speaker2=NULL, LVecBase3 *speaker3=NULL, LVecBase3 *speaker4=NULL, LVecBase3 *speaker5=NULL, LVecBase3 *speaker6=NULL, LVecBase3 *speaker7=NULL, LVecBase3 *speaker8=NULL, LVecBase3 *speaker9=NULL)
 For use only with Miles.
virtual void set_volume (PN_stdfloat volume)=0
virtual void setSpeakerSetup (SpeakerModeCategory cat)
virtual void shutdown ()
 Call this at exit time to shut down the audio system.
virtual void stop_all_sounds ()=0
virtual void uncache_sound (const string &file_name)=0
virtual void update ()
 Must be called every frame.
virtual void write (ostream &out) const

Static Public Member Functions

static TypeHandle get_class_type ()
static Filename get_dls_pathname ()
 Returns the full pathname to the DLS file, as specified by the Config.prc file, or the default for the current OS if appropriate.
static void init_type ()
 This function is declared non-inline to work around a compiler bug in g++ 2.96.
static PT (AudioManager) create_AudioManager()
static void register_AudioManager_creator (Create_AudioManager_proc *proc)

Public Attributes

virtual bool int mode = SM_heuristic) = 0
virtual bool positional = false

Protected Attributes

AtomicAdjust::Pointer _null_sound

Static Protected Attributes

static Create_AudioManager_proc * _create_AudioManager = create_NullAudioManager

Friends

class AudioSound

Detailed Description

Definition at line 29 of file audioManager.h.


Member Function Documentation

bool AudioManager::configure_filters ( FilterProperties config) [virtual]

Configures the global DSP filter chain.

There is no guarantee that any given configuration will be supported by the implementation. The only way to find out what's supported is to call configure_filters. If it returns true, the configuration is supported.

Definition at line 194 of file audioManager.cxx.

References FilterProperties::get_config().

Filename AudioManager::get_dls_pathname ( ) [static]

Returns the full pathname to the DLS file, as specified by the Config.prc file, or the default for the current OS if appropriate.

Returns empty string if the DLS file is unavailable.

Definition at line 299 of file audioManager.cxx.

References Filename::from_os_specific(), VirtualFileSystem::get_global_ptr(), and VirtualFileSystem::resolve_filename().

static void AudioManager::init_type ( ) [inline, static]

This function is declared non-inline to work around a compiler bug in g++ 2.96.

Making it inline seems to cause problems in the optimizer.

Reimplemented from TypedReferenceCount.

Reimplemented in NullAudioManager.

Definition at line 217 of file audioManager.h.

References AudioSound::init_type().

Referenced by NullAudioManager::init_type(), and AudioSound::init_type().

void AudioManager::set_speaker_configuration ( LVecBase3 speaker1,
LVecBase3 speaker2 = NULL,
LVecBase3 speaker3 = NULL,
LVecBase3 speaker4 = NULL,
LVecBase3 speaker5 = NULL,
LVecBase3 speaker6 = NULL,
LVecBase3 speaker7 = NULL,
LVecBase3 speaker8 = NULL,
LVecBase3 speaker9 = NULL 
) [virtual]

For use only with Miles.

Definition at line 359 of file audioManager.cxx.

void AudioManager::shutdown ( ) [virtual]

Call this at exit time to shut down the audio system.

This will invalidate all currently-active AudioManagers and AudioSounds in the system. If you change your mind and want to play sounds again, you will have to recreate all of these objects.

Definition at line 133 of file audioManager.cxx.

void AudioManager::update ( ) [virtual]

Must be called every frame.

Failure to call this every frame could cause problems for some audio managers.

Definition at line 211 of file audioManager.cxx.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations