CSL 5.2

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Protected Attributes
csl::StereoSpeakerLayout Class Reference

Standard "Stereo Speaker Layout", where two speakers are positioned 30¼ left, 30¼ right and no elevation (0¼). More...

`#include <SpeakerLayout.h>`

Inheritance diagram for csl::StereoSpeakerLayout:

List of all members.

## Public Member Functions
| StereoSpeakerLayout ()
void | readSpeakerFile (const char *filePath)
| Reads the speaker listing file according to the specification.
void | addSpeaker (float azimuth, float elevation=0.0, float radius=1.0)
| Add a speaker specifying its position in degrees from the center of the listening space.
void | addSpeaker (float x, float y, float z, float xNorm, float yNorm, float zNorm, float gain)
| Add a WFS speaker.
unsigned | numSpeakers () const
void | normalizeSpeakerDistances (float radius=0)
| Returns the number of loudspeakers in the layout.
Speaker * | speakerAtIndex (unsigned speakerIndex) const
| Returns the speaker at the specified index.
bool | isPeriphonic ()
void | dump ()
| If any of the speakers in the layout has an elevation other than 0, it returns true.
void | attachObserver (Observer *)
| (possibly notify obersvers on my death)
void | detachObserver (Observer *)
void | changed (void *argument)
| this is what I send to myself to notify my observers; It's not overridden in general. It results in the observers receiving update() calls < override evaluate to filter updates to the observer map
virtual int | evaluate (void *argument)

## Static Public Member Functions
static SpeakerLayout * | defaultSpeakerLayout ()
| Returns a pointer to the default layout. If no default exists, it creates one.
static void | setDefaultSpeakerLayout (SpeakerLayout *defaultLayout)
| Use it to set a layout as default. Clients (e.g. a Panner) can then make use of this layout.

## Protected Attributes
vector< Speaker * > | mSpeakers
| Vector of pointers to the loudspeakers.

## Detailed Description

Standard "Stereo Speaker Layout", where two speakers are positioned 30¼ left, 30¼ right and no elevation (0¼).

Definition at line 86 of file SpeakerLayout.h.

## Constructor & Destructor Documentation

StereoSpeakerLayout::StereoSpeakerLayout | ( |  | ) |

Definition at line 297 of file SpeakerLayout.cpp.

References csl::SpeakerLayout::addSpeaker().

## Member Function Documentation

void SpeakerLayout::readSpeakerFile | ( | const char * | filePath | ) |
| inherited

Reads the speaker listing file according to the specification.

Definition at line 84 of file SpeakerLayout.cpp.

References csl::SpeakerLayout::addSpeaker(), csl::SpeakerLayout::dump(), csl::kLogError, csl::logMsg(), csl::CPoint::x, csl::CPoint::y, and csl::CPoint::z.

Referenced by csl::SpeakerLayout::SpeakerLayout().

SpeakerLayout * SpeakerLayout::defaultSpeakerLayout | ( |  | ) |
| static inherited

Returns a pointer to the default layout. If no default exists, it creates one.

Returns a reference to the default layout. If no layout has been set, it creates a stereo speaker layout.

Definition at line 29 of file SpeakerLayout.cpp.

References csl::SpeakerLayout::sDefaultSpeakerLayout.

Referenced by csl::SpeakerLayout::setDefaultSpeakerLayout(), and csl::SpatialPanner::update().

void SpeakerLayout::setDefaultSpeakerLayout | ( | SpeakerLayout * | defaultLayout | ) |
| static inherited

Use it to set a layout as default. Clients (e.g. a Panner) can then make use of this layout.

The default speaker layout is used by Panners, when not specified otherwise. If using multiple Panners, but only one speaker setup, is best to set the layout as default, and then forget about that; Panners will know to use such layout.

Note:
  As a suggestion, set the default layout before creating any Panners. Otherwise they'll have to rebuild their data.

Definition at line 41 of file SpeakerLayout.cpp.

References csl::Model::changed(), csl::SpeakerLayout::defaultSpeakerLayout(), and csl::SpeakerLayout::sDefaultSpeakerLayout.

void SpeakerLayout::addSpeaker | ( | float | azimuth,
|  | float | elevation = `0.0`,
|  | float | radius = `1.0`
| ) |  |
| inherited

Add a speaker specifying its position in degrees from the center of the listening space.

Add a speaker to the layout. Parameters should be specified in degrees.

Definition at line 150 of file SpeakerLayout.cpp.

References csl::Model::changed(), CSL_PI, csl::SpeakerLayout::mDimensions, and csl::SpeakerLayout::mSpeakers.

Referenced by csl::HeadphoneSpeakerLayout::HeadphoneSpeakerLayout(), csl::SpeakerLayout::readSpeakerFile(), and StereoSpeakerLayout().

void SpeakerLayout::addSpeaker | ( | float | x,
|  | float | y,
|  | float | z,
|  | float | xNorm,
|  | float | yNorm,
|  | float | zNorm,
|  | float | gain
| ) |  |
| inherited

Add a WFS speaker.

Add a speaker to the layout. Parameters should be specified in x,y,z.

