More tweaks for 2.4 update
Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
parent
1895052e17
commit
241df7f5c7
11 changed files with 65 additions and 36 deletions
|
@ -1,8 +1,27 @@
|
|||
/*
|
||||
* DISTRHO Cardinal Plugin
|
||||
* Copyright (C) 2021-2023 Filipe Coelho <falktx@falktx.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 3 of
|
||||
* the License, or any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* For a full copy of the GNU General Public License see the LICENSE file.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __SSE4_2__
|
||||
#include <nmmintrin.h>
|
||||
#else
|
||||
#include "emmintrin.h"
|
||||
#include "immintrin.h"
|
||||
#include "pmmintrin.h"
|
||||
|
||||
#define SIMDE_ENABLE_NATIVE_ALIASES
|
||||
#include <simde/x86/sse4.2.h>
|
||||
#endif
|
||||
#include "simde/x86/ssse3.h"
|
||||
#include "simde/x86/sse4.1.h"
|
||||
#include "simde/x86/sse4.2.h"
|
||||
|
|
22
include/simd/functions.hpp
Normal file
22
include/simd/functions.hpp
Normal file
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* DISTRHO Cardinal Plugin
|
||||
* Copyright (C) 2021-2023 Filipe Coelho <falktx@falktx.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 3 of
|
||||
* the License, or any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* For a full copy of the GNU General Public License see the LICENSE file.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "simd/common.hpp"
|
||||
#include_next "simd/functions.hpp"
|
||||
#undef SIMDE_MM_FROUND_NO_EXC
|
|
@ -1 +1 @@
|
|||
Subproject commit 5f05d62ddc2773098daf1044eb6698581acd4eb6
|
||||
Subproject commit 7e20713eacc51179cd7faf0f4428def2b82273a9
|
|
@ -17,12 +17,12 @@ void writeThemeAndContrastAsDefault() {}
|
|||
void saveThemeAndContrastAsDefault(int, float) {}
|
||||
|
||||
void loadThemeAndContrastFromDefault(int* panelTheme, float* panelContrast) {
|
||||
*panelTheme = rack::settings::darkMode ? 1 : 0;
|
||||
*panelTheme = rack::settings::preferDarkPanels ? 1 : 0;
|
||||
*panelContrast = panelContrastDefault;
|
||||
}
|
||||
|
||||
bool isDark(int*) {
|
||||
return rack::settings::darkMode;
|
||||
return rack::settings::preferDarkPanels;
|
||||
}
|
||||
|
||||
void readThemeAndContrastFromDefault() {}
|
||||
|
@ -47,7 +47,7 @@ void PanelBaseWidget::draw(const DrawArgs& args) {
|
|||
|
||||
void InverterWidget::draw(const DrawArgs& args) {
|
||||
TransparentWidget::draw(args);
|
||||
if (rack::settings::darkMode) {
|
||||
if (rack::settings::preferDarkPanels) {
|
||||
// nvgSave(args.vg);
|
||||
nvgBeginPath(args.vg);
|
||||
nvgFillColor(args.vg, SCHEME_WHITE);// this is the source, the current framebuffer is the dest
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 6ac79f59c5b95433d82bcc759c4cd0642ec35098
|
||||
Subproject commit 2d06199dd36ecdfe33d640ed1602f1041930f013
|
|
@ -353,7 +353,7 @@ static void initStatic__BogaudioModules()
|
|||
{
|
||||
// Make sure to use match Cardinal theme
|
||||
Skins& skins(Skins::skins());
|
||||
skins._default = settings::darkMode ? "dark" : "light";
|
||||
skins._default = settings::preferDarkPanels ? "dark" : "light";
|
||||
|
||||
p->addModel(modelAD);
|
||||
p->addModel(modelBogaudioLFO);
|
||||
|
@ -649,7 +649,7 @@ void destroyStaticPlugins()
|
|||
|
||||
void updateStaticPluginsDarkMode()
|
||||
{
|
||||
const bool darkMode = settings::darkMode;
|
||||
const bool darkMode = settings::preferDarkPanels;
|
||||
// bogaudio
|
||||
{
|
||||
Skins& skins(Skins::skins());
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* DISTRHO Cardinal Plugin
|
||||
* Copyright (C) 2021-2022 Filipe Coelho <falktx@falktx.com>
|
||||
* Copyright (C) 2021-2023 Filipe Coelho <falktx@falktx.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
|
@ -23,15 +23,15 @@ using namespace sst::surgext_rack::style;
|
|||
|
||||
void surgext_rack_initialize()
|
||||
{
|
||||
BaconStyle::get()->activeStyle = rack::settings::darkMode ? BaconStyle::DARK : BaconStyle::LIGHT;
|
||||
BaconStyle::get()->activeStyle = rack::settings::preferDarkPanels ? BaconStyle::DARK : BaconStyle::LIGHT;
|
||||
XTStyle::initialize();
|
||||
}
|
||||
|
||||
void surgext_rack_update_theme()
|
||||
{
|
||||
BaconStyle::get()->activeStyle = rack::settings::darkMode ? BaconStyle::DARK : BaconStyle::LIGHT;
|
||||
BaconStyle::get()->activeStyle = rack::settings::preferDarkPanels ? BaconStyle::DARK : BaconStyle::LIGHT;
|
||||
BaconStyle::get()->notifyStyleListeners();
|
||||
|
||||
XTStyle::setGlobalStyle(rack::settings::darkMode ? XTStyle::Style::DARK : XTStyle::Style::LIGHT);
|
||||
XTStyle::setGlobalStyle(rack::settings::preferDarkPanels ? XTStyle::Style::DARK : XTStyle::Style::LIGHT);
|
||||
XTStyle::notifyStyleListeners();
|
||||
}
|
||||
|
|
|
@ -410,7 +410,7 @@ Initializer::Initializer(const CardinalBasePlugin* const plugin, const CardinalB
|
|||
settings::browserZoom = -1.f;
|
||||
settings::invertZoom = false;
|
||||
settings::squeezeModules = true;
|
||||
settings::darkMode = true;
|
||||
settings::preferDarkPanels = true;
|
||||
settings::uiTheme = "dark";
|
||||
|
||||
// runtime behaviour
|
||||
|
|
|
@ -31,11 +31,6 @@
|
|||
namespace rack {
|
||||
namespace asset {
|
||||
|
||||
#ifndef HEADLESS
|
||||
extern bool forceBlackScrew;
|
||||
extern bool forceSilverScrew;
|
||||
#endif
|
||||
|
||||
std::string configDir; // points to writable config dir (might be equal to userDir)
|
||||
std::string userDir; // points to common writable dir
|
||||
std::string systemDir; // points to plugin resources dir (or installed/local Rack dir)
|
||||
|
@ -59,12 +54,6 @@ static inline std::string& trim(std::string& s)
|
|||
|
||||
// get system resource, trimming "res/" prefix if we are loaded as a plugin bundle
|
||||
std::string system(std::string filename) {
|
||||
#ifndef HEADLESS
|
||||
/**/ if (forceBlackScrew && string::endsWith(filename, "/ScrewBlack.svg"))
|
||||
filename = filename.substr(0, filename.size()-15) + "/./ScrewBlack.svg";
|
||||
else if (forceSilverScrew && string::endsWith(filename, "/ScrewSilver.svg"))
|
||||
filename = filename.substr(0, filename.size()-16) + "/./ScrewSilver.svg";
|
||||
#endif
|
||||
return system::join(systemDir, bundlePath.empty() ? filename : trim(filename));
|
||||
}
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ void updateStaticPluginsDarkMode();
|
|||
}
|
||||
namespace settings {
|
||||
int rateLimit = 0;
|
||||
extern bool preferDarkPanels;
|
||||
extern std::string uiTheme;
|
||||
}
|
||||
namespace ui {
|
||||
|
@ -1405,7 +1406,7 @@ postparse:
|
|||
const ExtendedNSVGimage ext = { handle, handleOrig, handleMOD, shapesOrig, shapesMOD };
|
||||
loadedDarkSVGs.push_back(ext);
|
||||
|
||||
if (rack::settings::darkMode)
|
||||
if (rack::settings::preferDarkPanels)
|
||||
{
|
||||
if (shapesMOD != nullptr)
|
||||
handle->shapes = shapesMOD;
|
||||
|
@ -1419,7 +1420,7 @@ postparse:
|
|||
const ExtendedNSVGimage ext = { handle, handleOrig, handleMOD, shapesOrig, shapesMOD };
|
||||
loadedLightSVGs.push_back(ext);
|
||||
|
||||
if (!rack::settings::darkMode)
|
||||
if (!rack::settings::preferDarkPanels)
|
||||
{
|
||||
if (shapesMOD != nullptr)
|
||||
handle->shapes = shapesMOD;
|
||||
|
@ -1471,9 +1472,7 @@ namespace rack {
|
|||
void switchDarkMode(const bool darkMode)
|
||||
{
|
||||
#ifndef HEADLESS
|
||||
// TODO sort this out after build with Rack2.4 succeeds
|
||||
return;
|
||||
|
||||
settings::preferDarkPanels = darkMode;
|
||||
settings::uiTheme = darkMode ? "dark" : "light";
|
||||
ui::refreshTheme();
|
||||
plugin::updateStaticPluginsDarkMode();
|
||||
|
|
|
@ -625,10 +625,10 @@ struct ViewButton : MenuButton {
|
|||
|
||||
#if DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
|
||||
std::string darkModeText;
|
||||
if (settings::darkMode)
|
||||
if (settings::preferDarkPanels)
|
||||
darkModeText = CHECKMARK_STRING;
|
||||
menu->addChild(createMenuItem("Dark Mode", darkModeText, []() {
|
||||
switchDarkMode(!settings::darkMode);
|
||||
switchDarkMode(!settings::preferDarkPanels);
|
||||
setAllFramebufferWidgetsDirty(APP->scene);
|
||||
}));
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue