Skip to content

Commit

Permalink
Move function enableBlockedPlugins
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesLorenz committed Jul 8, 2024
1 parent 250e701 commit f10f3a8
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 13 deletions.
1 change: 1 addition & 0 deletions include/ConfigManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ class LMMS_EXPORT ConfigManager : public QObject

QString defaultVersion() const;

static bool enableBlockedPlugins();

static QStringList availableVstEmbedMethods();
QString vstEmbedMethod() const;
Expand Down
2 changes: 0 additions & 2 deletions include/Engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ class LMMS_EXPORT Engine : public QObject
return s_projectJournal;
}

static bool enableBlockedPlugins();

#ifdef LMMS_HAVE_LV2
static class Lv2Manager * getLv2Manager()
{
Expand Down
6 changes: 6 additions & 0 deletions src/core/ConfigManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,12 @@ QString ConfigManager::defaultVersion() const
return LMMS_VERSION;
}

bool ConfigManager::enableBlockedPlugins()
{
const char* envVar = getenv("LMMS_ENABLE_BLOCKED_PLUGINS");
return (envVar && *envVar);
}

QStringList ConfigManager::availableVstEmbedMethods()
{
QStringList methods;
Expand Down
9 changes: 0 additions & 9 deletions src/core/Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,6 @@ void Engine::destroy()



bool Engine::enableBlockedPlugins()
{
const char* envVar = getenv("LMMS_ENABLE_BLOCKED_PLUGINS");
return (envVar && *envVar);
}




float Engine::framesPerTick(sample_rate_t sampleRate)
{
return sampleRate * 60.0f * 4 /
Expand Down
3 changes: 2 additions & 1 deletion src/core/lv2/Lv2Manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <QElapsedTimer>

#include "AudioEngine.h"
#include "ConfigManager.h"
#include "Engine.h"
#include "Plugin.h"
#include "Lv2ControlBase.h"
Expand Down Expand Up @@ -298,7 +299,7 @@ void Lv2Manager::initPlugins()
}

// TODO: might be better in the LMMS core
if(Engine::enableBlockedPlugins())
if(ConfigManager::enableBlockedPlugins())
{
qWarning() <<
"WARNING! Blocked plugins enabled! If you want to disable them,\n"
Expand Down
3 changes: 2 additions & 1 deletion src/core/lv2/Lv2Proc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "AudioEngine.h"
#include "AutomatableModel.h"
#include "ComboBoxModel.h"
#include "ConfigManager.h"
#include "Engine.h"
#include "Lv2Features.h"
#include "Lv2Manager.h"
Expand Down Expand Up @@ -77,7 +78,7 @@ Plugin::Type Lv2Proc::check(const LilvPlugin *plugin,
// TODO: manage a global list of blocked plugins outside of the code
// for now, this will help
// this is only a fix for the meantime
if (!Engine::enableBlockedPlugins())
if (!ConfigManager::enableBlockedPlugins())
{
if( // plugin unstable?
Lv2Manager::pluginIsUnstable(pluginUri) ||
Expand Down

0 comments on commit f10f3a8

Please sign in to comment.