summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2012-05-10 12:14:26 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2012-05-10 12:14:26 +0000
commitda7215e1ad6ebcf99cf5874cf676c460dcbb7ee7 (patch)
tree1baf1513a7040706cebf8acd80a7d8dace35d0ff /gtk2_ardour
parentbed955b40935cf7765829e260b70258b79803890 (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')
-rw-r--r--gtk2_ardour/editor_drag.cc16
-rw-r--r--gtk2_ardour/editor_drag.h1
2 files changed, 8 insertions, 9 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);
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);