switch (item_type) {
case RegionItem:
- if (mouse_mode != MouseRange) {
- commit = set_selected_regionview_from_click (press, op, true);
- } else if (event->type == GDK_BUTTON_PRESS) {
- commit = set_selected_track_from_click (press, op, false);
- }
- break;
-
case RegionViewNameHighlight:
case RegionViewName:
- if (mouse_mode != MouseRange) {
- commit = set_selected_regionview_from_click (press, op, true);
- } else if (event->type == GDK_BUTTON_PRESS) {
- commit = set_selected_track_from_click (press, op, false);
- }
- break;
-
case FadeInHandleItem:
case FadeInItem:
case FadeOutHandleItem:
commit = set_selected_track_from_click (press, op, false);
}
break;
-
+
+ case CrossfadeViewItem:
+ commit = set_selected_track_from_click (press, op, false);
+ break;
+
case GainAutomationControlPointItem:
case PanAutomationControlPointItem:
case RedirectAutomationControlPointItem:
start_rubberband_select (item, event);
break;
- /* <CMT Additions> */
+#ifdef WITH_CMT
case ImageFrameHandleStartItem:
imageframe_start_handle_op(item, event) ;
return(true) ;
markerview_item_end_handle_op(item, event) ;
return(true) ;
break ;
- /* </CMT Additions> */
-
- /* <CMT Additions> */
case MarkerViewItem:
start_markerview_grab(item, event) ;
break ;
case ImageFrameItem:
start_imageframe_grab(item, event) ;
break ;
- /* </CMT Additions> */
+#endif
case MarkerBarItem:
break;
case StreamItem:
- popup_track_context_menu (1, event->button.time, item_type, false, where);
- break;
-
case RegionItem:
case RegionViewNameHighlight:
case RegionViewName:
- popup_track_context_menu (1, event->button.time, item_type, false, where);
- break;
-
case SelectionItem:
- popup_track_context_menu (1, event->button.time, item_type, true, where);
- break;
-
case AutomationTrackItem:
- popup_track_context_menu (1, event->button.time, item_type, false, where);
+ case CrossfadeViewItem:
+ popup_track_context_menu (1, event->button.time, where);
break;
case MarkerBarItem:
tm_marker_context_menu (&event->button, item);
break;
- case CrossfadeViewItem:
- popup_track_context_menu (1, event->button.time, item_type, false, where);
- break;
-
- /* <CMT Additions> */
+#ifdef WITH_CMT
case ImageFrameItem:
popup_imageframe_edit_menu(1, event->button.time, item, true) ;
break ;
case MarkerTimeAxisItem:
popup_marker_time_axis_edit_menu(1, event->button.time, item, false) ;
break ;
- /* <CMT Additions> */
-
+#endif
default:
break;
case 2:
switch (mouse_mode) {
- case MouseObject:
- switch (item_type) {
- case RegionItem:
- if (Keyboard::modifier_state_equals (event->button.state, Keyboard::Shift)) {
- raise_region ();
- } else if (Keyboard::modifier_state_equals (event->button.state, Keyboard::ModifierMask (Keyboard::Shift|Keyboard::Alt))) {
- lower_region ();
- } else {
- // Button2 click is unused
- }
- return true;
-
- break;
-
- default:
- break;
- }
- break;
-
case MouseRange:
// x_style_paste (where, 1.0);
at_x += 20.0;
at_y += 20.0;
- fraction = 1.0 - (cp->get_y() / cp->line.height());
+ fraction = 1.0 - ((cp->get_y() - cp->line.y_position()) / cp->line.height());
set_verbose_canvas_cursor (cp->line.get_verbose_cursor_string (fraction), at_x, at_y);
show_verbose_canvas_cursor ();
case StartSelectionTrimItem:
case EndSelectionTrimItem:
- /* <CMT Additions> */
+
+#ifdef WITH_CMT
case ImageFrameHandleStartItem:
case ImageFrameHandleEndItem:
case MarkerViewHandleStartItem:
case MarkerViewHandleEndItem:
- /* </CMT Additions> */
+#endif
if (is_drawable()) {
track_canvas.get_window()->set_cursor (*trimmer_cursor);
case EndSelectionTrimItem:
case EditCursorItem:
case PlayheadCursorItem:
- /* <CMT Additions> */
+
+#ifdef WITH_CMT
case ImageFrameHandleStartItem:
case ImageFrameHandleEndItem:
case MarkerViewHandleStartItem:
case MarkerViewHandleEndItem:
- /* </CMT Additions> */
+#endif
+
if (is_drawable()) {
track_canvas.get_window()->set_cursor (*current_canvas_cursor);
}
case PanAutomationLineItem:
case FadeInHandleItem:
case FadeOutHandleItem:
- /* <CMT Additions> */
+
+#ifdef WITH_CMT
case ImageFrameHandleStartItem:
case ImageFrameHandleEndItem:
case MarkerViewHandleStartItem:
case MarkerViewHandleEndItem:
- /* </CMT Additions> */
+#endif
+
if (drag_info.item && (event->motion.state & Gdk::BUTTON1_MASK ||
(event->motion.state & Gdk::BUTTON2_MASK))) {
if (!from_autoscroll) {
Editor::start_control_point_grab (ArdourCanvas::Item* item, GdkEvent* event)
{
ControlPoint* control_point;
-
+
if ((control_point = reinterpret_cast<ControlPoint *> (item->get_data ("control_point"))) == 0) {
fatal << _("programming error: control point canvas item has no control point object pointer!") << endmsg;
/*NOTREACHED*/
control_point->line.start_drag (control_point, drag_info.grab_frame, 0);
- float fraction = 1.0 - (control_point->get_y() / control_point->line.height());
+ float fraction = 1.0 - ((control_point->get_y() - control_point->line.y_position()) / control_point->line.height());
set_verbose_canvas_cursor (control_point->line.get_verbose_cursor_string (fraction),
drag_info.current_pointer_x + 20, drag_info.current_pointer_y + 20);
cx = max (0.0, cx);
cy = max (0.0, cy);
- cy = min ((double) cp->line.height(), cy);
+ cy = min ((double) (cp->line.y_position() + cp->line.height()), cy);
//translate cx to frames
nframes_t cx_frames = unit_to_frame (cx);
snap_to (cx_frames);
}
- float fraction = 1.0 - (cy / cp->line.height());
-
+ float const fraction = 1.0 - ((cy - cp->line.y_position()) / cp->line.height());
+
bool push;
if (Keyboard::modifier_state_contains (event->button.state, Keyboard::Control)) {
start_grab (event, fader_cursor);
- double fraction = 1.0 - (cy / line->height());
+ double const fraction = 1.0 - ((cy - line->y_position()) / line->height());
line->start_drag (0, drag_info.grab_frame, fraction);
line->parent_group().w2i (cx, cy);
- double fraction;
- fraction = 1.0 - (cy / line->height());
+ double const fraction = 1.0 - ((cy - line->y_position()) / line->height());
bool push;
tvp2 = trackview_by_y_position (iy1 + y_delta);
temp_rtv = dynamic_cast<RouteTimeAxisView*>(tvp2);
- rv->set_height (temp_rtv->height);
+ rv->set_y_position_and_height (0, temp_rtv->height);
/* if you un-comment the following, the region colours will follow the track colours whilst dragging,
personally, i think this can confuse things, but never mind.
motion handler.
*/
- if (drag_info.first_move) {
+ if (drag_info.first_move && !(drag_info.copy && drag_info.x_constrained)) {
/* just a click */
goto out;
}
boost::shared_ptr<Playlist> from_playlist = rv->region()->playlist();
boost::shared_ptr<Playlist> to_playlist = rtv2->playlist();
-
+
where = (nframes_t) (unit_to_frame (ix1) * speed);
boost::shared_ptr<Region> new_region (RegionFactory::create (rv->region()));
rv = (*i);
- if (rv->region()->locked()) {
+ if (!rv->region()->can_move()) {
continue;
}
-
if (regionview_x_movement) {
double ownspeed = 1.0;
}
/* add it */
-
+
latest_regionview = 0;
sigc::connection c = rtv->view()->RegionViewAdded.connect (mem_fun(*this, &Editor::collect_new_region_view));
to_playlist->add_region (newregion, (nframes_t) (where * rtv->get_diskstream()->speed()));
selection->add (latest_regionview);
}
- /* if the original region was locked, we don't care for the new one */
-
- newregion->set_locked (false);
-
} else {
/* just change the model */