From da7215e1ad6ebcf99cf5874cf676c460dcbb7ee7 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 10 May 2012 12:14:26 +0000 Subject: 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 --- gtk2_ardour/editor_drag.cc | 16 ++++++++-------- gtk2_ardour/editor_drag.h | 1 - 2 files changed, 8 insertions(+), 9 deletions(-) (limited to 'gtk2_ardour') 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); diff --git a/gtk2_ardour/editor_drag.h b/gtk2_ardour/editor_drag.h index 70ec45ac99..724c2eb355 100644 --- a/gtk2_ardour/editor_drag.h +++ b/gtk2_ardour/editor_drag.h @@ -978,7 +978,6 @@ class CrossfadeEdgeDrag : public Drag { public: CrossfadeEdgeDrag (Editor*, AudioRegionView*, ArdourCanvas::Item*, bool start); - ~CrossfadeEdgeDrag (); void start_grab (GdkEvent*, Gdk::Cursor* c = 0); void motion (GdkEvent*, bool); -- cgit v1.2.3