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
This commit is contained in:
David Robillard 2007-08-13 20:27:38 +00:00
parent 67a0d6b2d9
commit 2f84a7792b
3 changed files with 22 additions and 9 deletions

View file

@ -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
};

View file

@ -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;

View file

@ -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);