return;
}
+ if (ARDOUR::Profile->get_mixbus()) {
+ if ( m == MouseZoom) m = MouseObject;
+ if ( m == MouseCut) m = MouseObject;
+ }
+
Glib::RefPtr<Action> act;
switch (m) {
act = ActionManager::get_action (X_("MouseMode"), X_("set-mouse-mode-range"));
break;
+ case MouseCut:
+ act = ActionManager::get_action (X_("MouseMode"), X_("set-mouse-mode-cut"));
+ break;
+
case MouseObject:
act = ActionManager::get_action (X_("MouseMode"), X_("set-mouse-mode-object"));
break;
Glib::RefPtr<Action> act;
Glib::RefPtr<ToggleAction> tact;
+ if (ARDOUR::Profile->get_mixbus()) {
+ if ( m == MouseZoom) m = MouseObject;
+ if ( m == MouseCut) m = MouseObject;
+ }
+
switch (m) {
case MouseRange:
act = ActionManager::get_action (X_("MouseMode"), X_("set-mouse-mode-range"));
act = ActionManager::get_action (X_("MouseMode"), X_("set-mouse-mode-object"));
break;
+ case MouseCut:
+ act = ActionManager::get_action (X_("MouseMode"), X_("set-mouse-mode-cut"));
+ break;
+
case MouseDraw:
act = ActionManager::get_action (X_("MouseMode"), X_("set-mouse-mode-draw"));
break;
instant_save ();
- //TODO: set button styles for smart buttons
-/*
- if ( smart_mode_action->get_active() ) {
- if( mouse_mode == MouseObject ) { //smart active and object active
- smart_mode_button.set_active(1);
- smart_mode_button.set_name("smart mode button");
- mouse_move_button.set_name("smart mode button");
- } else { //smart active but object inactive
- smart_mode_button.set_active(0);
- smart_mode_button.set_name("smart mode button");
- mouse_move_button.set_name("mouse mode button");
- }
- } else {
- smart_mode_button.set_active(0);
- smart_mode_button.set_name("mouse mode button");
- mouse_move_button.set_name("mouse mode button");
+ /* this should generate a new enter event which will
+ trigger the appropiate cursor.
+ */
+
+ if (_track_canvas) {
+ _track_canvas->re_enter ();
}
-*/
-
- reset_canvas_cursor ();
+
set_gain_envelope_visibility ();
update_time_selection_display ();
case MouseRange:
if (next) set_mouse_mode (MouseDraw);
- else set_mouse_mode (MouseObject);
+ else set_mouse_mode (MouseCut);
+ break;
+
+ case MouseCut:
+ if (next) set_mouse_mode (MouseRange);
+ else set_mouse_mode (MouseDraw);
break;
case MouseDraw:
- if (next) set_mouse_mode (MouseZoom);
+ if (next) set_mouse_mode (MouseCut);
else set_mouse_mode (MouseRange);
break;
MouseMode eff_mouse_mode = effective_mouse_mode ();
+ if (eff_mouse_mode == MouseCut) {
+ /* never change selection in cut mode */
+ return;
+ }
+
if (get_smart_mode() && eff_mouse_mode == MouseRange && event->button.button == 3 && item_type == RegionItem) {
/* context clicks are always about object properties, even if
we're in range mode within smart mode.
/* grab selection for moving */
_drags->set (new SelectionDrag (this, item, SelectionDrag::SelectionMove), event);
} else {
- double const y = event->button.y;
- pair<TimeAxisView*, int> tvp = trackview_by_y_position (y);
- if (tvp.first) {
- AutomationTimeAxisView* atv = dynamic_cast<AutomationTimeAxisView*> (tvp.first);
- if ( get_smart_mode() && atv) {
- /* smart "join" mode: drag automation */
- _drags->set (new AutomationRangeDrag (this, atv, selection->time), event, _cursors->up_down);
- } else {
- /* this was debated, but decided the more common action was to
- make a new selection */
- _drags->set (new SelectionDrag (this, item, SelectionDrag::CreateSelection), event);
- }
- }
+ /* this was debated, but decided the more common action was to
+ make a new selection */
+ _drags->set (new SelectionDrag (this, item, SelectionDrag::CreateSelection), event);
}
break;
}
break;
+ case MouseCut:
+ switch (item_type) {
+ case RegionItem:
+ case FadeInHandleItem:
+ case FadeOutHandleItem:
+ case LeftFrameHandle:
+ case RightFrameHandle:
+ case FeatureLineItem:
+ case RegionViewNameHighlight:
+ case RegionViewName:
+ case StreamItem:
+ case AutomationTrackItem:
+ _drags->set (new RegionCutDrag (this, item, canvas_event_sample (event)), event, current_canvas_cursor);
+ return true;
+ break;
+ default:
+ break;
+ }
+ break;
+
case MouseObject:
switch (item_type) {
case NoteItem:
case SelectionItem:
{
- if ( get_smart_mode() ) {
- /* we're in "smart" joined mode, and we've clicked on a Selection */
- double const y = event->button.y;
- pair<TimeAxisView*, int> tvp = trackview_by_y_position (y);
- if (tvp.first) {
- /* if we're over an automation track, start a drag of its data */
- AutomationTimeAxisView* atv = dynamic_cast<AutomationTimeAxisView*> (tvp.first);
- if (atv) {
- _drags->set (new AutomationRangeDrag (this, atv, selection->time), event, _cursors->up_down);
- }
-
- /* if we're over a track and a region, and in the `object' part of a region,
- put a selection around the region and drag both
- */
-/* RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (tvp.first);
- if (rtv && _join_object_range_state == JOIN_OBJECT_RANGE_OBJECT) {
- boost::shared_ptr<Track> t = boost::dynamic_pointer_cast<Track> (rtv->route ());
- if (t) {
- boost::shared_ptr<Playlist> pl = t->playlist ();
- if (pl) {
-
- boost::shared_ptr<Region> r = pl->top_region_at (canvas_event_sample (event));
- if (r) {
- RegionView* rv = rtv->view()->find_view (r);
- clicked_selection = select_range (rv->region()->position(),
- rv->region()->last_frame()+1);
- _drags->add (new SelectionDrag (this, item, SelectionDrag::SelectionMove));
- list<RegionView*> rvs;
- rvs.push_back (rv);
- _drags->add (new RegionMoveDrag (this, item, rv, rvs, false, false));
- _drags->start_grab (event);
- return true;
- }
- }
- }
- }
-*/
- }
- }
break;
}
AudioRegionView* arv = dynamic_cast<AudioRegionView *> (clicked_regionview);
if (arv) {
_drags->set (new AutomationRangeDrag (this, arv, selection->time), event, _cursors->up_down);
- _drags->start_grab (event);
+ } else {
+ double const y = event->button.y;
+ pair<TimeAxisView*, int> tvp = trackview_by_y_position (y);
+ if (tvp.first) {
+ AutomationTimeAxisView* atv = dynamic_cast<AutomationTimeAxisView*> (tvp.first);
+ if ( atv) {
+ /* smart "join" mode: drag automation */
+ _drags->set (new AutomationRangeDrag (this, atv, selection->time), event, _cursors->up_down);
+ }
+ }
}
return true;
break;
}
//not rolling, range mode click + join_play_range : locate the PH here
- if ( !_drags->active () && !_session->transport_rolling() && ( effective_mouse_mode() == MouseRange ) && Config->get_always_play_range() ) {
+ if ( !_drags->active () && !_session->transport_rolling() && ( effective_mouse_mode() == MouseRange ) && Config->get_follow_edits() ) {
framepos_t where = canvas_event_sample (event);
snap_to(where);
_session->request_locate (where, false);
_join_object_range_state = JOIN_OBJECT_RANGE_RANGE;
}
-
if (entered_regionview) {
ArdourCanvas::Duple const item_space = entered_regionview->get_canvas_group()->canvas_to_item (ArdourCanvas::Duple (0, y));
RouteTimeAxisView* entered_route_view = dynamic_cast<RouteTimeAxisView*> (entered_track);
if (entered_route_view) {
- /* track/bus ... but not in a region ... use range mode */
- _join_object_range_state = JOIN_OBJECT_RANGE_RANGE;
- if (_join_object_range_state != old) {
- set_canvas_cursor (which_track_cursor ());
+
+ double cx = 0;
+ double cy = y;
+
+ entered_route_view->canvas_display()->canvas_to_item (cx, cy);
+
+ double track_height = entered_route_view->view()->child_height();
+ if (Config->get_show_name_highlight()) {
+ track_height -= TimeAxisViewItem::NAME_HIGHLIGHT_SIZE;
+ }
+ double const c = cy / track_height;
+
+
+ if (c <= 0.5) {
+ _join_object_range_state = JOIN_OBJECT_RANGE_RANGE;
+ } else {
+ _join_object_range_state = JOIN_OBJECT_RANGE_OBJECT;
}
+
} else {
/* Other kinds of tracks use object mode */
_join_object_range_state = JOIN_OBJECT_RANGE_OBJECT;
- if (_join_object_range_state != old) {
- set_canvas_cursor (which_track_cursor ());
- }
+ }
+
+ if (_join_object_range_state != old) {
+ set_canvas_cursor (which_track_cursor ());
}
}
}