Definition at line 164 of file SpeakerLayout.cpp.

References csl::Model::changed(), and csl::SpeakerLayout::mSpeakers.

unsigned csl::SpeakerLayout::numSpeakers | ( |  | ) | const
| inline inherited

Definition at line 58 of file SpeakerLayout.h.

References csl::SpeakerLayout::mSpeakers.

Referenced by csl::AmbisonicDecoder::asProjection(), csl::AmbisonicDecoder::asPseudoInverse(), csl::SpeakerLayoutExpert::findPannerFromLayout(), csl::SpeakerSetLayout::findSpeakerPairs(), csl::SpeakerSetLayout::findSpeakerTriplets(), csl::AmbisonicDecoder::initialize(), csl::AmbisonicDecoder::makeInPhase(), csl::AmbisonicDecoder::makeMaxRE(), csl::AmbisonicDecoder::makeTransposedReEncodingMatrix(), csl::SpeakerLayout::operator=(), csl::VBAP::speakerLayoutChanged(), csl::VBAP::VBAP(), and csl::AmbisonicDecoder::~AmbisonicDecoder().

void SpeakerLayout::normalizeSpeakerDistances | ( | float | radius = `0` | ) |
| inherited

Returns the number of loudspeakers in the layout.

When speakers are not placed at the same distance from the "sweet spot" (the center of the listening space) it's common to assume they are at a fixed distance by setting all of them as if they were, and then the output data is delayed to compensate for this difference. See: ActiveSpeakerLayout.

Sets speaker distances to a fixed distance from the center of the listening space.

Parameters:

  radius | is optional. If not set, it finds the best radius by analyzing the layout.

Definition at line 178 of file SpeakerLayout.cpp.

References csl::SpeakerLayout::mSpeakerDistanceDeltas, and csl::SpeakerLayout::mSpeakers.

Speaker* csl::SpeakerLayout::speakerAtIndex | ( | unsigned | speakerIndex | ) | const
| inline inherited

Returns the speaker at the specified index.

Definition at line 65 of file SpeakerLayout.h.

References csl::SpeakerLayout::mSpeakers.

Referenced by csl::SpeakerSetLayout::findSpeakerPairs(), csl::SpeakerSetLayout::findSpeakerTriplets(), csl::SpeakerSetLayout::invertTripleMatrix(), csl::AmbisonicDecoder::makeTransposedReEncodingMatrix(), and csl::SpeakerLayout::operator=().

bool csl::SpeakerLayout::isPeriphonic | ( |  | ) |
| inline inherited

Definition at line 67 of file SpeakerLayout.h.

References csl::SpeakerLayout::mDimensions.

Referenced by csl::SpeakerSetLayout::SpeakerSetLayout(), and csl::VBAP::VBAP().

void SpeakerLayout::dump | ( | void |  | ) |
| inherited

If any of the speakers in the layout has an elevation other than 0, it returns true.

Prints the number of speakers in the layout and their position.

Definition at line 204 of file SpeakerLayout.cpp.

References csl::SpeakerLayout::mSpeakers.

Referenced by csl::SpeakerLayout::readSpeakerFile().

void Model::attachObserver | ( | Observer * | o | ) |
| inherited

(possibly notify obersvers on my death)

register/remove observers

Definition at line 491 of file CGestalt.cpp.

References csl::logMsg(), csl::Observer::mKey, and csl::Observer::mPeriod.

Referenced by csl::SpatialPanner::setSpeakerLayout().

void Model::detachObserver | ( | Observer * | o | ) |
| inherited

Definition at line 507 of file CGestalt.cpp.

References csl::logMsg().

Referenced by csl::SpatialPanner::setSpeakerLayout(), and csl::SpatialPanner::~SpatialPanner().

void Model::changed | ( | void * | argument | ) |
| inherited

this is what I send to myself to notify my observers; It's not overridden in general. It results in the observers receiving update() calls < override evaluate to filter updates to the observer map

Definition at line 529 of file CGestalt.cpp.

References csl::logMsg().

Referenced by csl::SpeakerLayout::addSpeaker(), csl::MIDIIn::handleIncomingMidiMessage(), and csl::SpeakerLayout::setDefaultSpeakerLayout().

virtual int csl::Model::evaluate | ( | void * | argument | ) |
| inline virtual inherited

Reimplemented in csl::MIDIIn.

Definition at line 259 of file CGestalt.h.

## Member Data Documentation

vector<Speaker *> csl::SpeakerLayout::mSpeakers
| protected inherited

Vector of pointers to the loudspeakers.

Definition at line 71 of file SpeakerLayout.h.

Referenced by csl::SpeakerLayout::addSpeaker(), csl::SpeakerLayout::dump(), csl::SpeakerLayout::normalizeSpeakerDistances(), csl::SpeakerLayout::numSpeakers(), csl::SpeakerLayout::operator=(), csl::SpeakerLayout::speakerAtIndex(), and csl::SpeakerLayout::~SpeakerLayout().

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

- CSL/Spatializers/SpeakerLayout.h
- CSL/Spatializers/SpeakerLayout.cpp