return r;
}
+void
+DragManager::mark_double_click ()
+{
+ for (list<Drag*>::const_iterator i = _drags.begin(); i != _drags.end(); ++i) {
+ (*i)->set_double_click (true);
+ }
+}
+
bool
DragManager::motion_handler (GdkEvent* e, bool from_autoscroll)
{
, _item (i)
, _pointer_frame_offset (0)
, _move_threshold_passed (false)
+ , _was_double_click (false)
, _raw_grab_frame (0)
, _grab_frame (0)
, _last_pointer_frame (0)
{
_editor->verbose_cursor()->set_time (
frame,
- _drags->current_pointer_x() + 10 - _editor->horizontal_position(),
- _drags->current_pointer_y() + 10 - _editor->vertical_adjustment.get_value()
+ _drags->current_pointer_x() + 10,
+ _drags->current_pointer_y() + 10
);
_editor->verbose_cursor()->show ();
_editor->verbose_cursor()->set_duration (
start, end,
- _drags->current_pointer_x() + 10 - _editor->horizontal_position(),
- _drags->current_pointer_y() + 10 - _editor->vertical_adjustment.get_value()
+ _drags->current_pointer_x() + 10,
+ _drags->current_pointer_y() + 10
);
}
_editor->verbose_cursor()->set (
text,
- _drags->current_pointer_x() + 10 - _editor->horizontal_position(),
- _drags->current_pointer_y() + 10 - _editor->vertical_adjustment.get_value()
+ _drags->current_pointer_x() + 10,
+ _drags->current_pointer_y() + 10
);
}
RouteTimeAxisView* ra = dynamic_cast<RouteTimeAxisView*> (a);
RouteTimeAxisView* rb = dynamic_cast<RouteTimeAxisView*> (b);
assert (ra && rb);
- return ra->route()->order_key (EditorSort) < rb->route()->order_key (EditorSort);
+ return ra->route()->order_key () < rb->route()->order_key ();
}
};
}
RegionMotionDrag::RegionMotionDrag (Editor* e, ArdourCanvas::Item* i, RegionView* p, list<RegionView*> const & v, bool b)
- : RegionDrag (e, i, p, v),
- _brushing (b),
- _total_x_delta (0)
+ : RegionDrag (e, i, p, v)
+ , _brushing (b)
+ , _total_x_delta (0)
+ , _last_pointer_time_axis_view (0)
+ , _last_pointer_layer (0)
{
DEBUG_TRACE (DEBUG::Drags, "New RegionMotionDrag\n");
}
show_verbose_cursor_time (_last_frame_position);
pair<TimeAxisView*, double> const tv = _editor->trackview_by_y_position (_drags->current_pointer_y ());
- _last_pointer_time_axis_view = find_time_axis_view (tv.first);
- _last_pointer_layer = tv.first->layer_display() == Overlaid ? 0 : tv.second;
+ if (tv.first) {
+ _last_pointer_time_axis_view = find_time_axis_view (tv.first);
+ _last_pointer_layer = tv.first->layer_display() == Overlaid ? 0 : tv.second;
+ }
}
double
/* Find the TimeAxisView that the pointer is now over */
pair<TimeAxisView*, double> const tv = _editor->trackview_by_y_position (_drags->current_pointer_y ());
- if (first_move && tv.first->view()->layer_display() == Stacked) {
- tv.first->view()->set_layer_display (Expanded);
- }
-
/* Bail early if we're not over a track */
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (tv.first);
+
if (!rtv || !rtv->is_track()) {
_editor->verbose_cursor()->hide ();
return;
}
+ if (first_move && tv.first->view()->layer_display() == Stacked) {
+ tv.first->view()->set_layer_display (Expanded);
+ }
+
/* Note: time axis views in this method are often expressed as an index into the _time_axis_views vector */
/* Here's the current pointer position in terms of time axis view and layer */
RegionMotionDrag::aborted (bool)
{
for (vector<TimeAxisView*>::iterator i = _time_axis_views.begin(); i != _time_axis_views.end(); ++i) {
- if ((*i)->view()->layer_display() == Expanded) {
- (*i)->view()->set_layer_display (Stacked);
+
+ StreamView* sview = (*i)->view();
+
+ if (sview) {
+ if (sview->layer_display() == Expanded) {
+ sview->set_layer_display (Stacked);
+ }
}
}
}
framecnt_t dt = adjusted_current_frame (event) - raw_grab_frame() + _pointer_frame_offset;
- dt = ARDOUR_UI::instance()->video_timeline->quantify_frames_to_apv(dt);
+ dt = ARDOUR_UI::instance()->video_timeline->quantify_frames_to_apv(_startdrag_video_offset+dt) - _startdrag_video_offset;
if (_max_backwards_drag >= 0 && dt <= - _max_backwards_drag) {
dt = - _max_backwards_drag;
Session* s = _editor->session ();
if (s->timecode_transmission_suspended ()) {
framepos_t const f = _editor->playhead_cursor->current_frame ();
+ /* This is asynchronous so it will be sent "now"
+ */
s->send_mmc_locate (f);
- s->send_full_time_code (f);
+ /* These are synchronous and will be sent during the next
+ process cycle
+ */
+ s->queue_full_time_code ();
+ s->queue_song_position_pointer ();
}
show_verbose_cursor_time (t);
_grab_zoom = _editor->samples_per_pixel;
- framepos_t where = _editor->canvas_event_frame (event, 0, 0);
+ framepos_t where = _editor->canvas_event_frame (event);
_editor->snap_to_with_modifier (where, event);
MarkerDrag::finished (GdkEvent* event, bool movement_occurred)
{
if (!movement_occurred) {
+
+ if (was_double_click()) {
+ cerr << "End of marker double click\n";
+ }
/* just a click, do nothing but finish
off the selection process