1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-02 00:29:41 +02:00

Fix uses of TrackList::GroupChannels in Mix and effect preview

This commit is contained in:
Paul Licameli 2018-10-04 11:34:14 -04:00
parent df1103822e
commit 90e2da7f14
2 changed files with 7 additions and 4 deletions

View File

@ -7822,7 +7822,6 @@ void MenuCommandHandler::HandleMixAndRender
WaveTrack::Holder uNewLeft, uNewRight;
::MixAndRender(
tracks, trackFactory, rate, defaultFormat, 0.0, 0.0, uNewLeft, uNewRight);
tracks->GroupChannels(*uNewLeft, uNewRight ? 2 : 1);
if (uNewLeft) {
// Remove originals, get stats on what tracks were mixed
@ -7845,6 +7844,9 @@ void MenuCommandHandler::HandleMixAndRender
if (uNewRight)
pNewRight = tracks->Add(std::move(uNewRight));
// Do this only after adding tracks to the list
tracks->GroupChannels(*pNewLeft, pNewRight ? 2 : 1);
// If we're just rendering (not mixing), keep the track name the same
if (selectedCount==1) {
pNewLeft->SetName(firstName);

View File

@ -2537,13 +2537,14 @@ void Effect::Preview(bool dryOnly)
mixLeft->Offset(-mixLeft->GetStartTime());
mixLeft->SetSelected(true);
mixLeft->SetDisplay(WaveTrack::NoDisplay);
mTracks->Add(std::move(mixLeft));
auto pLeft = mTracks->Add(std::move(mixLeft));
Track *pRight{};
if (mixRight) {
mixRight->Offset(-mixRight->GetStartTime());
mixRight->SetSelected(true);
mTracks->Add(std::move(mixRight));
pRight = mTracks->Add(std::move(mixRight));
}
mTracks->GroupChannels(*mixLeft, mixRight ? 2 : 1);
mTracks->GroupChannels(*pLeft, pRight ? 2 : 1);
}
else {
for (auto src : saveTracks->Any< const WaveTrack >()) {