Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

SoftwareMixer Namespace Reference

Various software mixing routines and related utilities. More...


Compounds

class  SoftwareMixer::OutputConvF
class  SoftwareMixer::Shift
class  SoftwareMixer::SignType

Functions

 SHIFT_SPECIALIZER (u_int8_t) SHIFT_SPECIALIZER(u_int16_t) SHIFT_SPECIALIZER(u_int32_t) SHIFT_SPECIALIZER(unsigned long) SHIFT_SPECIALIZER(int8_t) SHIFT_SPECIALIZER(int16_t) SHIFT_SPECIALIZER(int32_t) template<typename In, typename Out, bool ChangeSign> class SignConvT
 If the types In and Out are of different sign then make sure the returned value is signed.

template<typenameIn, typenameOut> Out SignConv (In in)
template<typenameIn, typenameOut, intBits> unsigned long& VolumeConv (unsigned long& volume)
 Scale the volume to the input and output sample size. More...

template<typenameIn, typenameOut, intBits> Out& XConv (Out& out)
 Scale the output. More...

template<typenameIn, typenameOut, intBits> Out OutputConv (In in, const unsigned long& volume)
 Convert the input type to an output type and scale to the volume.

template<typenameIn, typenameOut, intBits> Out OutputConv2 (In in, const unsigned long& volume)
 Same as OutputConv but with SignConv and XConv manually inlined.

template<typenameIn, typenameF> In Interpolate (In* in, const F& fractional)
 A convenient way to implement linear interpolation.

template<typenameIn, typenameOut, intBits> void MixStereoInterpolated (unsigned long length, unsigned long left, unsigned long right, const Fixed& scale, Fixed& position, const In* const in, Out* out)
 Mix a mono input buffer to a stereo output buffer using interpolation. More...

template<typenameIn, typenameOut, intBits> void MixStereoInterpolatedUnrolled (unsigned long length, unsigned long left, unsigned long right, const Fixed& scale, Fixed& position, const In* const in, Out* out)
 Mix a mono input buffer to a stereo output buffer using interpolation. More...

template<typenameIn, typenameOut, intBits> void MixStereo (unsigned long length, unsigned long left, unsigned long right, const Fixed& scale, Fixed& position, const In* const in, Out* out)
 Mix a mono input buffer to a stereo output buffer. More...

template<typenameIn, typenameOut, intBits> void MixStereoUnrolled (unsigned long length, unsigned long left, unsigned long right, const Fixed& scale, Fixed& position, const In* const in, Out* out)
 Mix a mono input buffer to a stereo output buffer. More...

template<typenameIn, typenameOut, intBits> void MixStereoToStereoDuff (unsigned long length, unsigned long left, unsigned long right, const Fixed& scale, Fixed& position, const In* const in, Out* out)
template<typenameIn, typenameOut, intBits> void MixStereoDuff (unsigned long length, unsigned long left, unsigned long right, const Fixed& scale, Fixed& position, const In* const in, Out* out)
template<typenameIn, typenameOut, intBits> void MixStereoDuff (unsigned long length, unsigned long left, unsigned long right, const Fixed& scale, Fixed& position, const In* const in, Out* out, Filters::SimpleFilter<In>& opl, Filters::SimpleFilter<In>& opr)
 A mixer that lets you insert a filter between the input and the output.

template<typenameIn, typenameOut, intBits> void MixMono (unsigned long length, unsigned long volume, const Fixed& scale, Fixed& position, const In* const in, Out* out)
 Mix a mono input buffer to a mono output buffer. More...


Detailed Description

Various software mixing routines and related utilities.


Function Documentation

template<typenameIn, typenameOut, intBits>
void SoftwareMixer::MixMono ( unsigned long length,
unsigned long volume,
const Fixed & scale,
Fixed & position,
const In *const in,
Out * out ) [inline]
 

Mix a mono input buffer to a mono output buffer.

Parameters:
In   The type used for the input samples.
Out   The type used for the output samples.
Bits   The number of bits used for the volume and the channels.
length   The size of the input buffer "in".
volume   The volume of the left channel.
scale   This is used to scale the pitch.
position   The current location in the input buffer "in".
in   A buffer of input samples.
out   A buffer for output samples.

template<typenameIn, typenameOut, intBits>
void SoftwareMixer::MixStereo ( unsigned long length,
unsigned long left,
unsigned long right,
const Fixed & scale,
Fixed & position,
const In *const in,
Out * out ) [inline]
 

Mix a mono input buffer to a stereo output buffer.

Parameters:
In   The type used for the input samples.
Out   The type used for the output samples.
Bits   The number of bits used for the volume and the channels.
length   The number of samples to mix to the output buffer (left/right stereo samples are counted as one).
left   The volume of the left channel.
right   The volume of the right channel.
scale   This is used to scale the pitch.
position   The current location in the input buffer "in".
in   A buffer of input samples.
out   A buffer for output samples.

template<typenameIn, typenameOut, intBits>
void SoftwareMixer::MixStereoInterpolated ( unsigned long length,
unsigned long left,
unsigned long right,
const Fixed & scale,
Fixed & position,
const In *const in,
Out * out ) [inline]
 

Mix a mono input buffer to a stereo output buffer using interpolation.

Parameters:
In   The type used for the input samples.
Out   The type used for the output samples.
Bits   The number of bits used for the volume and the channels.
length   The size of the input buffer "in".
left   The volume of the left channel.
right   The volume of the right channel.
scale   This is used to scale the pitch.
position   The current location in the input buffer "in".
in   A buffer of input samples.
out   A buffer for output samples.

template<typenameIn, typenameOut, intBits>
void SoftwareMixer::MixStereoInterpolatedUnrolled ( unsigned long length,
unsigned long left,
unsigned long right,
const Fixed & scale,
Fixed & position,
const In *const in,
Out * out ) [inline]
 

Mix a mono input buffer to a stereo output buffer using interpolation.

This time the mixer has been unrolled to improve efficiency.

Parameters:
In   The type used for the input samples.
Out   The type used for the output samples.
Bits   The number of bits used for the volume and the channels.
length   The size of the input buffer "in".
left   The volume of the left channel.
right   The volume of the right channel.
scale   This is used to scale the pitch.
position   The current location in the input buffer "in".
in   A buffer of input samples.
out   A buffer for output samples.

template<typenameIn, typenameOut, intBits>
void SoftwareMixer::MixStereoUnrolled ( unsigned long length,
unsigned long left,
unsigned long right,
const Fixed & scale,
Fixed & position,
const In *const in,
Out * out )
 

Mix a mono input buffer to a stereo output buffer.

Parameters:
In   The type used for the input samples.
Out   The type used for the output samples.
Bits   The number of bits used for the volume and the channels.
length   The size of the input buffer "in".
left   The volume of the left channel.
right   The volume of the right channel.
scale   This is used to scale the pitch.
position   The current location in the input buffer "in".
in   A buffer of input samples.
out   A buffer for output samples.

template<typenameIn, typenameOut, intBits>
Out & SoftwareMixer::XConv ( Out & out ) [inline]
 

Scale the output.

Make sure it uses the full set of bits and multiply it by a bit to make it louder 16 channels -- can accomodate more than 16 since not all channels will be at there maximum

Parameters:
Bits   The number of bits used for channel and volume.


Generated at Mon Nov 27 01:47:22 2000 for LibPenguinPlay by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000