Mackie Control, fix timecode sometimes won't update. Do full display if transport...
authorLen Ovens <len@ovenwerks.net>
Fri, 11 Dec 2015 20:57:24 +0000 (12:57 -0800)
committerLen Ovens <len@ovenwerks.net>
Fri, 11 Dec 2015 20:57:24 +0000 (12:57 -0800)
libs/surfaces/mackie/mackie_control_protocol.cc
libs/surfaces/mackie/mackie_control_protocol.h

index 7b7b0f5c9e8c8e4ca0c0d534ae8694c5f399ecd7..966a2cbedd669e66b6aaa2b84d7ba6f59d9cc2ee 100644 (file)
@@ -106,6 +106,7 @@ MackieControlProtocol::MackieControlProtocol (Session& session)
        : ControlProtocol (session, X_("Mackie"))
        , AbstractUI<MackieControlUIRequest> ("mackie")
        , _current_initial_bank (0)
+       , _frame_last (0)
        , _timecode_type (ARDOUR::AnyTime::BBT)
        , _gui (0)
        , _scrub_mode (false)
@@ -1143,6 +1144,13 @@ MackieControlProtocol::update_timecode_display()
        // do assignment here so current_frame is fixed
        framepos_t current_frame = session->transport_frame();
        string timecode;
+       // For large jumps in play head possition do full reset
+       int moved = (current_frame - _frame_last) / session->frame_rate ();
+       if (moved) {
+               DEBUG_TRACE (DEBUG::MackieControl, "Timecode reset\n");
+               _timecode_last = string (10, ' ');
+       }
+       _frame_last = current_frame;
 
        switch (_timecode_type) {
        case ARDOUR::AnyTime::BBT:
index 9b08d47d358c0bae469d0fb653bd3e9cf215a4a6..f5db7942516cf42693a7b2b3647682a60a37fba2 100644 (file)
@@ -308,6 +308,7 @@ class MackieControlProtocol
        Mackie::Timer            _frm_left_last;
        // last written timecode string
        std::string              _timecode_last;
+       framepos_t                               _frame_last;
        // Which timecode are we displaying? BBT or Timecode
        ARDOUR::AnyTime::Type    _timecode_type;
        // Bundle to represent our input ports