Skip to content

Commit 547d3d0

Browse files
Merge pull request #29237 from RomanPudashkin/restore_solo_mute_state
Fix #27058: Mute settings are broken in parts whose instruments were deleted and then restored with Undo
2 parents 158458d + 8200770 commit 547d3d0

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/notation/internal/masternotation.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,8 @@ void MasterNotation::updateExcerpts()
700700
excerptNotation->notation()->elements()->msScore()->doLayout();
701701
}
702702

703+
initNotationSoloMuteState(excerptNotation->notation());
704+
703705
updatedExcerpts.push_back(excerptNotation);
704706
}
705707

src/playback/internal/playbackcontroller.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1272,7 +1272,11 @@ void PlaybackController::onTrackNewlyAdded(const InstrumentTrackId& instrumentTr
12721272
if (notation == m_notation || notation->soloMuteState()->trackSoloMuteStateExists(instrumentTrackId)) {
12731273
continue;
12741274
}
1275-
const INotationSoloMuteState::SoloMuteState soloMuteState = { /*mute*/ true, /*solo*/ false };
1275+
1276+
const Part* part = notation->parts()->part(instrumentTrackId.partId);
1277+
const bool shouldMute = !part || !part->show();
1278+
1279+
const INotationSoloMuteState::SoloMuteState soloMuteState = { shouldMute, /*solo*/ false };
12761280
notation->soloMuteState()->setTrackSoloMuteState(instrumentTrackId, soloMuteState);
12771281
}
12781282
}

0 commit comments

Comments
 (0)