Blender V2.61 - r43446

AUD_SoftwareDevice::AUD_SoftwareHandle Class Reference

Saves the data for playback. More...

#include <AUD_SoftwareDevice.h>

Inheritance diagram for AUD_SoftwareDevice::AUD_SoftwareHandle:

List of all members.

Public Member Functions

 AUD_SoftwareHandle (AUD_SoftwareDevice *device, AUD_Reference< AUD_IReader > reader, AUD_Reference< AUD_PitchReader > pitch, AUD_Reference< AUD_ResampleReader > resampler, AUD_Reference< AUD_ChannelMapperReader > mapper, bool keep)
void update ()
void setSpecs (AUD_Specs specs)
virtual ~AUD_SoftwareHandle ()
virtual bool pause ()
virtual bool resume ()
virtual bool stop ()
virtual bool getKeep ()
virtual bool setKeep (bool keep)
virtual bool seek (float position)
virtual float getPosition ()
virtual AUD_Status getStatus ()
virtual float getVolume ()
virtual bool setVolume (float volume)
virtual float getPitch ()
virtual bool setPitch (float pitch)
virtual int getLoopCount ()
virtual bool setLoopCount (int count)
virtual bool setStopCallback (stopCallback callback=0, void *data=0)
virtual AUD_Vector3 getSourceLocation ()
virtual bool setSourceLocation (const AUD_Vector3 &location)
virtual AUD_Vector3 getSourceVelocity ()
virtual bool setSourceVelocity (const AUD_Vector3 &velocity)
virtual AUD_Quaternion getSourceOrientation ()
virtual bool setSourceOrientation (const AUD_Quaternion &orientation)
virtual bool isRelative ()
virtual bool setRelative (bool relative)
virtual float getVolumeMaximum ()
virtual bool setVolumeMaximum (float volume)
virtual float getVolumeMinimum ()
virtual bool setVolumeMinimum (float volume)
virtual float getDistanceMaximum ()
virtual bool setDistanceMaximum (float distance)
virtual float getDistanceReference ()
virtual bool setDistanceReference (float distance)
virtual float getAttenuation ()
virtual bool setAttenuation (float factor)
virtual float getConeAngleOuter ()
virtual bool setConeAngleOuter (float angle)
virtual float getConeAngleInner ()
virtual bool setConeAngleInner (float angle)
virtual float getConeVolumeOuter ()
virtual bool setConeVolumeOuter (float volume)

Public Attributes

AUD_Reference< AUD_IReaderm_reader
 The reader source.
AUD_Reference< AUD_PitchReaderm_pitch
 The pitch reader in between.
AUD_Reference< AUD_ResampleReaderm_resampler
 The resample reader in between.
AUD_Reference
< AUD_ChannelMapperReader
m_mapper
 The channel mapper reader in between.
bool m_keep
 Whether to keep the source if end of it is reached.
float m_user_pitch
 The user set pitch of the source.
float m_user_volume
 The user set volume of the source.
float m_user_pan
 The user set panning for non-3D sources.
float m_volume
 The calculated final volume of the source.
int m_loopcount
 The loop count of the source.
AUD_Vector3 m_location
 Location in 3D Space.
AUD_Vector3 m_velocity
 Velocity in 3D Space.
AUD_Quaternion m_orientation
 Orientation in 3D Space.
bool m_relative
 Whether the position to the listener is relative or absolute.
float m_volume_max
 Maximum volume.
float m_volume_min
 Minimum volume.
float m_distance_max
 Maximum distance.
float m_distance_reference
 Reference distance;.
float m_attenuation
 Attenuation.
float m_cone_angle_outer
 Cone outer angle.
float m_cone_angle_inner
 Cone inner angle.
float m_cone_volume_outer
 Cone outer volume.
int m_flags
 Rendering flags.
stopCallback m_stop
 The stop callback.
void * m_stop_data
 Stop callback data.
AUD_Status m_status
 Current status of the handle.
AUD_SoftwareDevicem_device
 Own device.

Detailed Description

Saves the data for playback.

Definition at line 58 of file AUD_SoftwareDevice.h.


Constructor & Destructor Documentation

