linuxsampler 1.0.0

LinuxSampler::AudioChannel Class Reference

Audio Channel (always mono) More...

#include <AudioChannel.h>

List of all members.

Classes

class  ParameterIsMixChannel
class  ParameterMixChannelDestination
class  ParameterName

Public Member Functions

float * Buffer ()
 Audio signal buffer.
void SetBuffer (float *pBuffer)
AudioChannelMixChannel ()
 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

Detailed Description

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:

        AudioChannel c1(512); // create unnamed channel
        AudioChannel c2(512, "Effect send mono channel"); // create named channel

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:

        AudioChannel mono_chan(512, "Effect send channel"); // real channel
        AudioChannel mix_chan(&mono_chan, "Effect send mono channel"); // mix 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.


Constructor & Destructor Documentation

usr src packages BUILD linuxsampler src drivers audio AudioChannel cpp usr src packages BUILD linuxsampler src drivers audio AudioChannel cpp LinuxSampler::AudioChannel::AudioChannel ( uint  ChannelNr,
uint  BufferSize 
)

Create real channel.

Parameters:
ChannelNr- channel number of this new channel
BufferSize- desired audio data buffer size

Definition at line 46 of file AudioChannel.cpp.

LinuxSampler::AudioChannel::AudioChannel ( uint  ChannelNr,
float *  pBuffer,
uint  BufferSize 
)

Create channel with external (already existing) audio buffer.

Parameters:
ChannelNr- channel number of this new channel
pBuffer- external audio buffer
BufferSize- size of the external buffer

Definition at line 66 of file AudioChannel.cpp.

LinuxSampler::AudioChannel::AudioChannel ( uint  ChannelNr,
AudioChannel pMixChannelDestination 
)

Create mix channel.

Parameters:
ChannelNr- channel number of this new channel
pMixChannelDestination- a real audio channel this new mix channel refers to

Definition at line 86 of file AudioChannel.cpp.

LinuxSampler::AudioChannel::~AudioChannel ( ) [virtual]

Destructor.

Definition at line 103 of file AudioChannel.cpp.


Member Function Documentation

float* LinuxSampler::AudioChannel::Buffer ( ) [inline]

Audio signal buffer.

Definition at line 90 of file AudioChannel.h.

Referenced by CopyTo(), and MixTo().

std::map< String, DeviceRuntimeParameter * > LinuxSampler::AudioChannel::ChannelParameters ( )

Definition at line 216 of file AudioChannel.cpp.

void LinuxSampler::AudioChannel::Clear ( uint  Samples) [inline]

Reset audio buffer with silence.

Definition at line 94 of file AudioChannel.h.

void LinuxSampler::AudioChannel::Clear ( ) [inline]

Reset audio buffer with silence.

Definition at line 93 of file AudioChannel.h.

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.

Parameters:
pDst- destination channel
Samples- amount of sample points to be copied
fLevel- volume coefficient to be applied

Definition at line 135 of file AudioChannel.cpp.

References Buffer().

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.

Parameters:
pDst- destination channel
Samples- amount of sample points to be copied

Definition at line 119 of file AudioChannel.cpp.

AudioChannel* LinuxSampler::AudioChannel::MixChannel ( ) [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.

Parameters:
pDst- destination channel
Samples- amount of sample points to be mixed over

Definition at line 165 of file AudioChannel.cpp.

References Buffer().

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.

Parameters:
pDst- destination channel
Samples- amount of sample points to be mixed over
fLevel- volume coefficient to be applied

Definition at line 193 of file AudioChannel.cpp.

References Buffer().

void LinuxSampler::AudioChannel::SetBuffer ( float *  pBuffer) [inline]

Definition at line 91 of file AudioChannel.h.


Member Data Documentation

Definition at line 107 of file AudioChannel.h.

Definition at line 108 of file AudioChannel.h.


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