Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn about LADSPA problems #7267

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/DataFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ class LMMS_EXPORT DataFile : public QDomDocument
void upgrade_loopsRename();
void upgrade_noteTypes();
void upgrade_fixCMTDelays();
void findProblematicLadspaPlugins();

// List of all upgrade methods
static const std::vector<UpgradeMethod> UPGRADE_METHODS;
Expand Down
36 changes: 34 additions & 2 deletions src/core/DataFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const std::vector<DataFile::UpgradeMethod> DataFile::UPGRADE_METHODS = {
&DataFile::upgrade_mixerRename , &DataFile::upgrade_bbTcoRename,
&DataFile::upgrade_sampleAndHold , &DataFile::upgrade_midiCCIndexing,
&DataFile::upgrade_loopsRename , &DataFile::upgrade_noteTypes,
&DataFile::upgrade_fixCMTDelays
&DataFile::upgrade_fixCMTDelays , &DataFile::findProblematicLadspaPlugins
};

// Vector of all versions that have upgrade routines.
Expand Down Expand Up @@ -1046,7 +1046,6 @@ void DataFile::upgrade_0_4_0_rc2()
}
}


void DataFile::upgrade_1_0_99()
{
jo_id_t last_assigned_id = 0;
Expand Down Expand Up @@ -1957,6 +1956,39 @@ void DataFile::upgrade_midiCCIndexing()
}
}

void DataFile::findProblematicLadspaPlugins()
{
// This is not an upgrade but a check for potentially problematic LADSPA
// controls. See #5738 for more details.

const QDomNodeList ladspacontrols = elementsByTagName("ladspacontrols");

auto problematicLadspaControlFound = false;

for (int i = 0; i < ladspacontrols.size(); ++i)
{
const QDomElement ladspacontrol = ladspacontrols.item(i).toElement();

const auto attributes = ladspacontrol.attributes();
for (int j = 0; j < attributes.length(); ++j)
{
const auto attribute = attributes.item(j);
const auto name = attribute.nodeName();
if (name != "ports" && name.startsWith("port"))
{
problematicLadspaControlFound = true;
break;
}
}
}

if (problematicLadspaControlFound)
{
QMessageBox::warning(nullptr, QObject::tr("LADSPA plugins"),
QObject::tr("The project contains LADSPA plugins which might have not been restored correctly! Please check the project."));
}
}

void DataFile::upgrade()
{
// Runs all necessary upgrade methods
Expand Down
Loading