From deb5d5c33fdca41a3a01f0d554ab5300a07e9256 Mon Sep 17 00:00:00 2001 From: IanCaio Date: Fri, 26 Jun 2020 22:21:05 -0300 Subject: [PATCH] Stop restoring Automation Track's mute values - Since Automation Tracks are not affected by enabling solo on other tracks, there's no need (and it's even counter intuitive) to restore their previous mute value. - Reduces a line by using "else if". --- src/core/Track.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/core/Track.cpp b/src/core/Track.cpp index 6c47c4349..5c44914fe 100644 --- a/src/core/Track.cpp +++ b/src/core/Track.cpp @@ -2656,10 +2656,8 @@ void Track::toggleSolo() // Don't mute AutomationTracks (keep their original state) if( *it == this ){ ( *it )->setMuted( false ); - } else { - if( ( *it )->type() != AutomationTrack ){ - ( *it )->setMuted( true ); - } + } else if( ( *it )->type() != AutomationTrack ){ + ( *it )->setMuted( true ); } if( *it != this ) { @@ -2668,7 +2666,10 @@ void Track::toggleSolo() } else if( !soloBefore ) { - ( *it )->setMuted( ( *it )->m_mutedBeforeSolo ); + // Only restores the mute state if the track isn't an Automation Track + if( ( *it )->type() != AutomationTrack ){ + ( *it )->setMuted( ( *it )->m_mutedBeforeSolo ); + } } } }