diff options
author | David Robillard <d@drobilla.net> | 2007-08-13 20:27:38 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-08-13 20:27:38 +0000 |
commit | 2f84a7792bf39645c632a6d3de7ca0a2a0d70569 (patch) | |
tree | f404fc212f9f0d1d0fc9dbe1864e387e74ce8bfc | |
parent | 67a0d6b2d95b78ccac98dc051ff4314a509a9003 (diff) |
Remove excessive SMF "Wrote EOT" printing.
Shave a few bytes off each ControlPoint if not used by a Curve (24 bytes on 64-bit).
git-svn-id: svn://localhost/ardour2/trunk@2294 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r-- | libs/ardour/ardour/automation_event.h | 26 | ||||
-rw-r--r-- | libs/ardour/curve.cc | 3 | ||||
-rw-r--r-- | libs/ardour/smf_source.cc | 2 |
3 files changed, 22 insertions, 9 deletions
diff --git a/libs/ardour/ardour/automation_event.h b/libs/ardour/ardour/automation_event.h index 7608b6b5fb..ae479ecafe 100644 --- a/libs/ardour/ardour/automation_event.h +++ b/libs/ardour/ardour/automation_event.h @@ -41,18 +41,30 @@ class Curve; struct ControlEvent { ControlEvent (double w, double v) - : when (w), value (v) { - coeff[0] = coeff[1] = coeff[2] = coeff[3] = 0.0; + : when (w), value (v), coeff (0) { } ControlEvent (const ControlEvent& other) : when (other.when), value (other.value) { - coeff[0] = coeff[1] = coeff[2] = coeff[3] = 0.0; + if (other.coeff) { + create_coeffs(); + for (size_t i=0; i < 4; ++i) + coeff[i] = other.coeff[i]; + } } - - double when; - double value; - double coeff[4]; ///< Used by Curve + + ~ControlEvent() { if (coeff) delete[] coeff; } + + void create_coeffs() { + if (!coeff) + coeff = new double[4]; + + coeff[0] = coeff[1] = coeff[2] = coeff[3] = 0.0; + } + + double when; + double value; + double* coeff; ///< double[4] allocated by Curve as needed }; diff --git a/libs/ardour/curve.cc b/libs/ardour/curve.cc index 344b4738d7..dcce3c0c6c 100644 --- a/libs/ardour/curve.cc +++ b/libs/ardour/curve.cc @@ -75,7 +75,7 @@ Curve::solve () double lp0, lp1, fpone; - lp0 =(x[1] - x[0])/(y[1] - y[0]); + lp0 = (x[1] - x[0])/(y[1] - y[0]); lp1 = (x[2] - x[1])/(y[2] - y[1]); if (lp0*lp1 < 0) { @@ -161,6 +161,7 @@ Curve::solve () /* store */ + (*xx)->create_coeffs(); (*xx)->coeff[0] = y[i-1] - (b * x[i-1]) - (c * xim12) - (d * xim13); (*xx)->coeff[1] = b; (*xx)->coeff[2] = c; diff --git a/libs/ardour/smf_source.cc b/libs/ardour/smf_source.cc index 537f2ccfb2..dfba2d5c50 100644 --- a/libs/ardour/smf_source.cc +++ b/libs/ardour/smf_source.cc @@ -202,7 +202,7 @@ SMFSource::flush_header () int SMFSource::flush_footer() { - cerr << "SMF " << name() << " writing EOT\n"; + //cerr << "SMF " << name() << " writing EOT\n"; fseek(_fd, 0, SEEK_END); write_var_len(0); |