diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-05-10 12:14:26 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-05-10 12:14:26 +0000 |
commit | da7215e1ad6ebcf99cf5874cf676c460dcbb7ee7 (patch) | |
tree | 1baf1513a7040706cebf8acd80a7d8dace35d0ff /gtk2_ardour/editor_drag.cc | |
parent | bed955b40935cf7765829e260b70258b79803890 (diff) |
if an xfade involves only 2 regions, clamp its length to the overlap between them
git-svn-id: svn://localhost/ardour2/branches/3.0@12238 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_drag.cc')
-rw-r--r-- | gtk2_ardour/editor_drag.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index a075008d20..e9ab0d3a60 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -4559,12 +4559,6 @@ CrossfadeEdgeDrag::CrossfadeEdgeDrag (Editor* e, AudioRegionView* rv, ArdourCanv , arv (rv) , start (start_yn) { - cerr << "new xfade drag\n"; -} - -CrossfadeEdgeDrag::~CrossfadeEdgeDrag () -{ - cerr << "destory xfade drag\n"; } void @@ -4590,8 +4584,14 @@ CrossfadeEdgeDrag::motion (GdkEvent*, bool) len = ar->fade_out()->back()->when; } + /* how long should it be ? */ + new_length = len + _editor->unit_to_frame (distance); - + + /* now check with the region that this is legal */ + + new_length = ar->verify_xfade_bounds (new_length, start); + if (start) { arv->redraw_start_xfade_to (ar, new_length); } else { @@ -4616,7 +4616,7 @@ CrossfadeEdgeDrag::finished (GdkEvent*, bool) len = ar->fade_out()->back()->when; } - new_length = len + _editor->unit_to_frame (distance); + new_length = ar->verify_xfade_bounds (len + _editor->unit_to_frame (distance), start); if (start) { ar->set_fade_in_length (new_length); |