AUD_SoftwareDevice::AUD_SoftwareHandle::AUD_SoftwareHandle ( AUD_SoftwareDevice device,
AUD_Reference< AUD_IReader reader,
AUD_Reference< AUD_PitchReader pitch,
AUD_Reference< AUD_ResampleReader resampler,
AUD_Reference< AUD_ChannelMapperReader mapper,
bool  keep 
)

Creates a new software handle.

Parameters:
deviceThe device this handle is from.
readerThe reader to play.
pitchThe pitch reader.
resamplerThe resampling reader.
mapperThe channel mapping reader.
keepWhether to keep the handle when the sound ends.

Definition at line 59 of file AUD_SoftwareDevice.cpp.

virtual AUD_SoftwareDevice::AUD_SoftwareHandle::~AUD_SoftwareHandle ( ) [inline, virtual]

Definition at line 166 of file AUD_SoftwareDevice.h.


Member Function Documentation

float AUD_SoftwareDevice::AUD_SoftwareHandle::getAttenuation ( ) [virtual]

Retrieves the attenuation of a source.

Returns:
The attenuation.

Implements AUD_I3DHandle.

Definition at line 570 of file AUD_SoftwareDevice.cpp.

float AUD_SoftwareDevice::AUD_SoftwareHandle::getConeAngleInner ( ) [virtual]

Retrieves the inner angle of the cone of a source.

Returns:
The inner angle of the cone.

Implements AUD_I3DHandle.

Definition at line 611 of file AUD_SoftwareDevice.cpp.

References M_PI.

float AUD_SoftwareDevice::AUD_SoftwareHandle::getConeAngleOuter ( ) [virtual]

Retrieves the outer angle of the cone of a source.

Returns:
The outer angle of the cone.

Implements AUD_I3DHandle.

Definition at line 593 of file AUD_SoftwareDevice.cpp.

References M_PI.

float AUD_SoftwareDevice::AUD_SoftwareHandle::getConeVolumeOuter ( ) [virtual]

Retrieves the outer volume of the cone of a source. The volume between inner and outer angle is interpolated between inner volume and this value.

Returns:
The outer volume of the cone.

Implements AUD_I3DHandle.

Definition at line 634 of file AUD_SoftwareDevice.cpp.

float AUD_SoftwareDevice::AUD_SoftwareHandle::getDistanceMaximum ( ) [virtual]

Retrieves the maximum distance of a source. If a source is further away from the reader than this distance, the volume will automatically be set to 0.

Returns:
The maximum distance.

Implements AUD_I3DHandle.

Definition at line 534 of file AUD_SoftwareDevice.cpp.

float AUD_SoftwareDevice::AUD_SoftwareHandle::getDistanceReference ( ) [virtual]

Retrieves the reference distance of a source.

Returns:
The reference distance.

Implements AUD_I3DHandle.

Definition at line 552 of file AUD_SoftwareDevice.cpp.

bool AUD_SoftwareDevice::AUD_SoftwareHandle::getKeep ( ) [virtual]

Gets the behaviour of the device for a played back sound when the sound doesn't return any more samples.

Returns:
  • true if the source will be paused when it's end is reached
  • false if the handle won't kept or is invalid.

Implements AUD_IHandle.

Definition at line 300 of file AUD_SoftwareDevice.cpp.

int AUD_SoftwareDevice::AUD_SoftwareHandle::getLoopCount ( ) [virtual]

Retrieves the loop count of a playing sound. A negative value indicates infinity.

Returns:
The remaining loop count.

Implements AUD_IHandle.

Definition at line 390 of file AUD_SoftwareDevice.cpp.

float AUD_SoftwareDevice::AUD_SoftwareHandle::getPitch ( ) [virtual]

Retrieves the pitch of a playing sound.

Returns:
The pitch.

Implements AUD_IHandle.

Definition at line 377 of file AUD_SoftwareDevice.cpp.

float AUD_SoftwareDevice::AUD_SoftwareHandle::getPosition ( ) [virtual]

Retrieves the current playback position of a sound.

Returns:
The playback position in seconds, or 0.0 if the handle is invalid.

Implements AUD_IHandle.

Definition at line 336 of file AUD_SoftwareDevice.cpp.

AUD_Vector3 AUD_SoftwareDevice::AUD_SoftwareHandle::getSourceLocation ( ) [virtual]

Retrieves the location of a source.

Returns:
The location.

Implements AUD_I3DHandle.

Definition at line 426 of file AUD_SoftwareDevice.cpp.

