Audacity 3.2.0
Namespaces | Macros | Functions
Mix.cpp File Reference
#include "Mix.h"
#include "MixerSource.h"
#include <cmath>
#include "EffectStage.h"
#include "SampleTrack.h"
#include "SampleTrackCache.h"
#include "Resample.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 193 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 178 of file Mix.cpp.

181{
182 const auto pSrc = &src;
183 for (unsigned int c = 0; c < numChannels; c++) {
184 if (!channelFlags[c])
185 continue;
186 float *dest = dests[c].data();
187 float gain = gains[c];
188 for (int j = 0; j < len; ++j)
189 *dest++ += pSrc[j] * gain; // the actual mixing process
190 }
191}

Referenced by Mixer::Process().

Here is the caller graph for this function: