Browse Source

More tweaks for 2.4 update

Signed-off-by: falkTX <falktx@falktx.com>
tags/24.04
falkTX 1 year ago
parent
commit
241df7f5c7
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
11 changed files with 65 additions and 36 deletions
  1. +25
    -6
      include/simd/common.hpp
  2. +22
    -0
      include/simd/functions.hpp
  3. +1
    -1
      plugins/GlueTheGiant
  4. +3
    -3
      plugins/ImpromptuModularDark/PanelTheme.cpp
  5. +1
    -1
      plugins/RebelTech
  6. +2
    -2
      plugins/plugins-mini.cpp
  7. +4
    -4
      plugins/surgext-helper/surgext-helper.cpp
  8. +1
    -1
      src/CardinalCommon.cpp
  9. +0
    -11
      src/custom/asset.cpp
  10. +4
    -5
      src/custom/dep.cpp
  11. +2
    -2
      src/override/MenuBar.cpp

+ 25
- 6
include/simd/common.hpp View File

@@ -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
#define SIMDE_ENABLE_NATIVE_ALIASES
#include <simde/x86/sse4.2.h>
#endif
#include "emmintrin.h"
#include "immintrin.h"
#include "pmmintrin.h"

#define SIMDE_ENABLE_NATIVE_ALIASES
#include "simde/x86/ssse3.h"
#include "simde/x86/sse4.1.h"
#include "simde/x86/sse4.2.h"

+ 22
- 0
include/simd/functions.hpp View 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
plugins/GlueTheGiant

@@ -1 +1 @@
Subproject commit 5f05d62ddc2773098daf1044eb6698581acd4eb6
Subproject commit 7e20713eacc51179cd7faf0f4428def2b82273a9

+ 3
- 3
plugins/ImpromptuModularDark/PanelTheme.cpp View File

@@ -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
plugins/RebelTech

@@ -1 +1 @@
Subproject commit 6ac79f59c5b95433d82bcc759c4cd0642ec35098
Subproject commit 2d06199dd36ecdfe33d640ed1602f1041930f013

+ 2
- 2
plugins/plugins-mini.cpp View File

@@ -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());


+ 4
- 4
plugins/surgext-helper/surgext-helper.cpp View File

@@ -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();
}

+ 1
- 1
src/CardinalCommon.cpp View File

@@ -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


+ 0
- 11
src/custom/asset.cpp View File

@@ -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));
}



+ 4
- 5
src/custom/dep.cpp View File

@@ -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();


+ 2
- 2
src/override/MenuBar.cpp View File

@@ -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…
Cancel
Save