MCPcopy Create free account
hub / github.com/audacity/audacity / CreateMixer

Method CreateMixer

libraries/lib-import-export/ExportPluginHelpers.cpp:23–46  ·  view source on GitHub ↗

Create a mixer by computing the time warp factor

Source from the content-addressed store, hash-verified

21
22//Create a mixer by computing the time warp factor
23std::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
48namespace
49{

Callers

nothing calls this directly

Calls 7

GetFunction · 0.85
CreateFunction · 0.85
GetEffectStagesFunction · 0.85
GetMasterEffectStagesFunction · 0.85
moveFunction · 0.85
GetClipInterfacesMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected