20: envelope(
DefaultWarp::Call(list)), minSpeed(0.0), maxSpeed(0.0)
25 : envelope(e), minSpeed(0.0), maxSpeed(0.0)
30 , maxSpeed{
std::max(0.0,
std::max(
min, max)) }
31 , initialSpeed{initial}
40) : mHighQuality{ highQuality }
42 auto range = TrackList::Channels<const SampleTrack>(&leader);
43 auto size = range.size();
46 for (
auto pTrack : range) {
47 double factor = (rate / pTrack->GetRate());
48 if (
const auto envelope = options.
envelope) {
51 mMinFactor.push_back(factor / envelope->GetRangeUpper());
52 mMaxFactor.push_back(factor / envelope->GetRangeLower());
71 mNumTracks = mNumChannels = numTracks;
72 mMaxNumChannels = maxNumChannels;
74 if( mNumChannels > mMaxNumChannels )
75 mNumChannels = mMaxNumChannels;
79 for(
unsigned int i = 0; i < mNumTracks; i++ )
80 for(
unsigned int j = 0; j < mNumChannels; j++ )
81 mMap[ i ][ j ] = ( i == j );
92 for(
unsigned int i = 0; i < mNumTracks; i++ )
93 for(
unsigned int j = 0; j < mNumChannels; j++ )
94 mMap[ i ][ j ] = mixerSpec.
mMap[ i ][ j ];
99 mMap.reinit(mNumTracks, mMaxNumChannels);
108 if( mNumChannels == newNumChannels )
111 if( newNumChannels > mMaxNumChannels )
114 for(
unsigned int i = 0; i < mNumTracks; i++ )
116 for(
unsigned int j = newNumChannels; j < mNumChannels; j++ )
117 mMap[ i ][ j ] =
false;
119 for(
unsigned int j = mNumChannels; j < newNumChannels; j++ )
120 mMap[ i ][ j ] =
false;
123 mNumChannels = newNumChannels;
130 mNumChannels = mixerSpec.mNumChannels;
131 mMaxNumChannels = mixerSpec.mMaxNumChannels;
135 for(
unsigned int i = 0; i < mNumTracks; i++ )
136 for(
unsigned int j = 0; j < mNumChannels; j++ )
137 mMap[ i ][ j ] = mixerSpec.mMap[ i ][ j ];
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)
A flat linked list of tracks supporting Add, Remove, Clear, and Contains, serialization of the list o...
std::vector< double > mMaxFactor
ResampleParameters(bool highQuality, const SampleTrack &leader, double rate, const Warp &options)
std::vector< double > mMinFactor
Hook function for default time warp.
Immutable structure is an argument to Mixer's constructor.
const BoundedEnvelope *const envelope
Warp(const TrackList &list)
Construct using the default warp function.