Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
assert (tact);
- set_mouse_mode(m, true); //call this so the button styles can get updated
+ set_mouse_mode (m, true); // call this so the button styles can get updated
}
bool
}
RCOptionEditor* rc_option_editor = ARDOUR_UI::instance()->get_rc_option_editor();
- if ( rc_option_editor ) {
+ if (rc_option_editor) {
ARDOUR_UI::instance()->show_tabbable (rc_option_editor);
rc_option_editor->set_current_page (_("Editor/Snap"));
}
-static Glib::RefPtr<Action>
-get_mouse_mode_action(MouseMode m)
+Glib::RefPtr<Action>
+Editor::get_mouse_mode_action(MouseMode m) const
{
switch (m) {
case MouseRange:
}
if (ARDOUR::Profile->get_mixbus()) {
- if ( m == MouseCut) m = MouseObject;
+ if (m == MouseCut) m = MouseObject;
+ if (m == MouseAudition) m = MouseRange;
}
Glib::RefPtr<Action> act = get_mouse_mode_action(m);
tact->set_active (false);
tact->set_active (true);
- //NOTE: this will result in a call to mouse_mode_toggled which does the heavy lifting
+ /* NOTE: this will result in a call to mouse_mode_toggled which does the heavy lifting */
}
void
Editor::mouse_mode_toggled (MouseMode m)
{
if (ARDOUR::Profile->get_mixbus()) {
- if ( m == MouseCut) m = MouseObject;
+ if (m == MouseCut) m = MouseObject;
+ if (m == MouseAudition) m = MouseRange;
}
Glib::RefPtr<Action> act = get_mouse_mode_action(m);
/* Switch snap type/mode if we're moving to/from an internal tool. Note
this must toggle the actions and not call set_snap_*() directly,
otherwise things get out of sync and the combo box stops working. */
- if (!was_internal && internal_editing()) {
+ if (!UIConfiguration::instance().get_grid_follows_internal()) {
+ grid_type_action(pre_internal_grid_type)->set_active(true);
+ snap_mode_action(pre_internal_snap_mode)->set_active(true);
+ } else if (!was_internal && internal_editing()) {
grid_type_action(internal_grid_type)->set_active(true);
snap_mode_action(internal_snap_mode)->set_active(true);
} else if (was_internal && !internal_editing()) {
break;
case StreamItem:
- //in the past, we created a new midi region here, but perhaps that is best left to the Draw mode
+ /* in the past, we created a new midi region here, but perhaps that is best left to the Draw mode */
break;
case AutomationTrackItem:
case StartCrossFadeItem:
case EndCrossFadeItem:
- /* we might allow user to grab inside the fade to trim a region with preserve_fade_anchor. for not this is not fully implemented */
-// if (!clicked_regionview->region()->locked()) {
-// _drags->set (new TrimDrag (this, item, clicked_regionview, selection->regions.by_layer(), true), event);
-// return true;
-// }
+ /* we might allow user to grab inside the fade to trim a region with preserve_fade_anchor.
+ * For not this is not fully implemented */
+#if 0
+ if (!clicked_regionview->region()->locked()) {
+ _drags->set (new TrimDrag (this, item, clicked_regionview, selection->regions.by_layer(), true), event);
+ return true;
+ }
+#endif
break;
case FeatureLineItem:
pair<TimeAxisView*, int> tvp = trackview_by_y_position (y, false);
if (tvp.first) {
AutomationTimeAxisView* atv = dynamic_cast<AutomationTimeAxisView*> (tvp.first);
- if ( atv) {
+ if (atv) {
/* smart "join" mode: drag automation */
_drags->set (new AutomationRangeDrag (this, atv, selection->time), event, _cursors->up_down);
}
if ((item_type != FadeInHandleItem) &&
(item_type != FadeOutHandleItem) &&
- !_drags->active () &&
- _session &&
- !_session->transport_rolling() &&
- (effective_mouse_mode() == MouseRange) &&
- UIConfiguration::instance().get_follow_edits() &&
+ !_drags->active () &&
+ _session &&
+ !_session->transport_rolling() &&
+ (effective_mouse_mode() == MouseRange) &&
+ UIConfiguration::instance().get_follow_edits() &&
!_session->config.get_external_sync()) {
MusicSample where (canvas_event_sample (event), 0);
case MarkerBarItem:
if (!_dragging_playhead) {
- snap_to_with_modifier (where, event, RoundNearest, SnapToAny, true);
+ snap_to_with_modifier (where, event, RoundNearest, SnapToGrid_Scaled);
mouse_add_new_marker (where.sample);
}
return true;
case CdMarkerBarItem:
if (!_dragging_playhead) {
- // if we get here then a dragged range wasn't done
- snap_to_with_modifier (where, event, RoundNearest, SnapToAny, true);
+ /* if we get here then a dragged range wasn't done */
+ snap_to_with_modifier (where, event, RoundNearest, SnapToGrid_Scaled);
mouse_add_new_marker (where.sample, true);
}
return true;
} else if (Keyboard::modifier_state_equals (event->button.state, Keyboard::ModifierMask (Keyboard::TertiaryModifier|Keyboard::SecondaryModifier))) {
lower_region ();
} else {
- // Button2 click is unused
+ /* Button2 click is unused */
}
return true;
update_join_object_range_location (event->motion.y);
- //snapped_cursor stuff ( the snapped_cursor shows where an operation is going to occur )
- bool ignored;
- MusicSample where (0, 0);
- if (mouse_sample (where.sample, ignored)) {
- snap_to_with_modifier (where, event);
- set_snapped_cursor_position (where.sample);
- }
-
- //drags might also change the snapped_cursor location, because we are snapping the thing being dragged, not the actual mouse cursor
if (_drags->active ()) {
+ //drags change the snapped_cursor location, because we are snapping the thing being dragged, not the actual mouse cursor
return _drags->motion_handler (event, from_autoscroll);
+ } else {
+ //the snapped_cursor shows where an operation (like Split) is going to occur
+ bool ignored;
+ MusicSample where (0, 0);
+ if (mouse_sample (where.sample, ignored)) {
+ snap_to_with_modifier (where, event);
+ set_snapped_cursor_position (where.sample);
+ }
}
return false;
if (Keyboard::modifier_state_contains (event->state, Keyboard::PrimaryModifier)) {
TimeAxisView* tv = &rv.get_time_axis_view();
- RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*>(tv);
samplepos_t where = get_preferred_edit_position();
playlist->add_region (new_region, pos);
_session->add_command (new StatefulDiffCommand (playlist));
- // playlist is frozen, so we have to update manually XXX this is disgusting
+ /* playlist is frozen, so we have to update manually XXX this is disgusting */
//playlist->RegionAdded (new_region); /* EMIT SIGNAL */
}
_drags->abort ();
} else {
selection->clear ();
+
+ /* if session is playing a range, cancel that */
+ if (_session->get_play_range()) {
+ _session->request_cancel_play_range();
+ }
+
+ if (_session->solo_selection_active()) {
+ StripableList sl;
+ _session->solo_selection (sl, false);
+ }
}
ARDOUR_UI::instance()->reset_focus (&contents());
if (entered_regionview) {
- //ToDo: there is currently a bug here(?)
- //when we are inside a region fade handle, it acts as though we are in range mode because it is in the top half of the region
- //can it be fixed here?
+ /* TODO: there is currently a bug here(?)
+ * when we are inside a region fade handle, it acts as though we are in range mode because it is in the top half of the region
+ * can it be fixed here?
+ */
ArdourCanvas::Duple const item_space = entered_regionview->get_canvas_group()->canvas_to_item (ArdourCanvas::Duple (0, y));
double const c = item_space.y / entered_regionview->height();