13
0

Remove unnecessary snap in Editor::single_*_trim, as the passed-in delta is already snapped. Should fix #1279.

git-svn-id: svn://localhost/ardour2/branches/3.0@7036 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2010-05-01 23:36:15 +00:00
parent c5e4e8fdd9
commit 13003cd9d9
3 changed files with 9 additions and 21 deletions

View File

@ -1675,9 +1675,9 @@ public:
/* trimming */
void point_trim (GdkEvent *, nframes64_t);
void single_contents_trim (RegionView&, nframes64_t, bool, bool, bool);
void single_start_trim (RegionView&, nframes64_t, bool, bool, bool);
void single_end_trim (RegionView&, nframes64_t, bool, bool, bool);
void single_contents_trim (RegionView&, nframes64_t, bool, bool);
void single_start_trim (RegionView&, nframes64_t, bool, bool);
void single_end_trim (RegionView&, nframes64_t, bool, bool);
void thaw_region_after_trim (RegionView& rv);

View File

@ -1739,7 +1739,6 @@ TrimDrag::motion (GdkEvent* event, bool first_move)
nframes64_t frame_delta = 0;
bool left_direction;
bool obey_snap = event ? !Keyboard::modifier_state_contains (event->button.state, Keyboard::snap_modifier()) : false;
/* snap modifier works differently here..
its current state has to be passed to the
@ -1822,7 +1821,7 @@ TrimDrag::motion (GdkEvent* event, bool first_move)
} else {
for (list<DraggingView>::const_iterator i = _views.begin(); i != _views.end(); ++i) {
_editor->single_start_trim (*i->view, frame_delta, left_direction, obey_snap, non_overlap_trim);
_editor->single_start_trim (*i->view, frame_delta, left_direction, non_overlap_trim);
}
break;
}
@ -1833,7 +1832,7 @@ TrimDrag::motion (GdkEvent* event, bool first_move)
} else {
for (list<DraggingView>::const_iterator i = _views.begin(); i != _views.end(); ++i) {
_editor->single_end_trim (*i->view, frame_delta, left_direction, obey_snap, non_overlap_trim);
_editor->single_end_trim (*i->view, frame_delta, left_direction, non_overlap_trim);
}
break;
}
@ -1847,7 +1846,7 @@ TrimDrag::motion (GdkEvent* event, bool first_move)
}
for (list<DraggingView>::const_iterator i = _views.begin(); i != _views.end(); ++i) {
_editor->single_contents_trim (*i->view, frame_delta, left_direction, swap_direction, obey_snap);
_editor->single_contents_trim (*i->view, frame_delta, left_direction, swap_direction);
}
}
break;

View File

@ -2119,7 +2119,7 @@ Editor::cancel_selection ()
void
Editor::single_contents_trim (RegionView& rv, nframes64_t frame_delta, bool left_direction, bool swap_direction, bool obey_snap)
Editor::single_contents_trim (RegionView& rv, nframes64_t frame_delta, bool left_direction, bool swap_direction)
{
boost::shared_ptr<Region> region (rv.region());
@ -2151,15 +2151,12 @@ Editor::single_contents_trim (RegionView& rv, nframes64_t frame_delta, bool left
}
}
if (obey_snap) {
snap_to (new_bound);
}
region->trim_start ((nframes64_t) (new_bound * speed), this);
rv.region_changed (PropertyChange (ARDOUR::Properties::start));
}
void
Editor::single_start_trim (RegionView& rv, nframes64_t frame_delta, bool left_direction, bool obey_snap, bool no_overlap)
Editor::single_start_trim (RegionView& rv, nframes64_t frame_delta, bool left_direction, bool no_overlap)
{
boost::shared_ptr<Region> region (rv.region());
@ -2183,10 +2180,6 @@ Editor::single_start_trim (RegionView& rv, nframes64_t frame_delta, bool left_di
new_bound = (nframes64_t) (region->position()/speed) + frame_delta;
}
if (obey_snap) {
snap_to (new_bound, (left_direction ? 0 : 1));
}
nframes64_t pre_trim_first_frame = region->first_frame();
region->trim_front ((nframes64_t) (new_bound * speed), this);
@ -2214,7 +2207,7 @@ Editor::single_start_trim (RegionView& rv, nframes64_t frame_delta, bool left_di
}
void
Editor::single_end_trim (RegionView& rv, nframes64_t frame_delta, bool left_direction, bool obey_snap, bool no_overlap)
Editor::single_end_trim (RegionView& rv, nframes64_t frame_delta, bool left_direction, bool no_overlap)
{
boost::shared_ptr<Region> region (rv.region());
@ -2238,10 +2231,6 @@ Editor::single_end_trim (RegionView& rv, nframes64_t frame_delta, bool left_dire
new_bound = (nframes64_t) ((region->last_frame() + 1)/speed) + frame_delta;
}
if (obey_snap) {
snap_to (new_bound);
}
nframes64_t pre_trim_last_frame = region->last_frame();
region->trim_end ((nframes64_t) (new_bound * speed), this);