From 13f05dc115ee9178b487289cf3c45d62a3ee0793 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 20 Sep 2010 13:36:53 +0000 Subject: [PATCH] carl's patch for #3461, applied to 2.X git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@7812 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/audio_streamview.cc | 3 +++ libs/ardour/curve.cc | 21 +++++++++++---------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/gtk2_ardour/audio_streamview.cc b/gtk2_ardour/audio_streamview.cc index 8d12fef2c2..753a252bc1 100644 --- a/gtk2_ardour/audio_streamview.cc +++ b/gtk2_ardour/audio_streamview.cc @@ -378,6 +378,8 @@ AudioStreamView::redisplay_diskstream () list::iterator i, tmp; list::iterator xi, tmpx; + cerr << "REDISPLAY diskstream\n"; + for (i = region_views.begin(); i != region_views.end(); ++i) { (*i)->set_valid (false); } @@ -424,6 +426,7 @@ AudioStreamView::redisplay_diskstream () /* now fix layering */ for (RegionViewList::iterator i = region_views.begin(); i != region_views.end(); ++i) { + cerr << "Layering call for " << (*i)->region()->name() << endl; region_layered (*i); } } diff --git a/libs/ardour/curve.cc b/libs/ardour/curve.cc index f2ab337cb8..94b6ed8530 100644 --- a/libs/ardour/curve.cc +++ b/libs/ardour/curve.cc @@ -312,7 +312,7 @@ Curve::_get_vector (double x0, double x1, float *vec, int64_t veclen) return; } - if (npoints == 1 ) { + if (npoints == 1) { for (i = 0; i < veclen; ++i) { vec[i] = events.front()->value; @@ -355,17 +355,18 @@ Curve::_get_vector (double x0, double x1, float *vec, int64_t veclen) rx = lx; + /* note: if there are veclen elements in the output, + there are only veclen-1 steps between them. + */ + if (veclen > 1) { - - /* note: if there are veclen elements in the output, - there are only veclen-1 steps between them. - */ - dx = (hx - lx) / (veclen-1); - - for (i = 0; i < veclen; ++i, rx += dx) { - vec[i] = multipoint_eval (rx); - } + } else { + dx = 0; + } + + for (i = 0; i < veclen; ++i, rx += dx) { + vec[i] = multipoint_eval (rx); } }