Audacity 3.2.0
Functions
anonymous_namespace{Mix.cpp} Namespace Reference

Functions

template<typename T , typename F >
std::vector< T > initVector (size_t dim1, const F &f)
 
template<typename T >
std::vector< std::vector< T > > initVector (size_t dim1, size_t dim2)
 
size_t FindBufferSize (const Mixer::Inputs &inputs, size_t bufferSize)
 

Function Documentation

◆ FindBufferSize()

size_t anonymous_namespace{Mix.cpp}::FindBufferSize ( const Mixer::Inputs inputs,
size_t  bufferSize 
)

Definition at line 48 of file Mix.cpp.

49{
50 size_t blockSize = bufferSize;
51 for (const auto &input : inputs) {
52 const auto sequence = input.pSequence.get();
53 const auto nInChannels = sequence->NChannels();
54 if (!sequence) {
55 assert(false);
56 break;
57 }
58 for (const auto &stage : input.stages) {
59 // Need an instance to query acceptable block size
60 const auto pInstance = stage.factory();
61 if (pInstance)
62 blockSize = std::min(blockSize, pInstance->SetBlockSize(blockSize));
63 // Cache the first factory call
64 stage.mpFirstInstance = move(pInstance);
65 }
66 }
67 return blockSize;
68}
int min(int a, int b)

References min().

Here is the call graph for this function:

◆ initVector() [1/2]

template<typename T , typename F >
std::vector< T > anonymous_namespace{Mix.cpp}::initVector ( size_t  dim1,
const F &  f 
)

Definition at line 30 of file Mix.cpp.

31{
32 std::vector<T> result( dim1 );
33 for (auto &row : result)
34 f(row);
35 return result;
36}

◆ initVector() [2/2]

template<typename T >
std::vector< std::vector< T > > anonymous_namespace{Mix.cpp}::initVector ( size_t  dim1,
size_t  dim2 
)

Definition at line 39 of file Mix.cpp.

40{
41 return initVector<std::vector<T>>(dim1,
42 [dim2](auto &row){ row.resize(dim2); });
43}