From 00235c7cef5f915ac4a74b13e5ddf4574bd9fbaf Mon Sep 17 00:00:00 2001 From: Michael Gregorius Date: Sun, 11 Aug 2024 10:57:03 +0200 Subject: [PATCH] Rename "SimpleSerializing" Rename "SimpleSerializing" to "PresetMode" everywhere because that is what this mode describes in fact. --- include/Track.h | 10 +++++----- src/core/Track.cpp | 12 ++++++------ src/gui/editors/TrackContainerView.cpp | 2 +- src/gui/instrument/InstrumentTrackWindow.cpp | 2 +- src/tracks/InstrumentTrack.cpp | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/include/Track.h b/include/Track.h index 3db3a8c0730..3eb995d8676 100644 --- a/include/Track.h +++ b/include/Track.h @@ -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 --------------- @@ -210,9 +210,9 @@ public slots: void toggleSolo(); protected: - bool isSimpleSerializing() const + bool isPresetMode() const { - return m_simpleSerializingMode; + return m_presetMode; } private: @@ -228,7 +228,7 @@ public slots: BoolModel m_soloModel; bool m_mutedBeforeSolo; - bool m_simpleSerializingMode; + bool m_presetMode; clipVector m_clips; diff --git a/src/core/Track.cpp b/src/core/Track.cpp index 936a1c883c3..c45365a5ecc 100644 --- a/src/core/Track.cpp +++ b/src/core/Track.cpp @@ -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 ); @@ -191,7 +191,7 @@ Track* Track::clone() */ void Track::saveSettings( QDomDocument & doc, QDomElement & element ) { - if (!isSimpleSerializing()) + if (!isPresetMode()) { element.setTagName( "track" ); } @@ -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; } @@ -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() ) @@ -280,7 +280,7 @@ void Track::loadSettings( const QDomElement & element ) node = node.nextSibling(); } - setSimpleSerializing(false); + setPresetMode(false); return; } diff --git a/src/gui/editors/TrackContainerView.cpp b/src/gui/editors/TrackContainerView.cpp index 60a46838041..6593247109b 100644 --- a/src/gui/editors/TrackContainerView.cpp +++ b/src/gui/editors/TrackContainerView.cpp @@ -416,7 +416,7 @@ void TrackContainerView::dropEvent( QDropEvent * _de ) { DataFile dataFile( value ); auto it = dynamic_cast(Track::create(Track::Type::Instrument, m_tc)); - it->setSimpleSerializing(); + it->setPresetMode(); it->loadSettings( dataFile.content().toElement() ); //it->toggledInstrumentTrackButton( true ); _de->accept(); diff --git a/src/gui/instrument/InstrumentTrackWindow.cpp b/src/gui/instrument/InstrumentTrackWindow.cpp index 1c9c93a09f9..31f01c4c235 100644 --- a/src/gui/instrument/InstrumentTrackWindow.cpp +++ b/src/gui/instrument/InstrumentTrackWindow.cpp @@ -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); diff --git a/src/tracks/InstrumentTrack.cpp b/src/tracks/InstrumentTrack.cpp index c28019f0ef7..2e49479eea4 100644 --- a/src/tracks/InstrumentTrack.cpp +++ b/src/tracks/InstrumentTrack.cpp @@ -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 ); } @@ -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();