Create a mixer by computing the time warp factor
| 21 | |
| 22 | //Create a mixer by computing the time warp factor |
| 23 | std::unique_ptr<Mixer> ExportPluginHelpers::CreateMixer( |
| 24 | const AudacityProject& project, bool selectionOnly, double startTime, |
| 25 | double stopTime, unsigned numOutChannels, size_t outBufferSize, |
| 26 | bool outInterleaved, double outRate, sampleFormat outFormat, |
| 27 | MixerOptions::Downmix* mixerSpec) |
| 28 | { |
| 29 | Mixer::Inputs inputs; |
| 30 | const auto& tracks = TrackList::Get(project); |
| 31 | for (auto pTrack: ExportUtils::FindExportWaveTracks(tracks, selectionOnly)) |
| 32 | inputs.emplace_back( |
| 33 | StretchingSequence::Create(*pTrack, pTrack->GetClipInterfaces()), |
| 34 | GetEffectStages(*pTrack)); |
| 35 | auto masterEffectStages = GetMasterEffectStages(project); |
| 36 | //custom channel mapping isn't support with master effects on |
| 37 | assert(masterEffectStages.empty() || (numOutChannels <= 2 && mixerSpec == nullptr)); |
| 38 | // MB: the stop time should not be warped, this was a bug. |
| 39 | return std::make_unique<Mixer>( |
| 40 | std::move(inputs), std::move(masterEffectStages), |
| 41 | // Throw, to stop exporting, if read fails: |
| 42 | true, Mixer::WarpOptions { tracks.GetOwner() }, startTime, stopTime, |
| 43 | numOutChannels, outBufferSize, outInterleaved, outRate, outFormat, true, |
| 44 | mixerSpec, |
| 45 | mixerSpec ? Mixer::ApplyVolume::MapChannels : Mixer::ApplyVolume::Mixdown); |
| 46 | } |
| 47 | |
| 48 | namespace |
| 49 | { |
nothing calls this directly
no test coverage detected