13
0

Use glib event callback in Mackie Control support to set thread-local variables

This commit is contained in:
Paul Davis 2020-11-29 12:46:53 -07:00
parent b7d22508fa
commit ce7ea4ec36
3 changed files with 15 additions and 0 deletions

View File

@ -22,6 +22,9 @@
#include "pbd/convert.h"
#include "pbd/error.h"
#include "temporal/superclock.h"
#include "temporal/tempo.h"
#include "ardour/control_protocol_manager.h"
#include "ardour/gain_control.h"
#include "ardour/session.h"
@ -376,3 +379,11 @@ ControlProtocol::notify_stripable_selection_changed (StripableNotificationListPt
{
_last_selected = *sp;
}
void
ControlProtocol::event_loop_precall ()
{
Temporal::set_thread_sample_rate (session->sample_rate());
Temporal::TempoMap::fetch ();
}

View File

@ -141,6 +141,8 @@ public:
static StripableNotificationList const& last_selected () { return _last_selected; }
static void notify_stripable_selection_changed (StripableNotificationListPtr);
void event_loop_precall ();
protected:
void next_track (uint32_t initial_id);
void prev_track (uint32_t initial_id);

View File

@ -276,6 +276,8 @@ class MackieControlProtocol
bool stripable_is_locked_to_strip (boost::shared_ptr<ARDOUR::Stripable>) const;
void event_loop_precall () { ControlProtocol::event_loop_precall(); }
private:
struct ButtonHandlers {