Audaspace 1.5.0
A high level audio library.
|
This class maps a sound source's channels to a specific output channel count. More...
#include <ChannelMapperReader.h>
Public Member Functions | |
ChannelMapperReader (std::shared_ptr< IReader > reader, Channels channels) | |
Creates a channel mapper reader. | |
~ChannelMapperReader () | |
Destroys the reader. | |
Channels | getSourceChannels () const |
Returns the channel configuration of the source reader. | |
Channels | getChannels () const |
Returns the target channel configuration. | |
void | setChannels (Channels channels) |
Sets the requested channel output count. | |
float | getMapping (int source, int target) |
Returns the mapping of the source channel to the target channel. | |
void | setMonoAngle (float angle) |
Sets the angle for mono sources. | |
virtual Specs | getSpecs () const |
Returns the specification of the reader. | |
virtual void | read (int &length, bool &eos, sample_t *buffer) |
Request to read the next length samples out of the source. | |
Public Member Functions inherited from EffectReader | |
EffectReader (std::shared_ptr< IReader > reader) | |
Creates a new effect reader. | |
virtual | ~EffectReader () |
Destroys the reader. | |
virtual bool | isSeekable () const |
Tells whether the source provides seeking functionality or not. | |
virtual void | seek (int position) |
Seeks to a specific position in the source. | |
virtual int | getLength () const |
Returns an approximated length of the source in samples. | |
virtual int | getPosition () const |
Returns the position of the source as a sample count value. | |
Public Member Functions inherited from IReader | |
virtual | ~IReader () |
Destroys the reader. | |
Additional Inherited Members | |
Protected Attributes inherited from EffectReader | |
std::shared_ptr< IReader > | m_reader |
The reader to read from. | |
This class maps a sound source's channels to a specific output channel count.
Creates a channel mapper reader.
reader | The reader to map. |
channels | The target channel count this reader should map to. |
Channels ChannelMapperReader::getChannels | ( | ) | const |
Returns the target channel configuration.
Equals getSpecs().channels.
float ChannelMapperReader::getMapping | ( | int | source, |
int | target ) |
Returns the mapping of the source channel to the target channel.
source | The number of the source channel. Should be in the range [0, source channels). |
target | The number of the target channel. Should be in the range [0, target channels). |
Channels ChannelMapperReader::getSourceChannels | ( | ) | const |
Returns the channel configuration of the source reader.
|
virtual |
Returns the specification of the reader.
Reimplemented from EffectReader.
|
virtual |
Request to read the next length samples out of the source.
The buffer supplied has the needed size.
[in,out] | length | The count of samples that should be read. Shall contain the real count of samples after reading, in case there were only fewer samples available. A smaller value also indicates the end of the reader. |
[out] | eos | End of stream, whether the end is reached or not. |
[in] | buffer | The pointer to the buffer to read into. |
Reimplemented from EffectReader.
void ChannelMapperReader::setChannels | ( | Channels | channels | ) |
Sets the requested channel output count.
channels | The channel output count. |
void ChannelMapperReader::setMonoAngle | ( | float | angle | ) |
Sets the angle for mono sources.
angle | The angle for mono sources. |