Remove song import global automation (#5229)

Co-authored-by: Hyunjin Song <tteu.ingog@gmail.com>
This commit is contained in:
Kevin Zander
2025-02-22 02:54:29 -06:00
committed by GitHub
parent 055e0ba576
commit 9b04e29c4e
10 changed files with 48 additions and 128 deletions

View File

@@ -96,24 +96,6 @@
</bbtrack>
</track>
</trackcontainer>
<track type="6" muted="0" name="Automation track" solo="0">
<automationtrack/>
<automationpattern prog="0" mute="0" name="Numerator" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Denominator" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Tempo" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Master volume" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Master pitch" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Numerator" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Denominator" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Tempo" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Master volume" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Master pitch" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Numerator" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Denominator" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Tempo" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Master volume" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Master pitch" pos="0" tens="1" len="192"/>
</track>
<mixer visible="1" width="561" height="332" x="10" y="314" maximized="0" minimized="0">
<mixerchannel num="0" muted="0" volume="1" name="Master" soloed="0">
<fxchain numofeffects="0" enabled="0"/>

View File

@@ -214,24 +214,6 @@
</bbtrack>
</track>
</trackcontainer>
<track type="6" muted="0" name="Automation track" solo="0">
<automationtrack/>
<automationpattern prog="0" mute="0" name="Numerator" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Denominator" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Tempo" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Master volume" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Master pitch" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Numerator" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Denominator" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Tempo" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Master volume" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Master pitch" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Numerator" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Denominator" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Tempo" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Master volume" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Master pitch" pos="0" tens="1" len="192"/>
</track>
<mixer visible="1" width="561" height="332" x="10" y="314" maximized="0" minimized="0">
<mixerchannel num="0" muted="0" volume="1" name="Master" soloed="0">
<fxchain numofeffects="0" enabled="0"/>

View File

@@ -113,24 +113,6 @@
</bbtrack>
</track>
</trackcontainer>
<track type="6" muted="0" name="Automation track" solo="0">
<automationtrack/>
<automationpattern prog="0" mute="0" name="Numerator" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Denominator" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Tempo" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Master volume" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Master pitch" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Numerator" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Denominator" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Tempo" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Master volume" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Master pitch" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Numerator" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Denominator" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Tempo" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Master volume" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Master pitch" pos="0" tens="1" len="192"/>
</track>
<mixer visible="1" width="561" height="332" x="10" y="314" maximized="0" minimized="0">
<mixerchannel num="0" muted="0" volume="1" name="Master" soloed="0">
<fxchain numofeffects="0" enabled="0"/>

View File

@@ -4,19 +4,6 @@
<head timesig_denominator="4" bpm="140" masterpitch="0" mastervol="100" timesig_numerator="4"/>
<song>
<trackcontainer visible="1" width="600" height="300" type="song" x="6" y="5" maximized="0" minimized="0"/>
<track type="6" muted="0" name="Automation track" solo="0">
<automationtrack/>
<automationpattern prog="0" mute="0" name="Numerator" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Denominator" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Tempo" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Master volume" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Master pitch" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Numerator" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Denominator" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Tempo" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Master volume" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Master pitch" pos="0" tens="1" len="192"/>
</track>
<mixer visible="1" width="561" height="332" x="5" y="310" maximized="0" minimized="0">
<mixerchannel num="0" muted="0" volume="1" name="Master" soloed="0">
<fxchain numofeffects="0" enabled="0"/>

View File

@@ -282,24 +282,6 @@
</bbtrack>
</track>
</trackcontainer>
<track type="6" muted="0" name="Automation track" solo="0">
<automationtrack/>
<automationpattern prog="0" mute="0" name="Numerator" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Denominator" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Tempo" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Master volume" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Master pitch" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Numerator" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Denominator" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Tempo" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Master volume" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Master pitch" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Numerator" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Denominator" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Tempo" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Master volume" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Master pitch" pos="0" tens="1" len="192"/>
</track>
<mixer visible="1" width="561" height="332" x="10" y="314" maximized="0" minimized="0">
<mixerchannel num="0" muted="0" volume="1" name="Master" soloed="0">
<fxchain numofeffects="0" enabled="0"/>

View File

@@ -52,24 +52,6 @@
<automationtrack/>
</track>
</trackcontainer>
<track muted="0" type="6" name="Automation track" solo="0">
<automationtrack/>
<automationpattern tens="1" mute="0" prog="0" name="Numerator" pos="0" len="192">
<object id="4975896"/>
</automationpattern>
<automationpattern tens="1" mute="0" prog="0" name="Denominator" pos="0" len="192">
<object id="6613237"/>
</automationpattern>
<automationpattern tens="1" mute="0" prog="0" name="Tempo" pos="0" len="192">
<object id="6054005"/>
</automationpattern>
<automationpattern tens="1" mute="0" prog="0" name="Master volume" pos="0" len="192">
<object id="1345820"/>
</automationpattern>
<automationpattern tens="1" mute="0" prog="0" name="Master pitch" pos="0" len="192">
<object id="5865711"/>
</automationpattern>
</track>
<mixer width="543" x="5" y="310" maximized="0" height="335" visible="1" minimized="0">
<mixerchannel num="0" muted="0" volume="1" name="Master" soloed="0">
<fxchain numofeffects="0" enabled="0"/>

View File

@@ -50,23 +50,6 @@
<bbtco usestyle="1" muted="0" name="Beat/Baseline 0" pos="0" len="1536" color="4282417407"/>
</track>
</trackcontainer>
<track type="6" muted="0" name="Automation track" solo="0">
<automationtrack/>
<automationpattern prog="0" mute="0" name="Tempo" pos="0" tens="1" len="192">
<time pos="0" value="140"/>
</automationpattern>
<automationpattern prog="0" mute="0" name="Master volume" pos="0" tens="1" len="192">
<time pos="0" value="100"/>
</automationpattern>
<automationpattern prog="0" mute="0" name="Master pitch" pos="0" tens="1" len="192">
<time pos="0" value="0"/>
</automationpattern>
<automationpattern prog="0" mute="0" name="Numerator" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Denominator" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Tempo" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Master volume" pos="0" tens="1" len="192"/>
<automationpattern prog="0" mute="0" name="Master pitch" pos="0" tens="1" len="192"/>
</track>
<mixer visible="1" width="647" height="332" x="9" y="441" maximized="0" minimized="0">
<mixerchannel num="0" muted="0" volume="1" name="Master" soloed="0">
<fxchain numofeffects="0" enabled="0"/>

View File

@@ -134,6 +134,7 @@ private:
void upgrade_fixCMTDelays();
void upgrade_fixBassLoopsTypo();
void findProblematicLadspaPlugins();
void upgrade_noHiddenAutomationTracks();
// List of all upgrade methods
static const std::vector<UpgradeMethod> UPGRADE_METHODS;

View File

@@ -85,7 +85,8 @@ const std::vector<DataFile::UpgradeMethod> DataFile::UPGRADE_METHODS = {
&DataFile::upgrade_sampleAndHold , &DataFile::upgrade_midiCCIndexing,
&DataFile::upgrade_loopsRename , &DataFile::upgrade_noteTypes,
&DataFile::upgrade_fixCMTDelays , &DataFile::upgrade_fixBassLoopsTypo,
&DataFile::findProblematicLadspaPlugins
&DataFile::findProblematicLadspaPlugins,
&DataFile::upgrade_noHiddenAutomationTracks
};
// Vector of all versions that have upgrade routines.
@@ -1638,6 +1639,51 @@ void DataFile::upgrade_1_3_0()
}
}
void DataFile::upgrade_noHiddenAutomationTracks()
{
// convert global automation tracks to non-hidden
QDomElement song = firstChildElement("lmms-project")
.firstChildElement("song");
QDomElement trackContainer = song.firstChildElement("trackcontainer");
QDomElement globalAutomationTrack = song.firstChildElement("track");
if (!globalAutomationTrack.isNull()
&& globalAutomationTrack.attribute("type").toInt() == static_cast<int>(Track::Type::HiddenAutomation))
{
// global automation clips
QDomNodeList automationClips = globalAutomationTrack.elementsByTagName("automationclip");
QList<QDomNode> tracksToInsert;
for (int i = 0; i < automationClips.length(); ++i)
{
QDomElement automationClip = automationClips.item(i).toElement();
// If automationClip has time nodes, move it to trackcontainer
// There are times when an <object> node is present without an
// object with the same ID in the file, so we ignore that node
if (automationClip.elementsByTagName("time").length() > 1)
{
QDomElement automationTrackForClip = createElement("track");
automationTrackForClip.setAttribute("muted", QString::number(false));
automationTrackForClip.setAttribute("solo", QString::number(false));
automationTrackForClip.setAttribute("type",
QString::number(static_cast<int>(Track::Type::Automation)));
automationTrackForClip.setAttribute("name",
automationClip.attribute("name", "Automation Track"));
QDomElement at = createElement("automationtrack");
automationTrackForClip.appendChild(at);
automationTrackForClip.appendChild(automationClips.item(i).cloneNode());
tracksToInsert.prepend(automationTrackForClip); // To preserve orders
}
}
// Insert the tracks at the beginning of trackContainer, preserving their order
for (const auto& track : tracksToInsert) {
trackContainer.insertBefore(track, trackContainer.firstChild());
}
// Remove the track object just in case
globalAutomationTrack.parentNode().removeChild(globalAutomationTrack);
}
}
void DataFile::upgrade_noHiddenClipNames()
{
QDomNodeList tracks = elementsByTagName("track");

View File

@@ -1079,12 +1079,6 @@ void Song::loadProject( const QString & fileName )
getTimeline(PlayMode::Song).setLoopEnabled(false);
if( !dataFile.content().firstChildElement( "track" ).isNull() )
{
m_globalAutomationTrack->restoreState( dataFile.content().
firstChildElement( "track" ) );
}
//Backward compatibility for LMMS <= 0.4.15
PeakController::initGetControllerBySetting();
@@ -1239,7 +1233,6 @@ bool Song::saveProjectFile(const QString & filename, bool withResources)
saveState( dataFile, dataFile.content() );
m_globalAutomationTrack->saveState( dataFile, dataFile.content() );
Engine::mixer()->saveState( dataFile, dataFile.content() );
if( getGUI() != nullptr )
{