try to use RCU updating when dragging tempo markers

This commit is contained in:
Paul Davis 2020-11-27 19:16:44 -07:00
parent adacaf3837
commit 42c38d313d
2 changed files with 21 additions and 13 deletions

View File

@ -3545,6 +3545,10 @@ TempoMarkerDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor)
} else {
show_verbose_cursor_time (adjusted_current_time (event));
}
/* setup thread-local tempo map ptr as a writable copy */
TempoMap::fetch_writable ();
}
void
@ -3674,6 +3678,12 @@ TempoMarkerDrag::finished (GdkEvent* event, bool movement_occurred)
if (was_double_click()) {
_editor->edit_tempo_marker (*_marker);
}
/* reset the per-thread tempo map ptr back to the current
* official version
*/
TempoMap::fetch ();
return;
}
@ -3695,9 +3705,13 @@ TempoMarkerDrag::aborted (bool moved)
// _point->end_float ();
_marker->set_position (timepos_t (_marker->tempo().beats()));
/* reset the per-thread tempo map ptr back to the current
* official version
*/
TempoMap::fetch ();
if (moved) {
TempoMap::SharedPtr map (TempoMap::use());
map->set_state (*_before_state, Stateful::current_state_version);
// delete the dummy (hidden) marker we used for events while moving.
delete _marker;
}

View File

@ -633,10 +633,8 @@ ArdourMarker::set_right_label_limit (double p)
TempoMarker::TempoMarker (PublicEditor& editor, ArdourCanvas::Container& parent, guint32 rgba, const string& text,
Temporal::TempoPoint& temp)
#warning NUTEMPO needs new tempo map
// : ArdourMarker (editor, parent, rgba, text, Tempo, temp.sample(), false),
: ArdourMarker (editor, parent, rgba, text, Tempo, timepos_t (), false),
_tempo (temp)
: ArdourMarker (editor, parent, rgba, text, Tempo, temp.time(), false)
, _tempo (temp)
{
group->Event.connect (sigc::bind (sigc::mem_fun (editor, &PublicEditor::canvas_tempo_marker_event), group, this));
}
@ -674,13 +672,9 @@ TempoMarker::reset_tempo (Temporal::TempoPoint & t)
/***********************************************************************/
MeterMarker::MeterMarker (PublicEditor& editor, ArdourCanvas::Container& parent, guint32 rgba, const string& text,
Temporal::MeterPoint& m)
#warning NUTEMPO needs new tempo map
// : ArdourMarker (editor, parent, rgba, text, Meter, m.sample(), false),
: ArdourMarker (editor, parent, rgba, text, Meter, timepos_t(), false),
_meter (m)
MeterMarker::MeterMarker (PublicEditor& editor, ArdourCanvas::Container& parent, guint32 rgba, const string& text, Temporal::MeterPoint& m)
: ArdourMarker (editor, parent, rgba, text, Meter, m.time(), false)
, _meter (m)
{
group->Event.connect (sigc::bind (sigc::mem_fun (editor, &PublicEditor::canvas_meter_marker_event), group, this));
}