Audacity 3.2.0
Namespaces | Macros | Functions
Mix.cpp File Reference
#include "Mix.h"
#include "MixerSource.h"
#include <cmath>
#include "EffectStage.h"
#include "Dither.h"
#include "Resample.h"
#include "WideSampleSequence.h"
#include "float_cast.h"
#include <numeric>
Include dependency graph for Mix.cpp:

Go to the source code of this file.

Namespaces

namespace  anonymous_namespace{Mix.cpp}
 

Macros

#define stackAllocate(T, count)   static_cast<T*>(alloca(count * sizeof(T)))
 

Functions

template<typename T , typename F >
std::vector< T > anonymous_namespace{Mix.cpp}::initVector (size_t dim1, const F &f)
 
template<typename T >
std::vector< std::vector< T > > anonymous_namespace{Mix.cpp}::initVector (size_t dim1, size_t dim2)
 
size_t anonymous_namespace{Mix.cpp}::FindBufferSize (const Mixer::Inputs &inputs, size_t bufferSize)
 
static void MixBuffers (unsigned numChannels, const unsigned char *channelFlags, const float *gains, const float &src, std::vector< std::vector< float > > &dests, int len)
 

Macro Definition Documentation

◆ stackAllocate

#define stackAllocate (   T,
  count 
)    static_cast<T*>(alloca(count * sizeof(T)))

Definition at line 269 of file Mix.cpp.

Function Documentation

◆ MixBuffers()

static void MixBuffers ( unsigned  numChannels,
const unsigned char *  channelFlags,
const float *  gains,
const float &  src,
std::vector< std::vector< float > > &  dests,
int  len 
)
static

Definition at line 256 of file Mix.cpp.

259{
260 const auto pSrc = &src;
261 for (unsigned int c = 0; c < numChannels; c++) {
262 if (!channelFlags[c])
263 continue;
264 for (int j = 0; j < len; ++j)
265 dests[c][j] += pSrc[j] * gains[c]; // the actual mixing process
266 }
267}

Referenced by Mixer::Process().

Here is the caller graph for this function: