#include <LoudspeakerArray.h>
Type to denote the output signal channels for a regular loudspeaker.
- Note
- the channels are assumed to be specified and stored as one-offset numbers.
Id type to denote loudspeakers by name. This name is also used in the triplet (or polygon) specifications to define the VBAP triangulation.
Type for specifying loudspeaker indices in triplets. At the moment, we use 'int' to let negative numbers denote invalid/unused triplets.
Typ used for all numeric quantities such as as positions coordinates.
visr::panning::LoudspeakerArray::LoudspeakerArray |
( |
| ) |
|
Default contructor, initialises numbers of elements and channel indices to safe values.
visr::panning::LoudspeakerArray::LoudspeakerArray |
( |
std::string const & |
xmlConfiguration | ) |
|
|
explicit |
Construct an initialised array configuration.
- Exceptions
-
std::invalid_argument | if the file xmlConfiguration is not found or inconsistent. |
visr::panning::LoudspeakerArray::~LoudspeakerArray |
( |
| ) |
|
|
default |
Destructor.
- Note
- We need to provide a destructor implementation because we use a unique_ptr to the forward-declared class BiquadParameterMatrix.
ChannelIndex visr::panning::LoudspeakerArray::channelIndex |
( |
std::size_t |
spkIndex | ) |
const |
|
inline |
Return the loudspeaker index associated with a loudspeaker at a given position in the loudspeaker array.
- Note
- the indices are assigned to speaker positions during the setup process and do not necessarily the order in which they are specified in the configuration file.
- Exceptions
-
std::out_of_range | If index exceeds the number of regular loudspeaker. |
Return the delay adjustment vector (in seconds) holding the delays for all regular loudspeakers and subwoofers. The loudspeaker delays are ordered according to their zero-offset logical speaker numbers, followed by the subwoofers in their order of definition in the configuration file.
Return the gain adjustment vector (linear scale) holding the gains for all regular loudspeakers and subwoofers. The loudspeaker gains are ordered according to their zero-offset logical speaker numbers, followed by the subwoofers in their order of definition in the configuration file.
ChannelIndex const* visr::panning::LoudspeakerArray::getLoudspeakerChannels |
( |
| ) |
const |
|
inline |
SampleType visr::panning::LoudspeakerArray::getLoudspeakerDelayAdjustment |
( |
std::size_t |
spkIdx | ) |
const |
|
inline |
SampleType visr::panning::LoudspeakerArray::getLoudspeakerGainAdjustment |
( |
std::size_t |
spkIdx | ) |
const |
|
inline |
Gain and delay adjustments.
std::size_t visr::panning::LoudspeakerArray::getNumRegularSpeakers |
( |
| ) |
const |
|
inline |
Retrieve the number of regular loudspeakers, excluding virtual loudspeakers and subwoofers.
std::size_t visr::panning::LoudspeakerArray::getNumSpeakers |
( |
| ) |
const |
|
inline |
Return the total number of loudspeakers, including virtual speaker positions. Subwoofers are not considered as regular louspeakers.
std::size_t visr::panning::LoudspeakerArray::getNumSubwoofers |
( |
| ) |
const |
|
inline |
Subwoofer configuration support. Supported only by the XML configuration format. Return the number of subwoofers.
std::size_t visr::panning::LoudspeakerArray::getNumTriplets |
( |
| ) |
const |
|
inline |
XYZ& visr::panning::LoudspeakerArray::getPosition |
( |
std::size_t |
iSpk | ) |
|
|
inline |
Return the position of a loudspeaker based on its sorted position.
XYZ const& visr::panning::LoudspeakerArray::getPosition |
( |
std::size_t |
iSpk | ) |
const |
|
inline |
Return the position of a loudspeaker given its string id
XYZ* visr::panning::LoudspeakerArray::getPositions |
( |
| ) |
|
|
inline |
XYZ const* visr::panning::LoudspeakerArray::getPositions |
( |
| ) |
const |
|
inline |
SampleType visr::panning::LoudspeakerArray::getReroutingCoefficient |
( |
std::size_t |
virtIdx, |
|
|
std::size_t |
realIdx |
|
) |
| const |
|
inline |
Retrieve the rereouting coefficient from a virtual to a real loudspeaker
- Parameters
-
virtIdx | virtual loudspeaker index (zero-offset) |
realIdx | real loudspeaker index (zero-offset) This is the logical speaker index, not the channel index used for routing. |
- Returns
- Rerouting coefficient as a linear-scale gain value (not incorporating gain corrections applied to the channel signal).
- Exceptions
-
std::out_of_range | if either virtIdx or realIdx is out of the respective admissible range. |
Virtual speaker rerouting matrix configuration support. Retrieve the matrix of rereouting coefficients from virtual to real loudspeakers
- Returns
- Reference to rereouting matrix, dimension number of virtual loudspeakers * number of physical loudspeakers.
ChannelIndex visr::panning::LoudspeakerArray::getSpeakerChannel |
( |
std::size_t |
spkIndex | ) |
const |
|
inline |
Return the output channel index from a the speaker id of a regular loudspeaker.
- Parameters
-
spkIndex | The index into the loudspeaker array. |
- Exceptions
-
std::out_of_range | If spkIndex exceeds the number of regular loudspeakers. |
- Note
- The indices into the loudspeakers are assigned during construction and do not necessarily match the order in the configuration file.
Return the output channel index (one-offset) from a loudspeaker string id.
- Parameters
-
id | String id corresponding to an existing regular loudspeaker. |
- Exceptions
-
std::out_of_range | If id does not correspond to an existing regular loudspeaker. |
Return the index into the loudspeaker array for a speaker denoted by its string id.
- Parameters
-
id | loudspeaker id for either a regular or virtual loudspeaker. |
- Exceptions
-
std::out_of_range | If index exceeds the range of regular and virtual loudspeakers. |
ChannelIndex visr::panning::LoudspeakerArray::getSubwooferChannel |
( |
std::size_t |
subIdx | ) |
const |
|
inline |
ChannelIndex const* visr::panning::LoudspeakerArray::getSubwooferChannels |
( |
| ) |
const |
|
inline |
SampleType visr::panning::LoudspeakerArray::getSubwooferDelayAdjustment |
( |
std::size_t |
spkIdx | ) |
const |
|
inline |
SampleType visr::panning::LoudspeakerArray::getSubwooferGain |
( |
std::size_t |
subIdx, |
|
|
std::size_t |
spkIdx |
|
) |
| const |
|
inline |
Retrieve the matrix gain from a given loudspeaker to a given subwoofer.
- Parameters
-
subIdx | Subwoofer index (zero-offset) |
spkIdx | Loudspeaker index (zero-offset) This is the logical speaker index, not the channel index used for routing. |
- Returns
- Linear-scale gain value (not incorporating gain corrections applied to the channel signal).
- Exceptions
-
std::out_of_range | if either subIdx or spkIdx is out of the respective admissible range. |
SampleType visr::panning::LoudspeakerArray::getSubwooferGainAdjustment |
( |
std::size_t |
spkIdx | ) |
const |
|
inline |
Retrieve the gain matrix for panning loudspeaker signals into the subwoofers.
- Returns
- Reference to gain matrix, dimension number of subwoofers * number of physical loudspeakers.
TripletType& visr::panning::LoudspeakerArray::getTriplet |
( |
std::size_t |
iTri | ) |
|
|
inline |
TripletType const& visr::panning::LoudspeakerArray::getTriplet |
( |
std::size_t |
iTri | ) |
const |
|
inline |
bool visr::panning::LoudspeakerArray::is2D |
( |
| ) |
const |
|
inline |
bool visr::panning::LoudspeakerArray::isInfinite |
( |
| ) |
const |
|
inline |
void visr::panning::LoudspeakerArray::loadXmlFile |
( |
std::string const & |
filePath | ) |
|
Initialise the loudspeaker array object from a file containing an array configuration in XML format
- Parameters
-
filePath | Full file path(including path and file extension). |
void visr::panning::LoudspeakerArray::loadXmlStream |
( |
std::istream & |
stream | ) |
|
Initialise the loudspeaker array object from a stream holding the array configuration in XML format.
- Parameters
-
stream | Initialised stream object holding an XML configuration. |
void visr::panning::LoudspeakerArray::loadXmlString |
( |
std::string const & |
xmlString | ) |
|
Initialise the loudspeaker array object from a string containg the array configuration in XML format.
- Parameters
-
xmlString | String containing a XML array configuration as the top-level node. |
Return the loudspeaker id (a string label) corresponding to the given (sorted) loudspeaker label.
- Parameters
-
index | zero-offset index into the loudspeaker array. |
- Exceptions
-
std::out_of_range | If index exceeds the range of regular and virt ual loudspeakers. |
Assignment operator We need an explicitly defined assignment operator because some members (BasicMatrix) intentionally do not have a copy constructor.
Return a matrix containing the biquad parameters for all output sections. The dimension of the matrix is
(numRegularSpeakers()+getNumSubwoofers()) x outputEqualisationNumberOfBiquads()
- Exceptions
-
std::size_t visr::panning::LoudspeakerArray::outputEqualisationNumberOfBiquads |
( |
| ) |
const |
Query the number of biquads per output channel. Returns 0 if no equalisation configuration is present.
bool visr::panning::LoudspeakerArray::outputEqualisationPresent |
( |
| ) |
const |
Optional support for equalization of ouput channels. Query if the array configuration contained an output equalisation configuration. Technically, that means that the XML file contains a outputEqConfiguration section.
std::size_t visr::panning::LoudspeakerArray::setTriplet |
( |
std::size_t |
iTri, |
|
|
std::size_t |
l1, |
|
|
std::size_t |
l2, |
|
|
std::size_t |
l3 |
|
) |
| |
|
inline |
The documentation for this class was generated from the following files: