summaryrefslogtreecommitdiff
path: root/libs/ardour/delivery.cc
diff options
context:
space:
mode:
authorBen Loftis <ben@harrisonconsoles.com>2015-03-25 16:47:25 -0500
committerRobin Gareus <robin@gareus.org>2015-04-22 00:22:43 +0200
commit46f97e8d92241c94d12d81ea182a9172df98e61e (patch)
treef757e7014aa6260b7d927b35bcf1fd221e2d40e4 /libs/ardour/delivery.cc
parent187ddb3bad70088f901ed1ea5e1402519fd393b4 (diff)
Initial Gain Coefficient tweaks
1) Disambiguate 1.0 to GAIN_COEFF_UNITY, and 0.0 to GAIN_COEFF_ZERO 2) Add GAIN_COEFF_SMALL which replaces SMALL_SIGNAL (-140dB) 3) GAIN_COEFF_SMALL can used to avoid interpolating towards -inf on a db scale 4) GAIN_COEFF_SMALL is used to detect very small (denormal?) gains and memset to zero
Diffstat (limited to 'libs/ardour/delivery.cc')
-rw-r--r--libs/ardour/delivery.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/libs/ardour/delivery.cc b/libs/ardour/delivery.cc
index f16719888f..359b029d0c 100644
--- a/libs/ardour/delivery.cc
+++ b/libs/ardour/delivery.cc
@@ -52,7 +52,7 @@ Delivery::Delivery (Session& s, boost::shared_ptr<IO> io, boost::shared_ptr<Pann
: IOProcessor(s, boost::shared_ptr<IO>(), (role_requires_output_ports (r) ? io : boost::shared_ptr<IO>()), name)
, _role (r)
, _output_buffers (new BufferSet())
- , _current_gain (1.0)
+ , _current_gain (GAIN_COEFF_UNITY)
, _no_outs_cuz_we_no_monitor (false)
, _mute_master (mm)
, _no_panner_reset (false)
@@ -76,7 +76,7 @@ Delivery::Delivery (Session& s, boost::shared_ptr<Pannable> pannable, boost::sha
: IOProcessor(s, false, (role_requires_output_ports (r) ? true : false), name, "", DataType::AUDIO, (r == Send))
, _role (r)
, _output_buffers (new BufferSet())
- , _current_gain (1.0)
+ , _current_gain (GAIN_COEFF_UNITY)
, _no_outs_cuz_we_no_monitor (false)
, _mute_master (mm)
, _no_panner_reset (false)
@@ -264,7 +264,7 @@ Delivery::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pf
_current_gain = Amp::apply_gain (bufs, _session.nominal_frame_rate(), nframes, _current_gain, tgain);
- } else if (tgain == 0.0) {
+ } else if (tgain < GAIN_COEFF_SMALL) {
/* we were quiet last time, and we're still supposed to be quiet.
Silence the outputs, and make sure the buffers are quiet too,
@@ -273,11 +273,11 @@ Delivery::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pf
_output->silence (nframes);
if (result_required) {
bufs.set_count (output_buffers().count ());
- Amp::apply_simple_gain (bufs, nframes, 0.0);
+ Amp::apply_simple_gain (bufs, nframes, GAIN_COEFF_ZERO);
}
goto out;
- } else if (tgain != 1.0) {
+ } else if (tgain != GAIN_COEFF_UNITY) {
/* target gain has not changed, but is not unity */
Amp::apply_simple_gain (bufs, nframes, tgain);
@@ -498,7 +498,7 @@ Delivery::target_gain ()
/* if we've been requested to deactivate, our target gain is zero */
if (!_pending_active) {
- return 0.0;
+ return GAIN_COEFF_ZERO;
}
/* if we've been told not to output because its a monitoring situation and
@@ -506,7 +506,7 @@ Delivery::target_gain ()
*/
if (_no_outs_cuz_we_no_monitor) {
- return 0.0;
+ return GAIN_COEFF_ZERO;
}
MuteMaster::MutePoint mp = MuteMaster::Main; // stupid gcc uninit warning
@@ -538,7 +538,7 @@ Delivery::target_gain ()
it gets its signal from the master out.
*/
- desired_gain = 0.0;
+ desired_gain = GAIN_COEFF_ZERO;
}