use new event loop callback to ensure that all surface/control protocol threads have tempo map ptr set

This commit is contained in:
Paul Davis
2022-05-16 15:24:27 -06:00
parent 968533cc23
commit 9758e6280f
15 changed files with 58 additions and 0 deletions

View File

@@ -21,6 +21,7 @@
#include "pbd/convert.h"
#include "pbd/error.h"
#include "pbd/pthread_utils.h"
#include "temporal/superclock.h"
#include "temporal/tempo.h"
@@ -65,6 +66,7 @@ const std::string ControlProtocol::state_node_name ("Protocol");
ControlProtocol::ControlProtocol (Session& s, string str)
: BasicUI (s)
, _name (str)
, glib_event_callback (boost::bind (&ControlProtocol::event_loop_precall, this))
, _active (false)
{
if (!selection_connected) {
@@ -78,6 +80,19 @@ ControlProtocol::~ControlProtocol ()
{
}
void
ControlProtocol::event_loop_precall ()
{
/* reload the thread-local ptr to the tempo map */
Temporal::TempoMap::fetch ();
}
void
ControlProtocol::install_precall_handler (Glib::RefPtr<Glib::MainContext> context)
{
glib_event_callback.attach (context);
}
int
ControlProtocol::set_active (bool yn)
{