13
0

set playhead sensitivity via config (defaulted insensitive)

* in the 'fake_drag' case (dragging the playhead from the ruler), the
 mouse events are delivered to the playhead during the drag so we need
 to temporarily sensitize the playhead during that operation, then reset
 the sensitivity via config
This commit is contained in:
Ben Loftis 2023-05-01 08:46:00 -05:00
parent dd08d12475
commit 3f15a3a402
2 changed files with 7 additions and 0 deletions

View File

@ -270,6 +270,7 @@ Editor::initialize_canvas ()
transport_marker_bar->Event.connect (sigc::bind (sigc::mem_fun (*this, &Editor::canvas_ruler_bar_event), transport_marker_bar, TransportMarkerBarItem, "transport marker bar")); transport_marker_bar->Event.connect (sigc::bind (sigc::mem_fun (*this, &Editor::canvas_ruler_bar_event), transport_marker_bar, TransportMarkerBarItem, "transport marker bar"));
_playhead_cursor = new EditorCursor (*this, &Editor::canvas_playhead_cursor_event, X_("playhead")); _playhead_cursor = new EditorCursor (*this, &Editor::canvas_playhead_cursor_event, X_("playhead"));
_playhead_cursor->set_sensitive (UIConfiguration::instance().get_sensitize_playhead());
_snapped_cursor = new EditorCursor (*this, X_("snapped")); _snapped_cursor = new EditorCursor (*this, X_("snapped"));

View File

@ -3997,6 +3997,9 @@ CursorDrag::start_grab (GdkEvent* event, Gdk::Cursor* c)
} }
} }
/* during fake-locate, the mouse position is delievered to the (red) playhead line, so we have to momentarily sensitize it */
_editor->playhead_cursor ()->set_sensitive(true);
fake_locate (where.earlier (snap_delta (event->button.state)).samples()); fake_locate (where.earlier (snap_delta (event->button.state)).samples());
_last_mx = event->button.x; _last_mx = event->button.x;
@ -4069,6 +4072,8 @@ CursorDrag::finished (GdkEvent* event, bool movement_occurred)
s->request_locate (_editor->playhead_cursor ()->current_sample (), false, _was_rolling ? MustRoll : RollIfAppropriate); s->request_locate (_editor->playhead_cursor ()->current_sample (), false, _was_rolling ? MustRoll : RollIfAppropriate);
s->request_resume_timecode_transmission (); s->request_resume_timecode_transmission ();
} }
_editor->playhead_cursor ()->set_sensitive(UIConfiguration::instance().get_sensitize_playhead());
} }
void void
@ -4082,6 +4087,7 @@ CursorDrag::aborted (bool)
} }
_editor->playhead_cursor()->set_position (adjusted_time (grab_time (), 0, false).samples()); _editor->playhead_cursor()->set_position (adjusted_time (grab_time (), 0, false).samples());
_editor->playhead_cursor ()->set_sensitive(UIConfiguration::instance().get_sensitize_playhead());
} }
FadeInDrag::FadeInDrag (Editor* e, ArdourCanvas::Item* i, RegionView* p, list<RegionView*> const & v, Temporal::TimeDomain td) FadeInDrag::FadeInDrag (Editor* e, ArdourCanvas::Item* i, RegionView* p, list<RegionView*> const & v, Temporal::TimeDomain td)