Panda3D
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
AudioSound Class Referenceabstract
Inheritance diagram for AudioSound:
TypedReferenceCount TypedObject ReferenceCount MemoryBase MemoryBase FmodAudioSound NullAudioSound OpenALAudioSound

Public Types

enum  SoundStatus { BAD , READY , PLAYING }
 

Public Member Functions

virtual bool configure_filters (FilterProperties *config)
 Configure the local DSP filter chain.
 
virtual TypeHandle force_init_type ()
 
virtual void get_3d_attributes (PN_stdfloat *px, PN_stdfloat *py, PN_stdfloat *pz, PN_stdfloat *vx, PN_stdfloat *vy, PN_stdfloat *vz)
 
virtual PN_stdfloat get_3d_max_distance () const
 
virtual PN_stdfloat get_3d_min_distance () const
 
virtual bool get_active () const =0
 
virtual PN_stdfloat get_balance () const =0
 
virtual const std::string & get_finished_event () const =0
 
virtual bool get_loop () const =0
 
virtual unsigned long get_loop_count () const =0
 
virtual const std::string & get_name () const =0
 
virtual PN_stdfloat get_play_rate () const =0
 
virtual int get_priority ()
 
virtual PN_stdfloat get_speaker_level (int index)
 For use only with Miles.
 
virtual PN_stdfloat get_speaker_mix (int speaker)
 For use only with FMOD.
 
virtual PN_stdfloat get_time () const =0
 
virtual TypeHandle get_type () const
 
virtual PN_stdfloat get_volume () const =0
 
virtual PN_stdfloat length () const =0
 
virtual void output (std::ostream &out) const
 
virtual void play ()=0
 
virtual void set_3d_attributes (PN_stdfloat px, PN_stdfloat py, PN_stdfloat pz, PN_stdfloat vx, PN_stdfloat vy, PN_stdfloat vz)
 
virtual void set_3d_max_distance (PN_stdfloat dist)
 
virtual void set_3d_min_distance (PN_stdfloat dist)
 
virtual void set_active (bool flag=true)=0
 
virtual void set_balance (PN_stdfloat balance_right=0.0)=0
 
virtual void set_finished_event (const std::string &event)=0
 
virtual void set_loop (bool loop=true)=0
 
virtual void set_loop_count (unsigned long loop_count=1)=0
 
virtual void set_play_rate (PN_stdfloat play_rate=1.0f)=0
 
virtual void set_priority (int priority)
 
virtual void set_speaker_levels (PN_stdfloat level1, PN_stdfloat level2=-1.0f, PN_stdfloat level3=-1.0f, PN_stdfloat level4=-1.0f, PN_stdfloat level5=-1.0f, PN_stdfloat level6=-1.0f, PN_stdfloat level7=-1.0f, PN_stdfloat level8=-1.0f, PN_stdfloat level9=-1.0f)
 For use only with Miles.
 
virtual void set_speaker_mix (PN_stdfloat frontleft, PN_stdfloat frontright, PN_stdfloat center, PN_stdfloat sub, PN_stdfloat backleft, PN_stdfloat backright, PN_stdfloat sideleft, PN_stdfloat sideright)
 For use only with FMOD.
 
virtual void set_time (PN_stdfloat start_time=0.0)=0
 Control time position within the sound, in seconds.
 
virtual void set_volume (PN_stdfloat volume=1.0)=0
 
virtual SoundStatus status () const =0
 
virtual void stop ()=0
 
virtual void write (std::ostream &out) const
 
- Public Member Functions inherited from TypedReferenceCount
 TypedReferenceCount (const TypedReferenceCount &copy)
 
void operator= (const TypedReferenceCount &copy)
 
- Public Member Functions inherited from TypedObject
 TypedObject (const TypedObject &copy)=default
 
TypedObjectas_typed_object ()
 Returns the object, upcast (if necessary) to a TypedObject pointer.
 
const TypedObjectas_typed_object () const
 Returns the object, upcast (if necessary) to a TypedObject pointer.
 
int get_best_parent_from_Set (const std::set< int > &) const
 
int get_type_index () const
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.
 
bool is_exact_type (TypeHandle handle) const
 Returns true if the current object is the indicated type exactly.
 
bool is_of_type (TypeHandle handle) const
 Returns true if the current object is or derives from the indicated type.
 
TypedObjectoperator= (const TypedObject &copy)=default
 
- Public Member Functions inherited from MemoryBase
void operator delete (void *, void *)
 
void operator delete (void *ptr)
 
void operator delete[] (void *, void *)
 
void operator delete[] (void *ptr)
 
void * operator new (size_t size)
 
void * operator new (size_t size, void *ptr)
 
void * operator new[] (size_t size)
 
void * operator new[] (size_t size, void *ptr)
 
- Public Member Functions inherited from ReferenceCount
int get_ref_count () const
 
WeakReferenceListget_weak_list () const
 Returns the WeakReferenceList associated with this ReferenceCount object.
 
bool has_weak_list () const
 Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise.
 
void local_object ()
 This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack.
 
