diff options
author | Jesse Chappell <jesse@essej.net> | 2006-02-13 18:57:33 +0000 |
---|---|---|
committer | Jesse Chappell <jesse@essej.net> | 2006-02-13 18:57:33 +0000 |
commit | 51462b3eba73a29d801bd6b79a6f2c9e262d1b42 (patch) | |
tree | ab1f08568b2cd5d998d26872e33e4c41964345c5 /libs/ardour/io.cc | |
parent | e92c949f3ceb80b9892e70c7d30540a2b45fbf7d (diff) |
fixed various nasty send issues
git-svn-id: svn://localhost/trunk/ardour2@324 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/io.cc')
-rw-r--r-- | libs/ardour/io.cc | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc index 6b6773c49d..dff0990f1a 100644 --- a/libs/ardour/io.cc +++ b/libs/ardour/io.cc @@ -162,7 +162,8 @@ IO::apply_declick (vector<Sample *>& bufs, uint32_t nbufs, jack_nframes_t nframe Sample *buffer; double fractional_shift; double fractional_pos; - + gain_t polscale = invert_polarity ? -1.0f : 1.0f; + fractional_shift = -1.0/declick; if (target < initial) { @@ -178,16 +179,9 @@ IO::apply_declick (vector<Sample *>& bufs, uint32_t nbufs, jack_nframes_t nframe buffer = bufs[n]; fractional_pos = 1.0; - if (invert_polarity) { - for (jack_nframes_t nx = 0; nx < declick; ++nx) { - buffer[nx] *= -(initial + (delta * (0.5 + 0.5 * cos (M_PI * fractional_pos)))); - fractional_pos += fractional_shift; - } - } else { - for (jack_nframes_t nx = 0; nx < declick; ++nx) { - buffer[nx] *= (initial + (delta * (0.5 + 0.5 * cos (M_PI * fractional_pos)))); - fractional_pos += fractional_shift; - } + for (jack_nframes_t nx = 0; nx < declick; ++nx) { + buffer[nx] *= polscale * (initial + (delta * (0.5 + 0.5 * cos (M_PI * fractional_pos)))); + fractional_pos += fractional_shift; } /* now ensure the rest of the buffer has the target value @@ -381,7 +375,8 @@ IO::deliver_output (vector<Sample *>& bufs, uint32_t nbufs, jack_nframes_t nfram gain_t dg; - + gain_t pangain = _gain; + { TentativeLockMonitor dm (declick_lock, __LINE__, __FILE__); @@ -395,14 +390,15 @@ IO::deliver_output (vector<Sample *>& bufs, uint32_t nbufs, jack_nframes_t nfram if (dg != _gain) { apply_declick (bufs, nbufs, nframes, _gain, dg, false); _gain = dg; + pangain = 1.0f; } /* simple, non-automation panning to outputs */ if (_session.transport_speed() > 1.5f || _session.transport_speed() < -1.5f) { - pan (bufs, nbufs, nframes, offset, _gain * speed_quietning); + pan (bufs, nbufs, nframes, offset, pangain * speed_quietning); } else { - pan (bufs, nbufs, nframes, offset, _gain); + pan (bufs, nbufs, nframes, offset, pangain); } } |