diff options
author | Robin Gareus <robin@gareus.org> | 2017-03-31 14:11:49 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-03-31 14:16:04 +0200 |
commit | a534258594cfee7b4d40636477674d17d9ea1bda (patch) | |
tree | 43d7dabac3a9f6c1ec442d85344507179b457423 | |
parent | f2c0b0ee3f4648d6306095a0232a2a1e499ea04f (diff) |
Reset Playhead interpolation when looping and locating
-rw-r--r-- | gtk2_ardour/editor.cc | 16 | ||||
-rw-r--r-- | gtk2_ardour/editor.h | 1 |
2 files changed, 15 insertions, 2 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 32cc192233..ed8fe2f235 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -1388,6 +1388,7 @@ Editor::set_session (Session *t) _session->StepEditStatusChange.connect (_session_connections, invalidator (*this), boost::bind (&Editor::step_edit_status_change, this, _1), gui_context()); _session->TransportStateChange.connect (_session_connections, invalidator (*this), boost::bind (&Editor::map_transport_state, this), gui_context()); + _session->TransportLooped.connect (_session_connections, invalidator (*this), boost::bind (&Editor::transport_looped, this), gui_context()); _session->PositionChanged.connect (_session_connections, invalidator (*this), boost::bind (&Editor::map_position_change, this, _1), gui_context()); _session->vca_manager().VCAAdded.connect (_session_connections, invalidator (*this), boost::bind (&Editor::add_vcas, this, _1), gui_context()); _session->RouteAdded.connect (_session_connections, invalidator (*this), boost::bind (&Editor::add_routes, this, _1), gui_context()); @@ -3448,6 +3449,15 @@ Editor::map_transport_state () update_loop_range_view (); } +void +Editor::transport_looped () +{ + /* reset Playhead position interpolation. + * see Editor::super_rapid_screen_update + */ + _last_update_time = 0; +} + /* UNDO/REDO */ void @@ -5237,6 +5247,7 @@ Editor::located () _pending_locate_request = false; _pending_initial_locate = false; + _last_update_time = 0; } void @@ -5797,7 +5808,8 @@ Editor::super_rapid_screen_update () return; } - framepos_t frame = _session->audible_frame(); + bool latent_locate = false; + framepos_t frame = _session->audible_frame (&latent_locate); const int64_t now = g_get_monotonic_time (); double err = 0; @@ -5820,7 +5832,7 @@ Editor::super_rapid_screen_update () _err_screen_engine = 0; } - if (err > 8192) { + if (err > 8192 || latent_locate) { // in case of x-runs or freewheeling _last_update_time = 0; } else { diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 7f6d7ab2af..d203dd249f 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -559,6 +559,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD protected: void map_transport_state (); void map_position_change (framepos_t); + void transport_looped (); void on_realize(); |