AUD_Quaternion AUD_SoftwareDevice::AUD_SoftwareHandle::getSourceOrientation ( ) [virtual]

Retrieves the orientation of a source.

Returns:
The orientation as quaternion.

Implements AUD_I3DHandle.

Definition at line 462 of file AUD_SoftwareDevice.cpp.

AUD_Vector3 AUD_SoftwareDevice::AUD_SoftwareHandle::getSourceVelocity ( ) [virtual]

Retrieves the velocity of a source.

Returns:
The velocity.

Implements AUD_I3DHandle.

Definition at line 444 of file AUD_SoftwareDevice.cpp.

AUD_Status AUD_SoftwareDevice::AUD_SoftwareHandle::getStatus ( ) [virtual]

Returns the status of a played back sound.

Returns:
  • AUD_STATUS_INVALID if the sound has stopped or the handle is . invalid
  • AUD_STATUS_PLAYING if the sound is currently played back.
  • AUD_STATUS_PAUSED if the sound is currently paused.
See also:
AUD_Status

Implements AUD_IHandle.

Definition at line 350 of file AUD_SoftwareDevice.cpp.

float AUD_SoftwareDevice::AUD_SoftwareHandle::getVolume ( ) [virtual]

Retrieves the volume of a playing sound.

Returns:
The volume.

Implements AUD_IHandle.

Definition at line 355 of file AUD_SoftwareDevice.cpp.

float AUD_SoftwareDevice::AUD_SoftwareHandle::getVolumeMaximum ( ) [virtual]

Retrieves the maximum volume of a source.

Returns:
The maximum volume.

Implements AUD_I3DHandle.

Definition at line 498 of file AUD_SoftwareDevice.cpp.

float AUD_SoftwareDevice::AUD_SoftwareHandle::getVolumeMinimum ( ) [virtual]

Retrieves the minimum volume of a source.

Returns:
The minimum volume.

Implements AUD_I3DHandle.

Definition at line 516 of file AUD_SoftwareDevice.cpp.

bool AUD_SoftwareDevice::AUD_SoftwareHandle::isRelative ( ) [virtual]

Checks whether the source location, velocity and orientation are relative to the listener.

Returns:
Whether the source is relative.

Implements AUD_I3DHandle.

Definition at line 480 of file AUD_SoftwareDevice.cpp.

bool AUD_SoftwareDevice::AUD_SoftwareHandle::pause ( ) [virtual]

Pauses a played back sound.

Returns:
  • true if the sound has been paused.
  • false if the sound isn't playing back or the handle is invalid.

Implements AUD_IHandle.

Definition at line 225 of file AUD_SoftwareDevice.cpp.

References AUD_STATUS_PAUSED, and AUD_STATUS_PLAYING.

bool AUD_SoftwareDevice::AUD_SoftwareHandle::resume ( ) [virtual]

Resumes a paused sound.

Returns:
  • true if the sound has been resumed.
  • false if the sound isn't paused or the handle is invalid.

Implements AUD_IHandle.

Definition at line 250 of file AUD_SoftwareDevice.cpp.

References AUD_STATUS_PAUSED, and AUD_STATUS_PLAYING.

bool AUD_SoftwareDevice::AUD_SoftwareHandle::seek ( float  position) [virtual]

Seeks in a played back sound.

Parameters:
positionThe new position from where to play back, in seconds.
Returns:
  • true if the handle is valid.
  • false if the handle is invalid.
Warning:
Whether the seek works or not depends on the sound source.

Implements AUD_IHandle.

Definition at line 322 of file AUD_SoftwareDevice.cpp.

bool AUD_SoftwareDevice::AUD_SoftwareHandle::setAttenuation ( float  factor) [virtual]

Sets the attenuation of a source. This value is used for distance calculation.

Parameters:
factorThe new attenuation.
Returns:
Whether the action succeeded.

Implements AUD_I3DHandle.

Definition at line 578 of file AUD_SoftwareDevice.cpp.

References AUD_RENDER_DISTANCE.

bool AUD_SoftwareDevice::AUD_SoftwareHandle::setConeAngleInner ( float  angle) [virtual]

Sets the inner angle of the cone of a source.

Parameters:
angleThe new inner angle of the cone.
Returns:
Whether the action succeeded.

Implements AUD_I3DHandle.