void ref () const
 Explicitly increments the reference count.
 
bool ref_if_nonzero () const
 Atomically increases the reference count of this object if it is not zero.
 
bool test_ref_count_integrity () const
 Does some easy checks to make sure that the reference count isn't completely bogus.
 
bool test_ref_count_nonzero () const
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus.
 
virtual bool unref () const
 Explicitly decrements the reference count.
 
bool unref_if_one () const
 Atomically decreases the reference count of this object if it is one.
 
WeakReferenceListweak_ref ()
 Adds the indicated PointerToVoid as a weak reference to this object.
 
void weak_unref ()
 Removes the indicated PointerToVoid as a weak reference to this object.
 

Static Public Member Functions

static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from TypedReferenceCount
static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from TypedObject
static TypeHandle get_class_type ()
 
static void init_type ()
 This function is declared non-inline to work around a compiler bug in g++ 2.96.
 
- Static Public Member Functions inherited from ReferenceCount
static TypeHandle get_class_type ()
 
static void init_type ()
 

Friends

class AudioManager
 

Additional Inherited Members

- Public Attributes inherited from TypedObject
 get_type
 
- Public Attributes inherited from ReferenceCount
 get_ref_count
 Returns the current reference count.
 

Detailed Description

Definition at line 25 of file audioSound.h.

Member Enumeration Documentation

◆ SoundStatus

enum AudioSound::SoundStatus

Definition at line 129 of file audioSound.h.

Constructor & Destructor Documentation

◆ ~AudioSound()

AudioSound::~AudioSound ( )
virtual

Definition at line 24 of file audioSound.cxx.

Member Function Documentation

◆ configure_filters()

bool AudioSound::configure_filters ( FilterProperties * config)
virtual

Configure the local 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 110 of file audioSound.cxx.

References FilterProperties::get_config().

◆ force_init_type()

virtual TypeHandle AudioSound::force_init_type ( )
inlinevirtual

Reimplemented from TypedReferenceCount.

Definition at line 152 of file audioSound.h.

◆ get_3d_attributes()

void AudioSound::get_3d_attributes ( PN_stdfloat * px,
PN_stdfloat * py,
PN_stdfloat * pz,
PN_stdfloat * vx,
PN_stdfloat * vy,
PN_stdfloat * vz )
virtual

Reimplemented in FmodAudioSound, and OpenALAudioSound.

Definition at line 42 of file audioSound.cxx.

◆ get_3d_max_distance()

PN_stdfloat AudioSound::get_3d_max_distance ( ) const
virtual

Reimplemented in FmodAudioSound, and OpenALAudioSound.

Definition at line 63 of file audioSound.cxx.

◆ get_3d_min_distance()

PN_stdfloat AudioSound::get_3d_min_distance ( ) const
virtual

Reimplemented in FmodAudioSound, and OpenALAudioSound.

Definition at line 52 of file audioSound.cxx.

◆ get_active()

virtual bool AudioSound::get_active ( ) const
pure virtual

Implemented in FmodAudioSound, and OpenALAudioSound.

◆ get_balance()

virtual PN_stdfloat AudioSound::get_balance ( ) const
pure virtual

Implemented in FmodAudioSound, and OpenALAudioSound.

◆ get_class_type()

static TypeHandle AudioSound::get_class_type ( )
inlinestatic

Definition at line 141 of file audioSound.h.

◆ get_finished_event()

virtual const std::string & AudioSound::get_finished_event ( ) const
pure virtual

Implemented in FmodAudioSound.

◆ get_loop()

virtual bool AudioSound::get_loop ( ) const
pure virtual

Implemented in FmodAudioSound, and OpenALAudioSound.

◆ get_loop_count()

virtual unsigned long AudioSound::get_loop_count ( ) const
pure virtual

Implemented in FmodAudioSound, and OpenALAudioSound.

◆ get_name()

virtual const std::string & AudioSound::get_name ( ) const
pure virtual

Implemented in FmodAudioSound, and OpenALAudioSound.

◆ get_priority()

int AudioSound::get_priority ( )
virtual

Definition at line 123 of file audioSound.cxx.

◆ get_speaker_level()

PN_stdfloat AudioSound::get_speaker_level ( int index)
virtual

For use only with Miles.

Definition at line 89 of file audioSound.cxx.

◆ get_speaker_mix()

PN_stdfloat AudioSound::get_speaker_mix ( int speaker)
virtual

For use only with FMOD.

Reimplemented in FmodAudioSound.

Definition at line 72 of file audioSound.cxx.

◆ get_time()

virtual PN_stdfloat AudioSound::get_time ( ) const
pure virtual

Implemented in FmodAudioSound, and OpenALAudioSound.

◆ get_type()

virtual TypeHandle AudioSound::get_type ( ) const
inlinevirtual

Reimplemented from TypedReferenceCount.

Definition at line 149 of file audioSound.h.

◆ get_volume()

virtual PN_stdfloat AudioSound::get_volume ( ) const
pure virtual

Implemented in FmodAudioSound, and OpenALAudioSound.

