@@ -149,7 +149,9 @@ enum CarlaLv2URIDs { | |||||
// ui stuff | // ui stuff | ||||
kUridBackgroundColor, | kUridBackgroundColor, | ||||
kUridForegroundColor, | kUridForegroundColor, | ||||
#ifndef CARLA_OS_MAC | |||||
kUridScaleFactor, | kUridScaleFactor, | ||||
#endif | |||||
kUridWindowTitle, | kUridWindowTitle, | ||||
// custom carla props | // custom carla props | ||||
kUridCarlaAtomWorkerIn, | kUridCarlaAtomWorkerIn, | ||||
@@ -353,7 +355,9 @@ struct CarlaPluginLV2Options { | |||||
TransientWinId, | TransientWinId, | ||||
BackgroundColor, | BackgroundColor, | ||||
ForegroundColor, | ForegroundColor, | ||||
#ifndef CARLA_OS_MAC | |||||
ScaleFactor, | ScaleFactor, | ||||
#endif | |||||
WindowTitle, | WindowTitle, | ||||
Null, | Null, | ||||
Count | Count | ||||
@@ -431,6 +435,7 @@ struct CarlaPluginLV2Options { | |||||
optForegroundColor.type = kUridAtomInt; | optForegroundColor.type = kUridAtomInt; | ||||
optForegroundColor.value = &fgColor; | optForegroundColor.value = &fgColor; | ||||
#ifndef CARLA_OS_MAC | |||||
LV2_Options_Option& optScaleFactor(opts[ScaleFactor]); | LV2_Options_Option& optScaleFactor(opts[ScaleFactor]); | ||||
optScaleFactor.context = LV2_OPTIONS_INSTANCE; | optScaleFactor.context = LV2_OPTIONS_INSTANCE; | ||||
optScaleFactor.subject = 0; | optScaleFactor.subject = 0; | ||||
@@ -438,6 +443,7 @@ struct CarlaPluginLV2Options { | |||||
optScaleFactor.size = sizeof(float); | optScaleFactor.size = sizeof(float); | ||||
optScaleFactor.type = kUridAtomFloat; | optScaleFactor.type = kUridAtomFloat; | ||||
optScaleFactor.value = &uiScale; | optScaleFactor.value = &uiScale; | ||||
#endif | |||||
LV2_Options_Option& optSampleRate(opts[SampleRate]); | LV2_Options_Option& optSampleRate(opts[SampleRate]); | ||||
optSampleRate.context = LV2_OPTIONS_INSTANCE; | optSampleRate.context = LV2_OPTIONS_INSTANCE; | ||||
@@ -7877,8 +7883,10 @@ private: | |||||
return kUridBackgroundColor; | return kUridBackgroundColor; | ||||
if (std::strcmp(uri, LV2_UI__foregroundColor) == 0) | if (std::strcmp(uri, LV2_UI__foregroundColor) == 0) | ||||
return kUridForegroundColor; | return kUridForegroundColor; | ||||
#ifndef CARLA_OS_MAC | |||||
if (std::strcmp(uri, LV2_UI__scaleFactor) == 0) | if (std::strcmp(uri, LV2_UI__scaleFactor) == 0) | ||||
return kUridScaleFactor; | return kUridScaleFactor; | ||||
#endif | |||||
if (std::strcmp(uri, LV2_UI__windowTitle) == 0) | if (std::strcmp(uri, LV2_UI__windowTitle) == 0) | ||||
return kUridWindowTitle; | return kUridWindowTitle; | ||||
@@ -8015,8 +8023,10 @@ private: | |||||
return LV2_UI__backgroundColor; | return LV2_UI__backgroundColor; | ||||
case kUridForegroundColor: | case kUridForegroundColor: | ||||
return LV2_UI__foregroundColor; | return LV2_UI__foregroundColor; | ||||
#ifndef CARLA_OS_MAC | |||||
case kUridScaleFactor: | case kUridScaleFactor: | ||||
return LV2_UI__scaleFactor; | return LV2_UI__scaleFactor; | ||||
#endif | |||||
case kUridWindowTitle: | case kUridWindowTitle: | ||||
return LV2_UI__windowTitle; | return LV2_UI__windowTitle; | ||||
@@ -103,10 +103,12 @@ public: | |||||
*/ | */ | ||||
virtual void* getWidget() const noexcept = 0; | virtual void* getWidget() const noexcept = 0; | ||||
#ifndef CARLA_OS_MAC | |||||
/*! | /*! | ||||
* TESTING | * TESTING | ||||
*/ | */ | ||||
virtual void setScaleFactor(double scaleFactor) = 0; | virtual void setScaleFactor(double scaleFactor) = 0; | ||||
#endif | |||||
/*! | /*! | ||||
* TESTING | * TESTING | ||||
@@ -103,7 +103,9 @@ enum CarlaLv2URIDs { | |||||
// ui stuff | // ui stuff | ||||
kUridBackgroundColor, | kUridBackgroundColor, | ||||
kUridForegroundColor, | kUridForegroundColor, | ||||
#ifndef CARLA_OS_MAC | |||||
kUridScaleFactor, | kUridScaleFactor, | ||||
#endif | |||||
kUridWindowTitle, | kUridWindowTitle, | ||||
// custom carla props | // custom carla props | ||||
kUridCarlaAtomWorkerIn, | kUridCarlaAtomWorkerIn, | ||||
@@ -148,7 +150,9 @@ struct Lv2PluginOptions { | |||||
TransientWinId, | TransientWinId, | ||||
BackgroundColor, | BackgroundColor, | ||||
ForegroundColor, | ForegroundColor, | ||||
#ifndef CARLA_OS_MAC | |||||
ScaleFactor, | ScaleFactor, | ||||
#endif | |||||
WindowTitle, | WindowTitle, | ||||
Null, | Null, | ||||
Count | Count | ||||
@@ -192,6 +196,7 @@ struct Lv2PluginOptions { | |||||
optForegroundColor.type = kUridAtomInt; | optForegroundColor.type = kUridAtomInt; | ||||
optForegroundColor.value = &fgColor; | optForegroundColor.value = &fgColor; | ||||
#ifndef CARLA_OS_MAC | |||||
LV2_Options_Option& optScaleFactor(opts[ScaleFactor]); | LV2_Options_Option& optScaleFactor(opts[ScaleFactor]); | ||||
optScaleFactor.context = LV2_OPTIONS_INSTANCE; | optScaleFactor.context = LV2_OPTIONS_INSTANCE; | ||||
optScaleFactor.subject = 0; | optScaleFactor.subject = 0; | ||||
@@ -199,6 +204,7 @@ struct Lv2PluginOptions { | |||||
optScaleFactor.size = sizeof(float); | optScaleFactor.size = sizeof(float); | ||||
optScaleFactor.type = kUridAtomFloat; | optScaleFactor.type = kUridAtomFloat; | ||||
optScaleFactor.value = &uiScale; | optScaleFactor.value = &uiScale; | ||||
#endif | |||||
LV2_Options_Option& optTransientWinId(opts[TransientWinId]); | LV2_Options_Option& optTransientWinId(opts[TransientWinId]); | ||||
optTransientWinId.context = LV2_OPTIONS_INSTANCE; | optTransientWinId.context = LV2_OPTIONS_INSTANCE; | ||||
@@ -831,10 +837,12 @@ public: | |||||
fUiOptions.useThemeColors = opts.useThemeColors; | fUiOptions.useThemeColors = opts.useThemeColors; | ||||
} | } | ||||
#ifndef CARLA_OS_MAC | |||||
void setScaleFactor(const double scaleFactor) override | void setScaleFactor(const double scaleFactor) override | ||||
{ | { | ||||
fLv2Options.uiScale = static_cast<float>(scaleFactor); | fLv2Options.uiScale = static_cast<float>(scaleFactor); | ||||
} | } | ||||
#endif | |||||
void uiResized(const uint width, const uint height) override | void uiResized(const uint width, const uint height) override | ||||
{ | { | ||||
@@ -1314,8 +1322,10 @@ private: | |||||
return kUridBackgroundColor; | return kUridBackgroundColor; | ||||
if (std::strcmp(uri, LV2_UI__foregroundColor) == 0) | if (std::strcmp(uri, LV2_UI__foregroundColor) == 0) | ||||
return kUridForegroundColor; | return kUridForegroundColor; | ||||
#ifndef CARLA_OS_MAC | |||||
if (std::strcmp(uri, LV2_UI__scaleFactor) == 0) | if (std::strcmp(uri, LV2_UI__scaleFactor) == 0) | ||||
return kUridScaleFactor; | return kUridScaleFactor; | ||||
#endif | |||||
if (std::strcmp(uri, LV2_UI__windowTitle) == 0) | if (std::strcmp(uri, LV2_UI__windowTitle) == 0) | ||||
return kUridWindowTitle; | return kUridWindowTitle; | ||||
@@ -1452,8 +1462,10 @@ private: | |||||
return LV2_UI__backgroundColor; | return LV2_UI__backgroundColor; | ||||
case kUridForegroundColor: | case kUridForegroundColor: | ||||
return LV2_UI__foregroundColor; | return LV2_UI__foregroundColor; | ||||
#ifndef CARLA_OS_MAC | |||||
case kUridScaleFactor: | case kUridScaleFactor: | ||||
return LV2_UI__scaleFactor; | return LV2_UI__scaleFactor; | ||||
#endif | |||||
case kUridWindowTitle: | case kUridWindowTitle: | ||||
return LV2_UI__windowTitle; | return LV2_UI__windowTitle; | ||||
@@ -72,8 +72,10 @@ public: | |||||
#endif | #endif | ||||
CARLA_SAFE_ASSERT_RETURN(fHostUI != nullptr, false); | CARLA_SAFE_ASSERT_RETURN(fHostUI != nullptr, false); | ||||
#ifndef CARLA_OS_MAC | |||||
if (options.isStandalone) | if (options.isStandalone) | ||||
fPlugin->setScaleFactor(carla_get_desktop_scale_factor()); | fPlugin->setScaleFactor(carla_get_desktop_scale_factor()); | ||||
#endif | |||||
fHostUI->setTitle(options.windowTitle.buffer()); | fHostUI->setTitle(options.windowTitle.buffer()); | ||||