linuxsampler 2.3.1
|
Audio Channel (always mono) More...
#include <AudioChannel.h>
Classes | |
class | ParameterIsMixChannel |
class | ParameterMixChannelDestination |
class | ParameterName |
Public Member Functions | |
float * | Buffer () |
Audio signal buffer. | |
void | SetBuffer (float *pBuffer) |
AudioChannel * | MixChannel () |
In case this channel is a mix channel, then it will return a pointer to the real channel this channel refers to, NULL otherwise. | |
void | Clear () |
Reset audio buffer with silence. | |
void | Clear (uint Samples) |
Reset audio buffer with silence. | |
void | CopyTo (AudioChannel *pDst, const uint Samples) |
Copies audio data (unmodified) from this AudioChannel to the given destination AudioChannel. | |
void | CopyTo (AudioChannel *pDst, const uint Samples, const float fLevel) |
Copies audio data from this AudioChannel to the given destination AudioChannel and applies the given volume coefficient to the destination audio signal. | |
void | MixTo (AudioChannel *pDst, const uint Samples) |
Copies audio data (unmodified) from this AudioChannel and mixes it to the given destination AudioChannel. | |
void | MixTo (AudioChannel *pDst, const uint Samples, const float fLevel) |
Copies audio data from this AudioChannel, applies the given volume coefficient to the audio signal and mixes it to the given destination channel. | |
std::map< String, DeviceRuntimeParameter * > | ChannelParameters () |
AudioChannel (uint ChannelNr, uint BufferSize) | |
Create real channel. | |
AudioChannel (uint ChannelNr, float *pBuffer, uint BufferSize) | |
Create channel with external (already existing) audio buffer. | |
AudioChannel (uint ChannelNr, AudioChannel *pMixChannelDestination) | |
Create mix channel. | |
virtual | ~AudioChannel () |
Destructor. | |
Protected Attributes | |
uint | ChannelNr |
std::map< String, DeviceRuntimeParameter * > | Parameters |
Audio Channel (always mono)
This class is used for routing audio signals between arbitrary sources and destinations. You can either create a normal channel like:
Or you can create a mix channel, e.g. the following would create a normal channel first, and the second channel is just a copy of the first channel:
So in the last example, when writing to 'mix_chan' the signal will actually be mixed to the 'mono_chan' channel, so this is an easy way to downmix a signal source which has more audio channels than the signal destination can offer.
Definition at line 56 of file AudioChannel.h.
Create real channel.
ChannelNr | - channel number of this new channel |
BufferSize | - desired audio data buffer size |
Definition at line 44 of file AudioChannel.cpp.
References LinuxSampler::Thread::allocAlignedMem(), ChannelNr, Clear(), and Parameters.
Create channel with external (already existing) audio buffer.
ChannelNr | - channel number of this new channel |
pBuffer | - external audio buffer |
BufferSize | - size of the external buffer |
Definition at line 64 of file AudioChannel.cpp.
References ChannelNr, Clear(), and Parameters.
LinuxSampler::AudioChannel::AudioChannel | ( | uint | ChannelNr, |
AudioChannel * | pMixChannelDestination | ||
) |
Create mix channel.
ChannelNr | - channel number of this new channel |
pMixChannelDestination | - a real audio channel this new mix channel refers to |
Definition at line 84 of file AudioChannel.cpp.
References ChannelNr, Clear(), and Parameters.
|
virtual |
Destructor.
Definition at line 101 of file AudioChannel.cpp.
References LinuxSampler::Thread::freeAlignedMem(), and Parameters.
|
inline |
std::map< String, DeviceRuntimeParameter * > LinuxSampler::AudioChannel::ChannelParameters | ( | ) |
Definition at line 232 of file AudioChannel.cpp.
References Parameters.
|
inline |
Reset audio buffer with silence.
Definition at line 93 of file AudioChannel.h.
Referenced by AudioChannel(), AudioChannel(), and AudioChannel().
Reset audio buffer with silence.
Definition at line 94 of file AudioChannel.h.
void LinuxSampler::AudioChannel::CopyTo | ( | AudioChannel * | pDst, |
const uint | Samples | ||
) |
Copies audio data (unmodified) from this AudioChannel to the given destination AudioChannel.
Caution: This method will overwrite the content in the destination channel buffer.
pDst | - destination channel |
Samples | - amount of sample points to be copied |
Definition at line 117 of file AudioChannel.cpp.
References Buffer().
Referenced by CopyTo().
void LinuxSampler::AudioChannel::CopyTo | ( | AudioChannel * | pDst, |
const uint | Samples, | ||
const float | fLevel | ||
) |
Copies audio data from this AudioChannel to the given destination AudioChannel and applies the given volume coefficient to the destination audio signal.
Caution: This method will overwrite the content in the destination channel buffer.
pDst | - destination channel |
Samples | - amount of sample points to be copied |
fLevel | - volume coefficient to be applied |
Definition at line 133 of file AudioChannel.cpp.
|
inline |
In case this channel is a mix channel, then it will return a pointer to the real channel this channel refers to, NULL otherwise.
Definition at line 92 of file AudioChannel.h.
void LinuxSampler::AudioChannel::MixTo | ( | AudioChannel * | pDst, |
const uint | Samples | ||
) |
Copies audio data (unmodified) from this AudioChannel and mixes it to the given destination AudioChannel.
pDst | - destination channel |
Samples | - amount of sample points to be mixed over |
Definition at line 169 of file AudioChannel.cpp.
References Buffer().
Referenced by MixTo().
void LinuxSampler::AudioChannel::MixTo | ( | AudioChannel * | pDst, |
const uint | Samples, | ||
const float | fLevel | ||
) |
Copies audio data from this AudioChannel, applies the given volume coefficient to the audio signal and mixes it to the given destination channel.
pDst | - destination channel |
Samples | - amount of sample points to be mixed over |
fLevel | - volume coefficient to be applied |
Definition at line 203 of file AudioChannel.cpp.
Definition at line 91 of file AudioChannel.h.
|
protected |
Definition at line 107 of file AudioChannel.h.
Referenced by AudioChannel(), AudioChannel(), and AudioChannel().
|
protected |
Definition at line 108 of file AudioChannel.h.
Referenced by AudioChannel(), AudioChannel(), AudioChannel(), ChannelParameters(), and ~AudioChannel().