From 7dd6a3936610390d9e5034c9a76338b1226af366 Mon Sep 17 00:00:00 2001 From: Johannes Lorenz Date: Sun, 8 Nov 2020 01:45:27 +0100 Subject: [PATCH] Introduce blacklisted plugins to core --- include/Engine.h | 2 ++ include/PluginIssue.h | 2 ++ src/core/Engine.cpp | 12 ++++++++++++ src/core/PluginIssue.cpp | 2 ++ 4 files changed, 18 insertions(+) diff --git a/include/Engine.h b/include/Engine.h index 8f988a125..a8a15e8a4 100644 --- a/include/Engine.h +++ b/include/Engine.h @@ -88,6 +88,8 @@ public: return s_projectJournal; } + static bool ignorePluginBlacklist(); + #ifdef LMMS_HAVE_LV2 static class Lv2Manager * getLv2Manager() { diff --git a/include/PluginIssue.h b/include/PluginIssue.h index 00c90b756..30affde83 100644 --- a/include/PluginIssue.h +++ b/include/PluginIssue.h @@ -44,6 +44,7 @@ enum PluginIssueType portHasNoMax, featureNotSupported, //!< plugin requires functionality LMMS can't offer badPortType, //!< port type not supported + blacklisted, noIssue }; @@ -60,6 +61,7 @@ public: : m_issueType(it), m_info(msg) { } + PluginIssueType type() const { return m_issueType; } friend QDebug operator<<(QDebug stream, const PluginIssue& iss); }; diff --git a/src/core/Engine.cpp b/src/core/Engine.cpp index 81cd0acdb..06ccfe37a 100644 --- a/src/core/Engine.cpp +++ b/src/core/Engine.cpp @@ -116,6 +116,18 @@ void LmmsCore::destroy() delete ConfigManager::inst(); } + + + +bool LmmsCore::ignorePluginBlacklist() +{ + const char* envVar = getenv("LMMS_IGNORE_BLACKLIST"); + return (envVar && *envVar); +} + + + + float LmmsCore::framesPerTick(sample_rate_t sampleRate) { return sampleRate * 60.0f * 4 / diff --git a/src/core/PluginIssue.cpp b/src/core/PluginIssue.cpp index 8e1938e56..9e7492dca 100644 --- a/src/core/PluginIssue.cpp +++ b/src/core/PluginIssue.cpp @@ -54,6 +54,8 @@ const char *PluginIssue::msgFor(const PluginIssueType &it) return "required feature not supported"; case badPortType: return "unsupported port type"; + case blacklisted: + return "blacklisted plugin"; case noIssue: return nullptr; }