diff --git a/include/SetupDialog.h b/include/SetupDialog.h index fa0ebde6af6..7aabde08618 100644 --- a/include/SetupDialog.h +++ b/include/SetupDialog.h @@ -75,6 +75,7 @@ private slots: void toggleCompactTrackButtons(bool enabled); void toggleOneInstrumentTrackWindow(bool enabled); void toggleSideBarOnRight(bool enabled); + void toggleSoloLegacyBehavior(bool enabled); void toggleMMPZ(bool enabled); void toggleDisableBackup(bool enabled); void toggleOpenLastProject(bool enabled); @@ -132,6 +133,7 @@ private slots: bool m_compactTrackButtons; bool m_oneInstrumentTrackWindow; bool m_sideBarOnRight; + bool m_soloLegacyBehavior; bool m_MMPZ; bool m_disableBackup; bool m_openLastProject; diff --git a/src/core/Track.cpp b/src/core/Track.cpp index 734cb4e12d9..6505ffabda9 100644 --- a/src/core/Track.cpp +++ b/src/core/Track.cpp @@ -2639,6 +2639,9 @@ void Track::toggleSolo() } const bool solo = m_soloModel.value(); + // Should we use the new behavior of solo or the older/legacy one? + const bool soloLegacyBehavior = ConfigManager::inst()->value("app", "sololegacybehavior", "0").toInt(); + for( TrackContainer::TrackList::const_iterator it = tl.begin(); it != tl.end(); ++it ) { @@ -2649,7 +2652,15 @@ void Track::toggleSolo() { ( *it )->m_mutedBeforeSolo = ( *it )->isMuted(); } - ( *it )->setMuted( *it == this ? false : true ); + // Don't mute AutomationTracks (keep their original state) unless we are on the sololegacybehavior mode + if( *it == this ) + { + ( *it )->setMuted( false ); + } + else if( soloLegacyBehavior || ( *it )->type() != AutomationTrack ) + { + ( *it )->setMuted( true ); + } if( *it != this ) { ( *it )->m_soloModel.setValue( false ); @@ -2657,7 +2668,12 @@ void Track::toggleSolo() } else if( !soloBefore ) { - ( *it )->setMuted( ( *it )->m_mutedBeforeSolo ); + // Unless we are on the sololegacybehavior mode, only restores the + // mute state if the track isn't an Automation Track + if( soloLegacyBehavior || ( *it )->type() != AutomationTrack ) + { + ( *it )->setMuted( ( *it )->m_mutedBeforeSolo ); + } } } } diff --git a/src/gui/SetupDialog.cpp b/src/gui/SetupDialog.cpp index b1d7e5aadb4..e542039c50e 100644 --- a/src/gui/SetupDialog.cpp +++ b/src/gui/SetupDialog.cpp @@ -102,6 +102,8 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : "ui", "oneinstrumenttrackwindow").toInt()), m_sideBarOnRight(ConfigManager::inst()->value( "ui", "sidebaronright").toInt()), + m_soloLegacyBehavior(ConfigManager::inst()->value( + "app", "sololegacybehavior", "0").toInt()), m_MMPZ(!ConfigManager::inst()->value( "app", "nommpz").toInt()), m_disableBackup(!ConfigManager::inst()->value( @@ -233,6 +235,8 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : m_oneInstrumentTrackWindow, SLOT(toggleOneInstrumentTrackWindow(bool)), true); addLedCheckBox("Show sidebar on the right-hand side", gui_tw, counter, m_sideBarOnRight, SLOT(toggleSideBarOnRight(bool)), true); + addLedCheckBox("Mute automation tracks during solo", gui_tw, counter, + m_soloLegacyBehavior, SLOT(toggleSoloLegacyBehavior(bool)), false); gui_tw->setFixedHeight(YDelta + YDelta * counter); @@ -905,6 +909,8 @@ void SetupDialog::accept() QString::number(m_oneInstrumentTrackWindow)); ConfigManager::inst()->setValue("ui", "sidebaronright", QString::number(m_sideBarOnRight)); + ConfigManager::inst()->setValue("app", "sololegacybehavior", + QString::number(m_soloLegacyBehavior)); ConfigManager::inst()->setValue("app", "nommpz", QString::number(!m_MMPZ)); ConfigManager::inst()->setValue("app", "disablebackup", @@ -1041,6 +1047,10 @@ void SetupDialog::setLanguage(int lang) } +void SetupDialog::toggleSoloLegacyBehavior(bool enabled) +{ + m_soloLegacyBehavior = enabled; +} // Performance settings slots.