1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-25 08:58:06 +02:00

Bug 1799 - Un-muting with a single track unnecessarily activates the Solo button

This commit is contained in:
James Crook 2017-12-17 16:49:35 +00:00
parent 1e07ef9727
commit 4da9e41e03

View File

@ -5566,12 +5566,15 @@ void AudacityProject::HandleTrackMute(Track *t, const bool exclusive)
TrackListIterator iter(GetTracks());
Track *i = iter.First();
int nPlaying=0;
int nPlayableTracks =0;
// We also set a solo indicator if we have just one track / stereo pair playing.
// in a group of more than one playable tracks.
// otherwise clear solo on everything.
while (i) {
auto pi = dynamic_cast<PlayableTrack *>( i );
if (pi) {
nPlayableTracks++;
if( !pi->GetMute())
{
nPlaying += 1;
@ -5586,7 +5589,7 @@ void AudacityProject::HandleTrackMute(Track *t, const bool exclusive)
while (i) {
auto pi = dynamic_cast<PlayableTrack *>( i );
if (pi)
pi->SetSolo( (nPlaying==1) && !pi->GetMute() ); // will set both of a stereo pair
pi->SetSolo( (nPlaying==1) && (nPlayableTracks > 1 ) && !pi->GetMute() ); // will set both of a stereo pair
i = iter.Next();
}
}