Ignore dynamic light/dark mode in headless builds

Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
falkTX 2022-10-10 21:37:27 +01:00
parent e4840dfbf0
commit 930a0ca31e
No known key found for this signature in database
GPG key ID: CDBAA37ABC74FBA0
3 changed files with 24 additions and 0 deletions

View file

@ -36,9 +36,11 @@
namespace rack {
#ifndef HEADLESS
namespace asset {
void updateForcingBlackSilverScrewMode(std::string slug);
}
#endif
struct CardinalPluginModelHelper : plugin::Model {
virtual app::ModuleWidget* createModuleWidgetFromEngineLoad(engine::Module* m) = 0;
@ -76,7 +78,9 @@ struct CardinalPluginModel : CardinalPluginModelHelper
}
tm = dynamic_cast<TModule*>(m);
}
#ifndef HEADLESS
asset::updateForcingBlackSilverScrewMode(slug);
#endif
app::ModuleWidget* const tmw = new TModuleWidget(tm);
DISTRHO_CUSTOM_SAFE_ASSERT_RETURN(m != nullptr ? m->model->name.c_str() : "null", tmw->module == m, nullptr);
tmw->setModel(this);
@ -91,7 +95,9 @@ struct CardinalPluginModel : CardinalPluginModelHelper
TModule* const tm = dynamic_cast<TModule*>(m);
DISTRHO_SAFE_ASSERT_RETURN(tm != nullptr, nullptr);
#ifndef HEADLESS
asset::updateForcingBlackSilverScrewMode(slug);
#endif
TModuleWidget* const tmw = new TModuleWidget(tm);
DISTRHO_SAFE_ASSERT_RETURN(tmw->module == m, nullptr);
tmw->setModel(this);