19: envelope(
DefaultWarp::Call(pProject)), minSpeed(0.0), maxSpeed(0.0)
24 : envelope(e), minSpeed(0.0), maxSpeed(0.0)
29 , maxSpeed{
std::max(0.0,
std::max(
min, max)) }
30 , initialSpeed{initial}
38 double inRate,
double outRate,
const Warp &options
39) : mHighQuality{ highQuality }
41 double factor = (outRate / inRate);
42 if (
const auto envelope = options.
envelope) {
45 mMinFactor = factor / envelope->GetRangeUpper();
46 mMaxFactor = factor / envelope->GetRangeLower();
64 mNumTracks = mNumChannels = numTracks;
65 mMaxNumChannels = maxNumChannels;
67 if( mNumChannels > mMaxNumChannels )
68 mNumChannels = mMaxNumChannels;
72 for(
unsigned int i = 0; i < mNumTracks; i++ )
73 for(
unsigned int j = 0; j < mNumChannels; j++ )
74 mMap[ i ][ j ] = ( i == j );
85 for(
unsigned int i = 0; i < mNumTracks; i++ )
86 for(
unsigned int j = 0; j < mNumChannels; j++ )
87 mMap[ i ][ j ] = mixerSpec.
mMap[ i ][ j ];
91 : mMaxNumChannels(mixerSpec.mMaxNumChannels)
92 , mNumChannels(mixerSpec.mNumChannels)
94 mNumTracks =
static_cast<unsigned>(std::count(tracksMask.begin(), tracksMask.end(),
true));
96 unsigned int dstTrackIndex = 0;
97 for(
unsigned int srcTrackIndex = 0; srcTrackIndex < tracksMask.size(); srcTrackIndex++ )
99 if(!tracksMask[srcTrackIndex])
103 mMap[ dstTrackIndex ][ j ] = mixerSpec.
mMap[ srcTrackIndex ][ j ] ;
111 mMap.reinit(mNumTracks, mMaxNumChannels);
120 if( mNumChannels == newNumChannels )
123 if( newNumChannels > mMaxNumChannels )
126 for(
unsigned int i = 0; i < mNumTracks; i++ )
128 for(
unsigned int j = newNumChannels; j < mNumChannels; j++ )
129 mMap[ i ][ j ] =
false;
131 for(
unsigned int j = mNumChannels; j < newNumChannels; j++ )
132 mMap[ i ][ j ] =
false;
135 mNumChannels = newNumChannels;
142 mNumChannels = mixerSpec.mNumChannels;
143 mMaxNumChannels = mixerSpec.mMaxNumChannels;
147 for(
unsigned int i = 0; i < mNumTracks; i++ )
148 for(
unsigned int j = 0; j < mNumChannels; j++ )
149 mMap[ i ][ j ] = mixerSpec.mMap[ i ][ j ];
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
A matrix of booleans, one row per input channel, column per output.
bool SetNumChannels(unsigned numChannels)
Downmix(unsigned numTracks, unsigned maxNumChannels)
Downmix & operator=(const Downmix &mixerSpec)
ResampleParameters(bool highQuality, double inRate, double outRate, const Warp &options)
Hook function for default time warp.
Immutable structure is an argument to Mixer's constructor.
const BoundedEnvelope *const envelope
Warp(const AudacityProject *pProject)
Construct using the default warp function.