Definition at line 619 of file AUD_SoftwareDevice.cpp.

References AUD_RENDER_CONE, and M_PI.

bool AUD_SoftwareDevice::AUD_SoftwareHandle::setConeAngleOuter ( float  angle) [virtual]

Sets the outer angle of the cone of a source.

Parameters:
angleThe new outer angle of the cone.
Returns:
Whether the action succeeded.

Implements AUD_I3DHandle.

Definition at line 601 of file AUD_SoftwareDevice.cpp.

References M_PI.

bool AUD_SoftwareDevice::AUD_SoftwareHandle::setConeVolumeOuter ( float  volume) [virtual]

Sets the outer volume of the cone of a source. The volume between inner and outer angle is interpolated between inner volume and this value.

Parameters:
volumeThe new outer volume of the cone.
Returns:
Whether the action succeeded.

Implements AUD_I3DHandle.

Definition at line 642 of file AUD_SoftwareDevice.cpp.

bool AUD_SoftwareDevice::AUD_SoftwareHandle::setDistanceMaximum ( float  distance) [virtual]

Sets the maximum distance of a source. If a source is further away from the reader than this distance, the volume will automatically be set to 0.

Parameters:
distanceThe new maximum distance.
Returns:
Whether the action succeeded.

Implements AUD_I3DHandle.

Definition at line 542 of file AUD_SoftwareDevice.cpp.

References distance().

bool AUD_SoftwareDevice::AUD_SoftwareHandle::setDistanceReference ( float  distance) [virtual]

Sets the reference distance of a source.

Parameters:
distanceThe new reference distance.
Returns:
Whether the action succeeded.

Implements AUD_I3DHandle.

Definition at line 560 of file AUD_SoftwareDevice.cpp.

References distance().

bool AUD_SoftwareDevice::AUD_SoftwareHandle::setKeep ( bool  keep) [virtual]

Sets the behaviour of the device for a played back sound when the sound doesn't return any more samples.

Parameters:
keepTrue when the source should be paused and not deleted.
Returns:
  • true if the behaviour has been changed.
  • false if the handle is invalid.

Implements AUD_IHandle.

Definition at line 308 of file AUD_SoftwareDevice.cpp.

bool AUD_SoftwareDevice::AUD_SoftwareHandle::setLoopCount ( int  count) [virtual]

Sets the loop count of a playing sound. A negative value indicates infinity.

Parameters:
countThe new loop count.
Returns:
  • true if the handle is valid.
  • false if the handle is invalid.

Implements AUD_IHandle.

Definition at line 397 of file AUD_SoftwareDevice.cpp.

bool AUD_SoftwareDevice::AUD_SoftwareHandle::setPitch ( float  pitch) [virtual]

Sets the pitch of a playing sound.

Parameters:
pitchThe pitch.
Returns:
  • true if the handle is valid.
  • false if the handle is invalid.

Implements AUD_IHandle.

Definition at line 382 of file AUD_SoftwareDevice.cpp.

bool AUD_SoftwareDevice::AUD_SoftwareHandle::setRelative ( bool  relative) [virtual]

Sets whether the source location, velocity and orientation are relative to the listener.

Parameters:
relativeWhether the source is relative.
Returns:
Whether the action succeeded.

Implements AUD_I3DHandle.

Definition at line 488 of file AUD_SoftwareDevice.cpp.

bool AUD_SoftwareDevice::AUD_SoftwareHandle::setSourceLocation ( const AUD_Vector3 location) [virtual]

Sets the location of a source.

Parameters:
locationThe new location.
Returns:
Whether the action succeeded.

Implements AUD_I3DHandle.

Definition at line 434 of file AUD_SoftwareDevice.cpp.

bool AUD_SoftwareDevice::AUD_SoftwareHandle::setSourceOrientation ( const AUD_Quaternion orientation) [virtual]

Sets the orientation of a source.

Parameters:
orientationThe new orientation as quaternion.
Returns:
Whether the action succeeded.

Implements AUD_I3DHandle.

Definition at line 470 of file AUD_SoftwareDevice.cpp.

bool AUD_SoftwareDevice::AUD_SoftwareHandle::setSourceVelocity ( const AUD_Vector3 velocity) [virtual]

Sets the velocity of a source.

Parameters:
velocityThe new velocity.
Returns:
Whether the action succeeded.

Implements AUD_I3DHandle.

Definition at line 452 of file AUD_SoftwareDevice.cpp.

void AUD_SoftwareDevice::AUD_SoftwareHandle::setSpecs ( AUD_Specs  specs)

Sets the audio output specification of the readers.

Parameters:
sepcsThe output specification.

Definition at line 219 of file AUD_SoftwareDevice.cpp.

References AUD_Specs::channels, and AUD_Specs::rate.

bool AUD_SoftwareDevice::AUD_SoftwareHandle::setStopCallback ( stopCallback  callback = 0,
void *  data = 0 
) [virtual]

Sets the callback function that's called when the end of a playing sound is reached.

Parameters:
callbackThe callback function.
dataThe data that should be passed to the callback function.
Returns:
  • true if the handle is valid.
  • false if the handle is invalid.

Implements AUD_IHandle.

Definition at line 405 of file AUD_SoftwareDevice.cpp.

References data.

bool AUD_SoftwareDevice::AUD_SoftwareHandle::setVolume ( float  volume) [virtual]

Sets the volume of a playing sound.

Parameters:
volumeThe volume.
Returns:
  • true if the handle is valid.
  • false if the handle is invalid.

Implements AUD_IHandle.

Definition at line 360 of file AUD_SoftwareDevice.cpp.

References AUD_RENDER_VOLUME.

bool AUD_SoftwareDevice::AUD_SoftwareHandle::setVolumeMaximum ( float  volume) [virtual]

Sets the maximum volume of a source.

Parameters:
volumeThe new maximum volume.
Returns:
Whether the action succeeded.

Implements AUD_I3DHandle.

Definition at line 506 of file AUD_SoftwareDevice.cpp.

bool AUD_SoftwareDevice::AUD_SoftwareHandle::setVolumeMinimum ( float  volume) [virtual]

Sets the minimum volume of a source.

Parameters:
volumeThe new minimum volume.
Returns:
Whether the action succeeded.

Implements AUD_I3DHandle.

Definition at line 524 of file AUD_SoftwareDevice.cpp.

bool AUD_SoftwareDevice::AUD_SoftwareHandle::stop ( ) [virtual]

Stops a played back or paused sound. The handle is definitely invalid afterwards.

Returns:
  • true if the sound has been stopped.
  • false if the handle is invalid.

Implements AUD_IHandle.

Definition at line 274 of file AUD_SoftwareDevice.cpp.

References AUD_STATUS_INVALID, and AUD_STATUS_PLAYING.


Member Data Documentation

Attenuation.

Definition at line 116 of file AUD_SoftwareDevice.h.

Cone inner angle.

Definition at line 122 of file AUD_SoftwareDevice.h.

Cone outer angle.

Definition at line 119 of file AUD_SoftwareDevice.h.

Cone outer volume.

Definition at line 125 of file AUD_SoftwareDevice.h.

Maximum distance.

Definition at line 110 of file AUD_SoftwareDevice.h.

Reference distance;.

Definition at line 113 of file AUD_SoftwareDevice.h.

Rendering flags.

Definition at line 128 of file AUD_SoftwareDevice.h.

Whether to keep the source if end of it is reached.

Definition at line 74 of file AUD_SoftwareDevice.h.

The loop count of the source.

Definition at line 89 of file AUD_SoftwareDevice.h.

The channel mapper reader in between.

Definition at line 71 of file AUD_SoftwareDevice.h.

Whether the position to the listener is relative or absolute.

Definition at line 101 of file AUD_SoftwareDevice.h.

Current status of the handle.

Definition at line 137 of file AUD_SoftwareDevice.h.

Stop callback data.

Definition at line 134 of file AUD_SoftwareDevice.h.

The user set panning for non-3D sources.

Definition at line 83 of file AUD_SoftwareDevice.h.

Referenced by AUD_SoftwareDevice::setPanning().

The user set pitch of the source.

Definition at line 77 of file AUD_SoftwareDevice.h.

The user set volume of the source.

Definition at line 80 of file AUD_SoftwareDevice.h.

The calculated final volume of the source.

Definition at line 86 of file AUD_SoftwareDevice.h.

Maximum volume.

Definition at line 104 of file AUD_SoftwareDevice.h.

Minimum volume.

Definition at line 107 of file AUD_SoftwareDevice.h.


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