_was_rolling = false;
}
- switch (_editor->snap_type()) {
- case SnapToRegionStart:
- case SnapToRegionEnd:
- case SnapToRegionSync:
- case SnapToRegionBoundary:
- _editor->build_region_boundary_cache ();
- break;
- default:
- break;
- }
+// if ( UIConfiguration::instance().get_snap_to_region_start() || UIConfiguration::instance().get_snap_to_region_end() || UIConfiguration::instance().get_snap_to_region_sync() ) {
+// _editor->build_region_boundary_cache ();
+// }
}
/** Call to end a drag `successfully'. Ungrabs item and calls
{
TempoMap& map (_editor->session()->tempo_map());
MusicSample snap (pos);
- _editor->snap_to (snap, ARDOUR::RoundNearest, false, true);
+ _editor->snap_to (snap, ARDOUR::RoundNearest, ARDOUR::SnapToAny_Visual, true);
_snap_delta = snap.sample - pos.sample;
_snap_delta_music = 0.0;
RouteTimeAxisView*
RegionMoveDrag::create_destination_time_axis (boost::shared_ptr<Region> region, TimeAxisView* original)
{
+ if (!ARDOUR_UI_UTILS::engine_is_running ()) {
+ return NULL;
+ }
+
/* Add a new track of the correct type, and return the RouteTimeAxisView that is created to display the
new track.
*/
MeterMarkerDrag::MeterMarkerDrag (Editor* e, ArdourCanvas::Item* i, bool c)
: Drag (e, i)
, _copy (c)
- , _old_snap_type (e->snap_type())
+ , _old_grid_type (e->grid_type())
, _old_snap_mode (e->snap_mode())
, before_state (0)
{
}
/* only snap to bars. leave snap mode alone for audio locked meters.*/
if (_real_section->position_lock_style() != AudioTime) {
- _editor->set_snap_to (SnapToBar);
- _editor->set_snap_mode (SnapNormal);
+ _editor->set_grid_to (GridTypeBar);
+ _editor->set_snap_mode (SnapMagnetic);
}
}
samplepos_t pf = adjusted_current_sample (event);
- if (_real_section->position_lock_style() == AudioTime && _editor->snap_musical()) {
+ if (_real_section->position_lock_style() == AudioTime && _editor->grid_musical()) {
/* never snap to music for audio locked */
pf = adjusted_current_sample (event, false);
}
}
/* reinstate old snap setting */
- _editor->set_snap_to (_old_snap_type);
+ _editor->set_grid_to (_old_grid_type);
_editor->set_snap_mode (_old_snap_mode);
TempoMap& map (_editor->session()->tempo_map());
_marker->set_position (_marker->meter().sample ());
if (moved) {
/* reinstate old snap setting */
- _editor->set_snap_to (_old_snap_type);
+ _editor->set_grid_to (_old_grid_type);
_editor->set_snap_mode (_old_snap_mode);
_editor->session()->tempo_map().set_state (*before_state, Stateful::current_state_version);
} else if (_movable && !_real_section->locked_to_meter()) {
samplepos_t pf;
- if (_editor->snap_musical()) {
+ if (_editor->grid_musical()) {
/* we can't snap to a grid that we are about to move.
* gui_move_tempo() will sort out snap using the supplied beat divisions.
*/
TempoMap& map (_editor->session()->tempo_map());
samplepos_t pf;
- if (_editor->snap_musical()) {
+ if (_editor->grid_musical()) {
pf = adjusted_current_sample (event, false);
} else {
pf = adjusted_current_sample (event);
samplepos_t pf;
- if (_editor->snap_musical()) {
+ if (_editor->grid_musical()) {
pf = adjusted_current_sample (event, false);
} else {
pf = adjusted_current_sample (event);
MusicSample grab (grab_sample (), 0);
if (UIConfiguration::instance().get_rubberbanding_snaps_to_grid ()) {
- _editor->snap_to_with_modifier (grab, event);
+ _editor->snap_to_with_modifier (grab, event, RoundNearest, SnapToGrid_Scaled);
} else {
grab.sample = raw_grab_sample ();
}
/* XXX what if its a music time selection? */
if (s) {
- if (s->get_play_range() && s->transport_rolling()) {
- s->request_play_range (&_editor->selection->time, true);
- } else if (!s->config.get_external_sync()) {
- if (UIConfiguration::instance().get_follow_edits() && !s->transport_rolling()) {
- s->request_locate (_editor->get_selection().time.start());
+
+ //if Follow Edits is on, maybe try to follow the range selection ... also consider range-audition mode
+ if ( !s->config.get_external_sync() && s->transport_rolling() ) {
+ if ( s->solo_selection_active() ) {
+ _editor->play_solo_selection(true); //play the newly selected range, and move solos to match
+ } else if ( UIConfiguration::instance().get_follow_edits() && s->get_play_range() ) { //already rolling a selected range
+ s->request_play_range (&_editor->selection->time, true); //play the newly selected range
}
+ } else if ( !s->transport_rolling() && UIConfiguration::instance().get_follow_edits() ) {
+ s->request_locate (_editor->get_selection().time.start());
}
if (_editor->get_selection().time.length() != 0) {
/* possibly snap and return corresponding delta in quarter notes */
MusicSample snap (st, 0);
- _editor->snap_to_with_modifier (snap, event);
+ _editor->snap_to_with_modifier (snap, event, RoundNearest, SnapToGrid_Unscaled);
double ret = map.exact_qn_at_sample (snap.sample, snap.division) - n_qn - snap_delta_music (event->button.state);
/* prevent the earliest note being dragged earlier than the region's start position */
return;
}
- _editor->split_regions_at (pos, rs, false);
+ _editor->split_regions_at (pos, rs);
}
void