Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes the behavior of "solo" so it doesn't mute Automation Tracks #5547

Merged
merged 12 commits into from Aug 1, 2020
2 changes: 2 additions & 0 deletions include/SetupDialog.h
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
20 changes: 18 additions & 2 deletions src/core/Track.cpp
Expand Up @@ -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 )
{
Expand All @@ -2649,15 +2652,28 @@ 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 );
}
}
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 );
}
}
}
}
Expand Down
10 changes: 10 additions & 0 deletions src/gui/SetupDialog.cpp
Expand Up @@ -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(
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -1041,6 +1047,10 @@ void SetupDialog::setLanguage(int lang)
}


void SetupDialog::toggleSoloLegacyBehavior(bool enabled)
{
m_soloLegacyBehavior = enabled;
}


// Performance settings slots.
Expand Down