mirror of
https://github.com/LMMS/lmms.git
synced 2026-05-17 19:24:52 -04:00
* fixes #6736: Sample tracks lose FX Channel * Styling fixes * Restyled remaining blocks of upgrade routine * Fixed hang due to sleepy typo * Update src/core/DataFile.cpp Co-authored-by: saker <sakertooth@gmail.com> --------- Co-authored-by: saker <sakertooth@gmail.com>
This commit is contained in:
@@ -1704,26 +1704,56 @@ void DataFile::upgrade_mixerRename()
|
||||
{
|
||||
// Change nodename <fxmixer> to <mixer>
|
||||
QDomNodeList fxmixer = elementsByTagName("fxmixer");
|
||||
for (int i = 0; !fxmixer.item(i).isNull(); ++i)
|
||||
for (int i = 0; i < fxmixer.length(); ++i)
|
||||
{
|
||||
fxmixer.item(i).toElement().setTagName("mixer");
|
||||
auto item = fxmixer.item(i).toElement();
|
||||
if (item.isNull())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
item.setTagName("mixer");
|
||||
}
|
||||
|
||||
// Change nodename <fxchannel> to <mixerchannel>
|
||||
QDomNodeList fxchannel = elementsByTagName("fxchannel");
|
||||
for (int i = 0; !fxchannel.item(i).isNull(); ++i)
|
||||
for (int i = 0; i < fxchannel.length(); ++i)
|
||||
{
|
||||
fxchannel.item(i).toElement().setTagName("mixerchannel");
|
||||
auto item = fxchannel.item(i).toElement();
|
||||
if (item.isNull())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
item.setTagName("mixerchannel");
|
||||
}
|
||||
|
||||
// Change the attribute fxch of element <instrumenttrack> to mixch
|
||||
QDomNodeList fxch = elementsByTagName("instrumenttrack");
|
||||
for(int i = 0; !fxch.item(i).isNull(); ++i)
|
||||
for (int i = 0; i < fxch.length(); ++i)
|
||||
{
|
||||
if(fxch.item(i).toElement().hasAttribute("fxch"))
|
||||
auto item = fxch.item(i).toElement();
|
||||
if (item.isNull())
|
||||
{
|
||||
fxch.item(i).toElement().setAttribute("mixch", fxch.item(i).toElement().attribute("fxch"));
|
||||
fxch.item(i).toElement().removeAttribute("fxch");
|
||||
continue;
|
||||
}
|
||||
if (item.hasAttribute("fxch"))
|
||||
{
|
||||
item.setAttribute("mixch", item.attribute("fxch"));
|
||||
item.removeAttribute("fxch");
|
||||
}
|
||||
}
|
||||
// Change the attribute fxch of element <sampletrack> to mixch
|
||||
fxch = elementsByTagName("sampletrack");
|
||||
for (int i = 0; i < fxch.length(); ++i)
|
||||
{
|
||||
auto item = fxch.item(i).toElement();
|
||||
if (item.isNull())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (item.hasAttribute("fxch"))
|
||||
{
|
||||
item.setAttribute("mixch", item.attribute("fxch"));
|
||||
item.removeAttribute("fxch");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user