diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2007-05-29 23:42:35 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2007-05-29 23:42:35 +0000 |
commit | 77f03c5a272da44d1bff43303a696e91f07e8bc3 (patch) | |
tree | db881ad16d2ac899f20202777992ff595e4f2ed9 /libs | |
parent | 89b76d122c16c97d653479c17054286da25c9e88 (diff) |
fix some (all? not likely) problems with dragging close to 2^32-1 frames
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@1924 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/ardour/curve.h | 8 | ||||
-rw-r--r-- | libs/ardour/curve.cc | 22 | ||||
-rw-r--r-- | libs/ardour/route.cc | 25 |
3 files changed, 30 insertions, 25 deletions
diff --git a/libs/ardour/ardour/curve.h b/libs/ardour/ardour/curve.h index dd63439f08..5b725f4720 100644 --- a/libs/ardour/ardour/curve.h +++ b/libs/ardour/ardour/curve.h @@ -52,8 +52,8 @@ class Curve : public AutomationList Curve (const Curve& other, double start, double end); Curve (const XMLNode&); - bool rt_safe_get_vector (double x0, double x1, float *arg, int32_t veclen); - void get_vector (double x0, double x1, float *arg, int32_t veclen); + bool rt_safe_get_vector (double x0, double x1, float *arg, int64_t veclen); + void get_vector (double x0, double x1, float *arg, int64_t veclen); AutomationEventList::iterator closest_control_point_before (double xval); AutomationEventList::iterator closest_control_point_after (double xval); @@ -72,14 +72,14 @@ class Curve : public AutomationList double unlocked_eval (double where); double multipoint_eval (double x); - void _get_vector (double x0, double x1, float *arg, int32_t veclen); + void _get_vector (double x0, double x1, float *arg, int64_t veclen); }; } // namespace ARDOUR extern "C" { - void curve_get_vector_from_c (void *arg, double, double, float*, int32_t); + void curve_get_vector_from_c (void *arg, double, double, float*, int64_t); } #endif /* __ardour_curve_h__ */ diff --git a/libs/ardour/curve.cc b/libs/ardour/curve.cc index 5a1dc108f8..249d84642b 100644 --- a/libs/ardour/curve.cc +++ b/libs/ardour/curve.cc @@ -72,7 +72,7 @@ Curve::~Curve () void Curve::solve () { - uint32_t npoints; + uint64_t npoints; if (!_dirty) { return; @@ -87,7 +87,7 @@ Curve::solve () double x[npoints]; double y[npoints]; - uint32_t i; + uint64_t i; AutomationEventList::iterator xx; for (i = 0, xx = events.begin(); xx != events.end(); ++xx, ++i) { @@ -206,7 +206,7 @@ Curve::solve () } bool -Curve::rt_safe_get_vector (double x0, double x1, float *vec, int32_t veclen) +Curve::rt_safe_get_vector (double x0, double x1, float *vec, int64_t veclen) { Glib::Mutex::Lock lm (lock, Glib::TRY_LOCK); @@ -219,19 +219,19 @@ Curve::rt_safe_get_vector (double x0, double x1, float *vec, int32_t veclen) } void -Curve::get_vector (double x0, double x1, float *vec, int32_t veclen) +Curve::get_vector (double x0, double x1, float *vec, int64_t veclen) { Glib::Mutex::Lock lm (lock); _get_vector (x0, x1, vec, veclen); } void -Curve::_get_vector (double x0, double x1, float *vec, int32_t veclen) +Curve::_get_vector (double x0, double x1, float *vec, int64_t veclen) { double rx, dx, lx, hx, max_x, min_x; - int32_t i; - int32_t original_veclen; - int32_t npoints; + int64_t i; + int64_t original_veclen; + int64_t npoints; if ((npoints = events.size()) == 0) { for (i = 0; i < veclen; ++i) { @@ -262,7 +262,7 @@ Curve::_get_vector (double x0, double x1, float *vec, int32_t veclen) */ double frac = (min_x - x0) / (x1 - x0); - int32_t subveclen = (int32_t) floor (veclen * frac); + int64_t subveclen = (int64_t) floor (veclen * frac); subveclen = min (subveclen, veclen); @@ -280,7 +280,7 @@ Curve::_get_vector (double x0, double x1, float *vec, int32_t veclen) double frac = (x1 - max_x) / (x1 - x0); - int32_t subveclen = (int32_t) floor (original_veclen * frac); + int64_t subveclen = (int64_t) floor (original_veclen * frac); float val; @@ -437,7 +437,7 @@ Curve::point_factory (const ControlEvent& other) const extern "C" { void -curve_get_vector_from_c (void *arg, double x0, double x1, float* vec, int32_t vecsize) +curve_get_vector_from_c (void *arg, double x0, double x1, float* vec, int64_t vecsize) { static_cast<Curve*>(arg)->get_vector (x0, x1, vec, vecsize); } diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index ad3077d9a0..3f9fa2737f 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -1675,20 +1675,25 @@ Route::_set_state (const XMLNode& node, bool call_base) } } - XMLNodeList redirect_nodes; - - for (niter = nlist.begin(); niter != nlist.end(); ++niter){ + if (ports_legal) { - child = *niter; + /* if ports are not legal, this will happen in set_deferred_state() */ + + XMLNodeList redirect_nodes; + + for (niter = nlist.begin(); niter != nlist.end(); ++niter){ + + child = *niter; + + if (child->name() == X_("Send") || child->name() == X_("Insert")) { + redirect_nodes.push_back(child); + } - if (child->name() == X_("Send") || child->name() == X_("Insert")) { - redirect_nodes.push_back(child); } - + + _set_redirect_states (redirect_nodes); } - _set_redirect_states(redirect_nodes); - for (niter = nlist.begin(); niter != nlist.end(); ++niter){ child = *niter; @@ -1814,7 +1819,7 @@ Route::_set_redirect_states(const XMLNodeList &nlist) --last; if (prev_last == last) { - cerr << "Could not fully restore state as some redirects were not possible to create" << endl; + warning << _name << ": could not fully restore state as some redirects were not possible to create" << endmsg; continue; } |