diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2014-06-26 15:07:29 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2014-06-26 15:10:24 -0400 |
commit | 4e689d9496394e7218e1b09d0cef2a61f3791b62 (patch) | |
tree | 1f6e11cdc7c55df744e739e7792a1bd50590afbe /gtk2_ardour/editor_drag.cc | |
parent | 3accf1d2af0834cb2c13df0e6de085a2ce7d521c (diff) |
use new TrackingText for verbose cursor
Diffstat (limited to 'gtk2_ardour/editor_drag.cc')
-rw-r--r-- | gtk2_ardour/editor_drag.cc | 68 |
1 files changed, 13 insertions, 55 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 05e24fa84c..c4000ddd45 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -406,58 +406,22 @@ Drag::abort () void Drag::show_verbose_cursor_time (framepos_t frame) { - /* We use DragManager::current_pointer_y() here - because we need to position the verbose canvas - cursor within the overall canvas, regardless - of this particular drag's _trackview_only - setting. - */ - - _editor->verbose_cursor()->set_time ( - frame, - _drags->current_pointer_x() + 10, - _drags->current_pointer_y() + 10 - ); - + _editor->verbose_cursor()->set_time (frame); _editor->verbose_cursor()->show (); } void -Drag::show_verbose_cursor_duration (framepos_t start, framepos_t end, double xoffset) +Drag::show_verbose_cursor_duration (framepos_t start, framepos_t end, double /*xoffset*/) { - _editor->verbose_cursor()->show (xoffset); - - /* We use DragManager::current_pointer_y() here - because we need to position the verbose canvas - cursor within the overall canvas, regardless - of this particular drag's _trackview_only - setting. - */ - - _editor->verbose_cursor()->set_duration ( - start, end, - _drags->current_pointer_x() + 10, - _drags->current_pointer_y() + 10 - ); + _editor->verbose_cursor()->set_duration (start, end); + _editor->verbose_cursor()->show (); } void Drag::show_verbose_cursor_text (string const & text) { + _editor->verbose_cursor()->set (text); _editor->verbose_cursor()->show (); - - /* We use DragManager::current_pointer_y() here - because we need to position the verbose canvas - cursor within the overall canvas, regardless - of this particular drag's _trackview_only - setting. - */ - - _editor->verbose_cursor()->set ( - text, - _drags->current_pointer_x() + 10, - _drags->current_pointer_y() + 10 - ); } boost::shared_ptr<Region> @@ -1533,6 +1497,8 @@ RegionSpliceDrag::motion (GdkEvent* event, bool) */ _editor->verbose_cursor()->hide (); return; + } else { + _editor->verbose_cursor()->show (); } int dir; @@ -1798,8 +1764,7 @@ VideoTimeLineDrag::start_grab (GdkEvent* event, Gdk::Cursor*) Timecode::Time timecode; _editor->session()->sample_to_timecode(abs(_startdrag_video_offset), timecode, true /* use_offset */, false /* use_subframes */ ); snprintf (buf, sizeof (buf), "Video Start:\n%c%02" PRId32 ":%02" PRId32 ":%02" PRId32 ":%02" PRId32, (_startdrag_video_offset<0?'-':' '), timecode.hours, timecode.minutes, timecode.seconds, timecode.frames); - _editor->verbose_cursor()->set(buf, event->button.x + 10, event->button.y + 10); - _editor->verbose_cursor()->show (); + show_verbose_cursor_text (buf); } void @@ -1848,8 +1813,7 @@ VideoTimeLineDrag::motion (GdkEvent* event, bool first_move) , _("Diff:"), (dt<0?'-':' '), timediff.hours, timediff.minutes, timediff.seconds, timediff.frames ); - _editor->verbose_cursor()->set(buf, event->button.x + 10, event->button.y + 10); - _editor->verbose_cursor()->show (); + show_verbose_cursor_text (buf); } void @@ -3288,10 +3252,7 @@ ControlPointDrag::start_grab (GdkEvent* event, Gdk::Cursor* /*cursor*/) _point->line().start_drag_single (_point, _fixed_grab_x, fraction); - _editor->verbose_cursor()->set (_point->line().get_verbose_cursor_string (fraction), - event->button.x + 10, event->button.y + 10); - - _editor->verbose_cursor()->show (); + show_verbose_cursor_text (_point->line().get_verbose_cursor_string (fraction)); _pushing = Keyboard::modifier_state_contains (event->button.state, Keyboard::PrimaryModifier); @@ -3351,7 +3312,7 @@ ControlPointDrag::motion (GdkEvent* event, bool) _point->line().drag_motion (_editor->sample_to_pixel_unrounded (cx_frames), fraction, false, _pushing, _final_index); - _editor->verbose_cursor()->set_text (_point->line().get_verbose_cursor_string (fraction)); + show_verbose_cursor_text (_point->line().get_verbose_cursor_string (fraction)); } void @@ -3437,10 +3398,7 @@ LineDrag::start_grab (GdkEvent* event, Gdk::Cursor* /*cursor*/) _line->start_drag_line (before, after, fraction); - _editor->verbose_cursor()->set (_line->get_verbose_cursor_string (fraction), - event->button.x + 10, event->button.y + 10); - - _editor->verbose_cursor()->show (); + show_verbose_cursor_text (_line->get_verbose_cursor_string (fraction)); } void @@ -3465,7 +3423,7 @@ LineDrag::motion (GdkEvent* event, bool) /* we are ignoring x position for this drag, so we can just pass in anything */ _line->drag_motion (0, fraction, true, false, ignored); - _editor->verbose_cursor()->set_text (_line->get_verbose_cursor_string (fraction)); + show_verbose_cursor_text (_line->get_verbose_cursor_string (fraction)); } void |