Putting a call in the UI thread

Hello all,

I’m trying to trigger a screen re-layout (like when you change the GUI scale in the prefs dialog) from the OSC handler thread. I’ve looked into the model of threads and signals and still can’t find a call to “cue this update in the GUI thread.” Here’s what I’ve tried; can someone point me to an example?

// how to recompute the UI layout?
// Mixer_UI::instance()->ui_parameter_changed(“mixbus-strip-scale”);
// ARDOUR_UI::instance()->on_theme_changed();
// BaseUI::RequestType Refresh = BaseUI::new_request_type();
// ArdourSurface::OSCUIRequest *req = get_request(Gtkmm2ext::StateChange);
// send_request(req);
// UIConfiguration::instance().set_mixbus_strip_scale(1.0f);
// ARDOUR_UI::instance()->the_mixer()->ui_parameter_changed(_(“mixbus-strip-scale”));
// ARDOUR_UI::instance()->main_window().resize (1,1);

This is the pattern you’re looking for:

PBD::SomeSignal.connect (connection_holder, invalidation_object, boost::bind (&ReceivingObject::the_method, ptr_to_receiving_object), gui_context());

grep for gui_context() and you will find many.

…or you could use /access_action to trigger a Lua script which then changes the prefs.

eg. /access_action/LuaAction/script-1 with the Lua action script

ArdourUI.config():set_mixbus_strip_scale (1)

no C++ code change required.

Thank you for your assistance, gentlemen!

stp

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.