Fix persistence settings for VST2/3 instances
Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
parent
d80c2e5c96
commit
03055c2563
3 changed files with 33 additions and 21 deletions
|
@ -554,27 +554,7 @@ Initializer::Initializer(const CardinalBasePlugin* const plugin, const CardinalB
|
|||
INFO("Initializing plugin browser DB");
|
||||
app::browserInit();
|
||||
|
||||
if (isRealInstance)
|
||||
{
|
||||
INFO("Loading settings");
|
||||
settings::load();
|
||||
shouldSaveSettings = true;
|
||||
}
|
||||
|
||||
// enforce settings that do not make sense as anything else
|
||||
settings::safeMode = false;
|
||||
settings::token.clear();
|
||||
settings::windowMaximized = false;
|
||||
settings::windowPos = math::Vec(0, 0);
|
||||
settings::pixelRatio = 0.0;
|
||||
settings::sampleRate = 0;
|
||||
settings::threadCount = 1;
|
||||
settings::frameSwapInterval = 1;
|
||||
settings::autosaveInterval = 0;
|
||||
settings::skipLoadOnLaunch = true;
|
||||
settings::autoCheckUpdates = false;
|
||||
settings::showTipsOnLaunch = false;
|
||||
settings::tipIndex = -1;
|
||||
loadSettings(isRealInstance);
|
||||
|
||||
#ifdef CARDINAL_INIT_OSC_THREAD
|
||||
INFO("Initializing OSC Remote control");
|
||||
|
@ -636,6 +616,33 @@ Initializer::~Initializer()
|
|||
logger::destroy();
|
||||
}
|
||||
|
||||
void Initializer::loadSettings(const bool isRealInstance)
|
||||
{
|
||||
using namespace rack;
|
||||
|
||||
if (isRealInstance)
|
||||
{
|
||||
INFO("Loading settings");
|
||||
settings::load();
|
||||
shouldSaveSettings = true;
|
||||
}
|
||||
|
||||
// enforce settings that do not make sense as anything else
|
||||
settings::safeMode = false;
|
||||
settings::token.clear();
|
||||
settings::windowMaximized = false;
|
||||
settings::windowPos = math::Vec(0, 0);
|
||||
settings::pixelRatio = 0.0;
|
||||
settings::sampleRate = 0;
|
||||
settings::threadCount = 1;
|
||||
settings::frameSwapInterval = 1;
|
||||
settings::autosaveInterval = 0;
|
||||
settings::skipLoadOnLaunch = true;
|
||||
settings::autoCheckUpdates = false;
|
||||
settings::showTipsOnLaunch = false;
|
||||
settings::tipIndex = -1;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
END_NAMESPACE_DISTRHO
|
||||
|
|
|
@ -104,6 +104,7 @@ struct Initializer
|
|||
|
||||
Initializer(const CardinalBasePlugin* plugin, const CardinalBaseUI* ui);
|
||||
~Initializer();
|
||||
void loadSettings(bool isRealInstance);
|
||||
};
|
||||
|
||||
#ifndef HEADLESS
|
||||
|
|
|
@ -217,6 +217,10 @@ public:
|
|||
fNextExpectedFrame(0),
|
||||
fWasBypassed(false)
|
||||
{
|
||||
// check if first time loading a real instance
|
||||
if (!fInitializer->shouldSaveSettings && !isDummyInstance())
|
||||
fInitializer->loadSettings(true);
|
||||
|
||||
#if CARDINAL_VARIANT_MINI || !defined(HEADLESS)
|
||||
fWindowParameters[kWindowParameterShowTooltips] = rack::settings::tooltips ? 1.f : 0.f;
|
||||
fWindowParameters[kWindowParameterCableOpacity] = std::min(100.f, std::max(0.f, rack::settings::cableOpacity * 100));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue