Skip to content

Commit

Permalink
Rename "SimpleSerializing"
Browse files Browse the repository at this point in the history
Rename "SimpleSerializing" to "PresetMode" everywhere because that is
what this mode describes in fact.
  • Loading branch information
michaelgregorius committed Aug 11, 2024
1 parent 3f8bef6 commit 00235c7
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions include/Track.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ class LMMS_EXPORT Track : public Model, public JournallingObject
void saveSettings( QDomDocument & doc, QDomElement & element ) override;
void loadSettings( const QDomElement & element ) override;

void setSimpleSerializing(bool simpleSerializing = true)
void setPresetMode(bool presetMode = true)
{
m_simpleSerializingMode = simpleSerializing;
m_presetMode = presetMode;
}

// -- for usage by Clip only ---------------
Expand Down Expand Up @@ -210,9 +210,9 @@ public slots:
void toggleSolo();

protected:
bool isSimpleSerializing() const
bool isPresetMode() const
{
return m_simpleSerializingMode;
return m_presetMode;
}

private:
Expand All @@ -228,7 +228,7 @@ public slots:
BoolModel m_soloModel;
bool m_mutedBeforeSolo;

bool m_simpleSerializingMode;
bool m_presetMode;

clipVector m_clips;

Expand Down
12 changes: 6 additions & 6 deletions src/core/Track.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Track::Track( Type type, TrackContainer * tc ) :
m_name(), /*!< The track's name */
m_mutedModel( false, this, tr( "Mute" ) ), /*!< For controlling track muting */
m_soloModel( false, this, tr( "Solo" ) ), /*!< For controlling track soloing */
m_simpleSerializingMode( false ),
m_presetMode( false ),
m_clips() /*!< The clips (segments) */
{
m_trackContainer->addTrack( this );
Expand Down Expand Up @@ -191,7 +191,7 @@ Track* Track::clone()
*/
void Track::saveSettings( QDomDocument & doc, QDomElement & element )
{
if (!isSimpleSerializing())
if (!isPresetMode())
{
element.setTagName( "track" );
}
Expand All @@ -217,9 +217,9 @@ void Track::saveSettings( QDomDocument & doc, QDomElement & element )
element.appendChild( tsDe );
saveTrackSpecificSettings( doc, tsDe );

if (isSimpleSerializing())
if (isPresetMode())
{
setSimpleSerializing(false);
setPresetMode(false);
return;
}

Expand Down Expand Up @@ -267,7 +267,7 @@ void Track::loadSettings( const QDomElement & element )
setColor(QColor{element.attribute("color")});
}

if (isSimpleSerializing())
if (isPresetMode())
{
QDomNode node = element.firstChild();
while( !node.isNull() )
Expand All @@ -280,7 +280,7 @@ void Track::loadSettings( const QDomElement & element )
node = node.nextSibling();
}

setSimpleSerializing(false);
setPresetMode(false);

return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/editors/TrackContainerView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ void TrackContainerView::dropEvent( QDropEvent * _de )
{
DataFile dataFile( value );
auto it = dynamic_cast<InstrumentTrack*>(Track::create(Track::Type::Instrument, m_tc));
it->setSimpleSerializing();
it->setPresetMode();
it->loadSettings( dataFile.content().toElement() );
//it->toggledInstrumentTrackButton( true );
_de->accept();
Expand Down
2 changes: 1 addition & 1 deletion src/gui/instrument/InstrumentTrackWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ void InstrumentTrackWindow::saveSettingsBtnClicked()
DataFile dataFile(DataFile::Type::InstrumentTrackSettings);
QDomElement& content(dataFile.content());

m_track->setSimpleSerializing();
m_track->setPresetMode();
m_track->saveSettings(dataFile, content);
//We don't want to save muted & solo settings when we're saving a preset
content.setAttribute("muted", 0);
Expand Down
4 changes: 2 additions & 2 deletions src/tracks/InstrumentTrack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ void InstrumentTrack::saveTrackSpecificSettings( QDomDocument& doc, QDomElement
autoAssignMidiDevice(false);

// Only save the MIDI port information if we are not saving a preset.
if (!isSimpleSerializing())
if (!isPresetMode())
{
m_midiPort.saveState( doc, thisElement );
}
Expand Down Expand Up @@ -1011,7 +1011,7 @@ void InstrumentTrack::replaceInstrument(DataFile dataFile)
int mixerChannel = mixerChannelModel()->value();

InstrumentTrack::removeMidiPortNode(dataFile);
setSimpleSerializing();
setPresetMode();

//Replacing an instrument shouldn't change the solo/mute state.
bool oldMute = isMuted();
Expand Down

0 comments on commit 00235c7

Please sign in to comment.