Add plugin blacklist for buffersize<=32
This commit is contained in:
committed by
Johannes Lorenz
parent
9c46370234
commit
61b612634d
@@ -30,6 +30,7 @@
|
||||
#ifdef LMMS_HAVE_LV2
|
||||
|
||||
#include <map>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
#include "Lv2Manager.h"
|
||||
|
||||
@@ -78,7 +79,7 @@ private:
|
||||
//! pointers to m_features, required for lilv_plugin_instantiate
|
||||
std::vector<const LV2_Feature*> m_featurePointers;
|
||||
//! features + data, ordered by URI
|
||||
std::map<const char*, void*, Lv2Manager::CmpStr> m_featureByUri;
|
||||
std::map<std::string_view, void*> m_featureByUri;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <string_view>
|
||||
#include <lilv/lilv.h>
|
||||
|
||||
#include "Lv2Basics.h"
|
||||
@@ -120,15 +121,9 @@ public:
|
||||
Iterator begin() { return m_lv2InfoMap.begin(); }
|
||||
Iterator end() { return m_lv2InfoMap.end(); }
|
||||
|
||||
//! strcmp based key comparator for std::set and std::map
|
||||
struct CmpStr
|
||||
{
|
||||
bool operator()(char const *a, char const *b) const;
|
||||
};
|
||||
|
||||
UridMap& uridMap() { return m_uridMap; }
|
||||
const Lv2UridCache& uridCache() const { return m_uridCache; }
|
||||
const std::set<const char*, CmpStr>& supportedFeatureURIs() const
|
||||
const std::set<std::string_view>& supportedFeatureURIs() const
|
||||
{
|
||||
return m_supportedFeatureURIs;
|
||||
}
|
||||
@@ -136,17 +131,21 @@ public:
|
||||
AutoLilvNodes findNodes(const LilvNode *subject,
|
||||
const LilvNode *predicate, const LilvNode *object);
|
||||
|
||||
static const std::set<const char*, Lv2Manager::CmpStr>& getPluginBlacklist()
|
||||
static const std::set<std::string_view>& getPluginBlacklist()
|
||||
{
|
||||
return pluginBlacklist;
|
||||
}
|
||||
static const std::set<std::string_view>& getPluginBlacklistBuffersizeLessThan32()
|
||||
{
|
||||
return pluginBlacklistBuffersizeLessThan32;
|
||||
}
|
||||
|
||||
private:
|
||||
// general data
|
||||
bool m_debug; //!< if set, debug output will be printed
|
||||
LilvWorld* m_world;
|
||||
Lv2InfoMap m_lv2InfoMap;
|
||||
std::set<const char*, CmpStr> m_supportedFeatureURIs;
|
||||
std::set<std::string_view> m_supportedFeatureURIs;
|
||||
|
||||
// feature data that are common for all Lv2Proc
|
||||
UridMap m_uridMap;
|
||||
@@ -155,7 +154,8 @@ private:
|
||||
Lv2UridCache m_uridCache;
|
||||
|
||||
// static
|
||||
static const std::set<const char*, Lv2Manager::CmpStr> pluginBlacklist;
|
||||
static const std::set<std::string_view>
|
||||
pluginBlacklist, pluginBlacklistBuffersizeLessThan32;
|
||||
|
||||
// functions
|
||||
bool isSubclassOf(const LilvPluginClass *clvss, const char *uriStr);
|
||||
|
||||
@@ -48,7 +48,7 @@ Lv2Features::Lv2Features()
|
||||
{
|
||||
const Lv2Manager* man = Engine::getLv2Manager();
|
||||
// create (yet empty) map feature URI -> feature
|
||||
for(const char* uri : man->supportedFeatureURIs())
|
||||
for(auto uri : man->supportedFeatureURIs())
|
||||
{
|
||||
m_featureByUri.emplace(uri, nullptr);
|
||||
}
|
||||
@@ -71,7 +71,7 @@ void Lv2Features::initCommon()
|
||||
void Lv2Features::createFeatureVectors()
|
||||
{
|
||||
// create vector of features
|
||||
for(std::pair<const char* const, void*>& pr : m_featureByUri)
|
||||
for(const auto& [uri, feature] : m_featureByUri)
|
||||
{
|
||||
/*
|
||||
If pr.second is nullptr here, this means that the LV2_feature
|
||||
@@ -82,7 +82,7 @@ void Lv2Features::createFeatureVectors()
|
||||
vector creation (This can be done in
|
||||
Lv2Proc::initPluginSpecificFeatures or in Lv2Features::initCommon)
|
||||
*/
|
||||
m_features.push_back(LV2_Feature { pr.first, pr.second });
|
||||
m_features.push_back(LV2_Feature{(const char*)uri.data(), (void*)feature});
|
||||
}
|
||||
|
||||
// create pointer vector (for lilv_plugin_instantiate)
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <lilv/lilv.h>
|
||||
#include <lv2/lv2plug.in/ns/ext/buf-size/buf-size.h>
|
||||
#include <lv2/lv2plug.in/ns/ext/options/options.h>
|
||||
@@ -47,7 +46,7 @@ namespace lmms
|
||||
{
|
||||
|
||||
|
||||
const std::set<const char*, Lv2Manager::CmpStr> Lv2Manager::pluginBlacklist =
|
||||
const std::set<std::string_view> Lv2Manager::pluginBlacklist =
|
||||
{
|
||||
// github.com/calf-studio-gear/calf, #278
|
||||
"http://calf.sourceforge.net/plugins/Analyzer",
|
||||
@@ -138,6 +137,26 @@ const std::set<const char*, Lv2Manager::CmpStr> Lv2Manager::pluginBlacklist =
|
||||
"urn:juced:DrumSynth"
|
||||
};
|
||||
|
||||
const std::set<std::string_view> Lv2Manager::pluginBlacklistBuffersizeLessThan32 =
|
||||
{
|
||||
"http://moddevices.com/plugins/mod-devel/2Voices",
|
||||
"http://moddevices.com/plugins/mod-devel/Capo",
|
||||
"http://moddevices.com/plugins/mod-devel/Drop",
|
||||
"http://moddevices.com/plugins/mod-devel/Harmonizer",
|
||||
"http://moddevices.com/plugins/mod-devel/Harmonizer2",
|
||||
"http://moddevices.com/plugins/mod-devel/HarmonizerCS",
|
||||
"http://moddevices.com/plugins/mod-devel/SuperCapo",
|
||||
"http://moddevices.com/plugins/mod-devel/SuperWhammy",
|
||||
"http://moddevices.com/plugins/mod-devel/Gx2Voices",
|
||||
"http://moddevices.com/plugins/mod-devel/GxCapo",
|
||||
"http://moddevices.com/plugins/mod-devel/GxDrop",
|
||||
"http://moddevices.com/plugins/mod-devel/GxHarmonizer",
|
||||
"http://moddevices.com/plugins/mod-devel/GxHarmonizer2",
|
||||
"http://moddevices.com/plugins/mod-devel/GxHarmonizerCS",
|
||||
"http://moddevices.com/plugins/mod-devel/GxSuperCapo",
|
||||
"http://moddevices.com/plugins/mod-devel/GxSuperWhammy"
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -293,14 +312,6 @@ void Lv2Manager::initPlugins()
|
||||
|
||||
|
||||
|
||||
bool Lv2Manager::CmpStr::operator()(const char *a, const char *b) const
|
||||
{
|
||||
return std::strcmp(a, b) < 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
bool Lv2Manager::isFeatureSupported(const char *featName) const
|
||||
{
|
||||
return m_supportedFeatureURIs.find(featName) != m_supportedFeatureURIs.end();
|
||||
|
||||
@@ -75,11 +75,19 @@ Plugin::Type Lv2Proc::check(const LilvPlugin *plugin,
|
||||
// TODO: manage a global blacklist outside of the code
|
||||
// for now, this will help
|
||||
// this is only a fix for the meantime
|
||||
const auto& pluginBlacklist = Lv2Manager::getPluginBlacklist();
|
||||
if (!Engine::ignorePluginBlacklist() &&
|
||||
pluginBlacklist.find(pluginUri) != pluginBlacklist.end())
|
||||
if (!Engine::ignorePluginBlacklist())
|
||||
{
|
||||
issues.emplace_back(PluginIssueType::Blacklisted);
|
||||
const auto& pluginBlacklist = Lv2Manager::getPluginBlacklist();
|
||||
const auto& pluginBlacklist32 = Lv2Manager::getPluginBlacklistBuffersizeLessThan32();
|
||||
if(pluginBlacklist.find(pluginUri) != pluginBlacklist.end())
|
||||
{
|
||||
issues.emplace_back(PluginIssueType::Blacklisted);
|
||||
}
|
||||
else if(Engine::audioEngine()->framesPerPeriod() <= 32 &&
|
||||
pluginBlacklist32.find(pluginUri) != pluginBlacklist32.end())
|
||||
{
|
||||
issues.emplace_back(PluginIssueType::Blacklisted); // currently no special blacklist category
|
||||
}
|
||||
}
|
||||
|
||||
for (unsigned portNum = 0; portNum < maxPorts; ++portNum)
|
||||
|
||||
Reference in New Issue
Block a user