Expose some more theme options to LV2 plugin UIs
This commit is contained in:
parent
3adc9e4ec0
commit
1ecaffa642
|
@ -182,9 +182,18 @@ class LIBARDOUR_API LV2Plugin : public ARDOUR::Plugin, public ARDOUR::Workee
|
|||
static void set_global_ui_foreground_color (uint32_t c) {
|
||||
_ui_foreground_color = c;
|
||||
}
|
||||
static void set_global_ui_contrasting_color (uint32_t c) {
|
||||
_ui_contrasting_color = c;
|
||||
}
|
||||
static void set_global_ui_scale_factor (float s) {
|
||||
_ui_scale_factor = s;
|
||||
}
|
||||
static void set_global_ui_style_boxy (bool yn) {
|
||||
_ui_style_boxy = yn;
|
||||
}
|
||||
static void set_global_ui_style_flat (bool yn) {
|
||||
_ui_style_flat = yn;
|
||||
}
|
||||
static void set_main_window_id (unsigned long id) {
|
||||
_ui_transient_win_id = id;
|
||||
}
|
||||
|
@ -336,8 +345,11 @@ class LIBARDOUR_API LV2Plugin : public ARDOUR::Plugin, public ARDOUR::Workee
|
|||
|
||||
// Options passed to plugin
|
||||
int32_t _seq_size;
|
||||
static bool _ui_style_flat;
|
||||
static bool _ui_style_boxy;
|
||||
static uint32_t _ui_background_color;
|
||||
static uint32_t _ui_foreground_color;
|
||||
static uint32_t _ui_contrasting_color;
|
||||
static float _ui_scale_factor;
|
||||
static unsigned long _ui_transient_win_id;
|
||||
|
||||
|
|
|
@ -128,11 +128,14 @@ using namespace std;
|
|||
using namespace ARDOUR;
|
||||
using namespace PBD;
|
||||
|
||||
bool LV2Plugin::force_state_save = false;
|
||||
uint32_t LV2Plugin::_ui_background_color = 0x000000ff; // RGBA
|
||||
uint32_t LV2Plugin::_ui_foreground_color = 0xffffffff; // RGBA
|
||||
float LV2Plugin::_ui_scale_factor = 1.0;
|
||||
unsigned long LV2Plugin::_ui_transient_win_id = 0;
|
||||
bool LV2Plugin::force_state_save = false;
|
||||
bool LV2Plugin::_ui_style_flat = false;
|
||||
bool LV2Plugin::_ui_style_boxy = false;
|
||||
uint32_t LV2Plugin::_ui_background_color = 0x000000ff; // RGBA
|
||||
uint32_t LV2Plugin::_ui_foreground_color = 0xffffffff; // RGBA
|
||||
uint32_t LV2Plugin::_ui_contrasting_color = 0x33ff33ff; // RGBA
|
||||
float LV2Plugin::_ui_scale_factor = 1.0;
|
||||
unsigned long LV2Plugin::_ui_transient_win_id = 0;
|
||||
|
||||
class LV2World : boost::noncopyable {
|
||||
public:
|
||||
|
@ -533,6 +536,7 @@ LV2Plugin::init(const void* c_plugin, samplecnt_t rate)
|
|||
#endif
|
||||
|
||||
LV2_URID atom_Int = _uri_map.uri_to_id(LV2_ATOM__Int);
|
||||
LV2_URID atom_Bool = _uri_map.uri_to_id(LV2_ATOM__Bool);
|
||||
LV2_URID atom_Long = _uri_map.uri_to_id(LV2_ATOM__Long);
|
||||
LV2_URID atom_Float = _uri_map.uri_to_id(LV2_ATOM__Float);
|
||||
|
||||
|
@ -566,8 +570,14 @@ LV2Plugin::init(const void* c_plugin, samplecnt_t rate)
|
|||
sizeof(int32_t), atom_Int, &_ui_background_color },
|
||||
{ LV2_OPTIONS_INSTANCE, 0, _uri_map.uri_to_id("http://lv2plug.in/ns/extensions/ui#foregroundColor"),
|
||||
sizeof(int32_t), atom_Int, &_ui_foreground_color },
|
||||
{ LV2_OPTIONS_INSTANCE, 0, _uri_map.uri_to_id("http://lv2plug.in/ns/extensions/ui#contrastingColor"),
|
||||
sizeof(int32_t), atom_Int, &_ui_contrasting_color },
|
||||
{ LV2_OPTIONS_INSTANCE, 0, _uri_map.uri_to_id("http://lv2plug.in/ns/extensions/ui#scaleFactor"),
|
||||
sizeof(float), atom_Float, &_ui_scale_factor },
|
||||
{ LV2_OPTIONS_INSTANCE, 0, _uri_map.uri_to_id("http://ardour.org/lv2/theme/#styleBoxy"),
|
||||
sizeof(float), atom_Bool, &_ui_style_boxy },
|
||||
{ LV2_OPTIONS_INSTANCE, 0, _uri_map.uri_to_id("http://ardour.org/lv2/theme/#styleFlat"),
|
||||
sizeof(float), atom_Bool, &_ui_style_flat },
|
||||
{ LV2_OPTIONS_INSTANCE, 0, _uri_map.uri_to_id("http://kxstudio.sf.net/ns/lv2ext/props#TransientWindowId"),
|
||||
sizeof(int32_t), atom_Long, &_ui_transient_win_id },
|
||||
{ LV2_OPTIONS_INSTANCE, 0, 0, 0, 0, NULL }
|
||||
|
|
Loading…
Reference in New Issue