Skip to content

Commit

Permalink
Fix bug from issue 5562 (LMMS#5565)
Browse files Browse the repository at this point in the history
Fixes a small bug where projects that are saved with a soloed track can't restore the muted state of other tracks, because it doesn't store the m_mutedBeforeSolo variable on the project file.

With this fix, a new attribute is added to the Track DOM element, containing the muted state of tracks before the solo. When loading older projects that don't contain this attribute m_mutedBeforeSolo will be set to false.
  • Loading branch information
IanCaio authored Jul 14, 2020
1 parent 2b1ddb1 commit 8e116f4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/Track.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include <QMouseEvent>
#include <QPainter>
#include <QStyleOption>
#include <QVariant>


#include "AutomationPattern.h"
Expand Down Expand Up @@ -2250,6 +2251,8 @@ void Track::saveSettings( QDomDocument & doc, QDomElement & element )
element.setAttribute( "name", name() );
m_mutedModel.saveSettings( doc, element, "muted" );
m_soloModel.saveSettings( doc, element, "solo" );
// Save the mutedBeforeSolo value so we can recover the muted state if any solo was active (issue 5562)
element.setAttribute( "mutedBeforeSolo", int(m_mutedBeforeSolo) );

if( m_height >= MINIMAL_TRACK_HEIGHT )
{
Expand Down Expand Up @@ -2304,6 +2307,9 @@ void Track::loadSettings( const QDomElement & element )

m_mutedModel.loadSettings( element, "muted" );
m_soloModel.loadSettings( element, "solo" );
// Get the mutedBeforeSolo value so we can recover the muted state if any solo was active.
// Older project files that didn't have this attribute will set the value to false (issue 5562)
m_mutedBeforeSolo = QVariant( element.attribute( "mutedBeforeSolo", "0" ) ).toBool();

if( m_simpleSerializingMode )
{
Expand Down

0 comments on commit 8e116f4

Please sign in to comment.