◆ init_type()

static void AudioSound::init_type ( )
inlinestatic

Definition at line 144 of file audioSound.h.

◆ length()

virtual PN_stdfloat AudioSound::length ( ) const
pure virtual

Implemented in FmodAudioSound, and OpenALAudioSound.

◆ output()

void AudioSound::output ( std::ostream & out) const
virtual

Definition at line 141 of file audioSound.cxx.

◆ play()

virtual void AudioSound::play ( )
pure virtual

Implemented in FmodAudioSound, and OpenALAudioSound.

◆ set_3d_attributes()

void AudioSound::set_3d_attributes ( PN_stdfloat px,
PN_stdfloat py,
PN_stdfloat pz,
PN_stdfloat vx,
PN_stdfloat vy,
PN_stdfloat vz )
virtual

Reimplemented in FmodAudioSound, and OpenALAudioSound.

Definition at line 37 of file audioSound.cxx.

◆ set_3d_max_distance()

void AudioSound::set_3d_max_distance ( PN_stdfloat dist)
virtual

Reimplemented in FmodAudioSound, and OpenALAudioSound.

Definition at line 58 of file audioSound.cxx.

◆ set_3d_min_distance()

void AudioSound::set_3d_min_distance ( PN_stdfloat dist)
virtual

Reimplemented in FmodAudioSound, and OpenALAudioSound.

Definition at line 47 of file audioSound.cxx.

◆ set_active()

virtual void AudioSound::set_active ( bool flag = true)
pure virtual

Implemented in FmodAudioSound, and OpenALAudioSound.

◆ set_balance()

virtual void AudioSound::set_balance ( PN_stdfloat balance_right = 0.0)
pure virtual

Implemented in FmodAudioSound, and OpenALAudioSound.

◆ set_finished_event()

virtual void AudioSound::set_finished_event ( const std::string & event)
pure virtual

Implemented in FmodAudioSound.

◆ set_loop()

virtual void AudioSound::set_loop ( bool loop = true)
pure virtual

Implemented in FmodAudioSound, and OpenALAudioSound.

◆ set_loop_count()

virtual void AudioSound::set_loop_count ( unsigned long loop_count = 1)
pure virtual

Implemented in FmodAudioSound.

◆ set_play_rate()

virtual void AudioSound::set_play_rate ( PN_stdfloat play_rate = 1.0f)
pure virtual

Implemented in FmodAudioSound, and OpenALAudioSound.

◆ set_priority()

void AudioSound::set_priority ( int priority)
virtual

Definition at line 132 of file audioSound.cxx.

◆ set_speaker_levels()

void AudioSound::set_speaker_levels ( PN_stdfloat level1,
PN_stdfloat level2 = -1.0f,
PN_stdfloat level3 = -1.0f,
PN_stdfloat level4 = -1.0f,
PN_stdfloat level5 = -1.0f,
PN_stdfloat level6 = -1.0f,
PN_stdfloat level7 = -1.0f,
PN_stdfloat level8 = -1.0f,
PN_stdfloat level9 = -1.0f )
virtual

For use only with Miles.

Definition at line 98 of file audioSound.cxx.

◆ set_speaker_mix()

void AudioSound::set_speaker_mix ( PN_stdfloat frontleft,
PN_stdfloat frontright,
PN_stdfloat center,
PN_stdfloat sub,
PN_stdfloat backleft,
PN_stdfloat backright,
PN_stdfloat sideleft,
PN_stdfloat sideright )
virtual

For use only with FMOD.

Reimplemented in FmodAudioSound.

Definition at line 81 of file audioSound.cxx.

◆ set_time()

virtual void AudioSound::set_time ( PN_stdfloat start_time = 0.0)
pure virtual

Control time position within the sound, in seconds.

This is similar (in concept) to the seek position within a file. The value starts at 0.0 (the default) and ends at the value given by the length() method.

The current time position will not change while the sound is playing; you must call play() again to effect the change. To play the same sound from a time offset a second time, explicitly set the time position again. When looping, the second and later loops will start from the beginning of the sound.

If a sound is playing, calling get_time() repeatedly will return different results over time. e.g.

PN_stdfloat percent_complete = s.get_time() / s.length();

Implemented in FmodAudioSound, OpenALAudioSound, and NullAudioSound.

◆ set_volume()

virtual void AudioSound::set_volume ( PN_stdfloat volume = 1.0)
pure virtual

Implemented in FmodAudioSound, and OpenALAudioSound.

◆ status()

virtual SoundStatus AudioSound::status ( ) const
pure virtual

Implemented in FmodAudioSound, and OpenALAudioSound.

◆ stop()

virtual void AudioSound::stop ( )
pure virtual

Implemented in FmodAudioSound, and OpenALAudioSound.

◆ write()

void AudioSound::write ( std::ostream & out) const
virtual

Definition at line 149 of file audioSound.cxx.

Friends And Related Symbol Documentation

◆ AudioManager

friend class AudioManager
friend

Definition at line 138 of file audioSound.h.


The documentation for this class was generated from the following files: