csl::SpatialSource Class Reference

Temp Spatial Sound Source. More...

#include <SpatialSource.h>

Inheritance diagram for csl::SpatialSource:

csl::UnitGenerator csl::Scalable csl::Model csl::Controllable csl::DistanceSimulator

List of all members.

Public Member Functions

 SpatialSource ()
 constructors
 SpatialSource (UnitGenerator &input, float azi=0.0, float ele=0.0, float dist=1.0)
virtual ~SpatialSource ()
virtual void setPosition (CPoint pos)
 Set the sound source position in cartesian coordinates.
virtual void setPosition (float x=0., float y=0., float z=0.)
virtual void setPosition (double x=0., double y=0., double z=0.)
virtual void setPosition (char s, float azi=0, float ele=0, float dist=1.0)
 Set the sound source position in spherical coordinates (degrees).
virtual void setPosition (char s, double azi=0, double ele=0, double dist=1.0)
CPointgetPosition ()
void setAzimuth (float val)
void setElevation (float val)
 Sets the horizontal angle.
void setDistance (float val)
 Sets the angle of elevation.
float azimuth ()
 Sets the distance from the center.
float elevation ()
 Returns the horizontal angle.
float distance ()
 Returns the angle of elevation.
CPointposition (unsigned channelNum=0)
 Returns the distance from the center.
virtual bool positionChanged ()
 Returns whether the sound source position changed since last block call.
virtual void nextBuffer (Buffer &outputBuffer, unsigned outBufNum) throw (CException)
virtual void nextBuffer (Buffer &outputBuffer) throw (CException)
void dump ()
 pretty-print the receiver

Protected Attributes

CPointmPosition
 source position
bool mPositionChanged
 true if this source's position has changed recently


Detailed Description

Temp Spatial Sound Source.

Constructor & Destructor Documentation

SpatialSource::SpatialSource (  ) 

constructors

SpatialSource::SpatialSource ( UnitGenerator input,
float  azi = 0.0,
float  ele = 0.0,
float  dist = 1.0 
)

SpatialSource::~SpatialSource (  )  [virtual]

References mPosition.


Member Function Documentation

void SpatialSource::setPosition ( CPoint  pos  )  [virtual]

Set the sound source position in cartesian coordinates.

References mPosition.

Referenced by main(), PMESource::set_position(), and PMESource::update_position().

void SpatialSource::setPosition ( float  x = 0.,
float  y = 0.,
float  z = 0. 
) [virtual]

void SpatialSource::setPosition ( double  x = 0.,
double  y = 0.,
double  z = 0. 
) [virtual]

void SpatialSource::setPosition ( char  s,
float  azi = 0,
float  ele = 0,
float  dist = 1.0 
) [virtual]

Set the sound source position in spherical coordinates (degrees).

References CSL_PI, kPolar, mPosition, mPositionChanged, and csl::CPoint::set().

void SpatialSource::setPosition ( char  s,
double  azi = 0,
double  ele = 0,
double  dist = 1.0 
) [virtual]

CPoint& csl::SpatialSource::getPosition (  )  [inline]

void csl::SpatialSource::setAzimuth ( float  val  )  [inline]

References mPosition, and csl::CPoint::setAzimuth().

Referenced by main().

void csl::SpatialSource::setElevation ( float  val  )  [inline]

Sets the horizontal angle.

References mPosition, and csl::CPoint::setElevation().

Referenced by main().

void csl::SpatialSource::setDistance ( float  val  )  [inline]

Sets the angle of elevation.

References mPosition, and csl::CPoint::setMagnitude().

float csl::SpatialSource::azimuth (  )  [inline]

Sets the distance from the center.

References mPosition, and csl::CPoint::theta().

Referenced by dump(), main(), and csl::AmbisonicEncoder::nextBuffer().

float csl::SpatialSource::elevation (  )  [inline]

Returns the horizontal angle.

References csl::CPoint::ele(), and mPosition.

Referenced by dump(), main(), and csl::AmbisonicEncoder::nextBuffer().

float csl::SpatialSource::distance (  )  [inline]

Returns the angle of elevation.

References mPosition, and csl::CPoint::r().

Referenced by dump().

CPoint * SpatialSource::position ( unsigned  channelNum = 0  ) 

Returns the distance from the center.

References mPosition.

Referenced by csl::DistanceSimulator::DistanceSimulator(), csl::VBAP::nextBuffer(), and csl::BinauralPanner::nextBuffer().

virtual bool csl::SpatialSource::positionChanged (  )  [inline, virtual]

Returns whether the sound source position changed since last block call.

Reimplemented in csl::DistanceSimulator.

References mPositionChanged.

Referenced by csl::VBAP::nextBuffer(), and csl::BinauralPanner::nextBuffer().

void SpatialSource::nextBuffer ( Buffer outputBuffer,
unsigned  outBufNum 
) throw (CException) [virtual]

really compute the next buffer given an offset base channel; this is called by nextBuffer, possibly multiple times

Reimplemented from csl::UnitGenerator.

Reimplemented in csl::DistanceSimulator.

References CSL_INPUT, csl::Port::mUGen, and csl::UnitGenerator::nextBuffer().

Referenced by csl::VBAP::nextBuffer(), and csl::BinauralPanner::nextBuffer().

void SpatialSource::nextBuffer ( Buffer outputBuffer  )  throw (CException) [virtual]

get a buffer of Frames -- this is the core CSL "pull" function; the given buffer can be written into, and a changed() message is sent.

Reimplemented from csl::UnitGenerator.

References csl::logMsg().

void SpatialSource::dump ( void   )  [virtual]

pretty-print the receiver

Reimplemented from csl::UnitGenerator.

References azimuth(), CSL_DEGS_PER_RAD, distance(), and elevation().


Member Data Documentation

true if this source's position has changed recently

Referenced by positionChanged(), and setPosition().


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

Generated on Thu Sep 17 23:14:18 2009 for CSL by  doxygen 1.5.8