{
if (_role == Listen) {
/* send to monitor bus is always at unity */
- _amp->set_gain (GAIN_COEFF_UNITY, this);
+ _gain_control->set_value (GAIN_COEFF_UNITY, PBD::Controllable::NoGroup);
} else {
/* aux sends start at -inf dB */
- _amp->set_gain (GAIN_COEFF_ZERO, this);
+ _gain_control->set_value (GAIN_COEFF_ZERO, PBD::Controllable::NoGroup);
}
}
gain_t tgain = target_gain ();
- _amp->set_gain (tgain, this);
+ if (tgain != _current_gain) {
+
+ /* target gain has changed */
+
+ _current_gain = Amp::apply_gain (mixbufs, _session.nominal_frame_rate(), nframes, _current_gain, tgain);
+
+ } else if (tgain == GAIN_COEFF_ZERO) {
- if (tgain == GAIN_COEFF_ZERO && _amp->gain() == GAIN_COEFF_ZERO) {
/* we were quiet last time, and we're still supposed to be quiet.
- */
+ */
_meter->reset ();
Amp::apply_simple_gain (mixbufs, nframes, GAIN_COEFF_ZERO);
goto out;
- }
+ } else if (tgain != GAIN_COEFF_UNITY) {
- /* These two calls will either set up gain automation or mark
- the amp as ready to use a simple scalar gain.
- */
+ /* target gain has not changed, but is not zero or unity */
+ Amp::apply_simple_gain (mixbufs, nframes, tgain);
+ }
_amp->set_gain_automation_buffer (_session.send_gain_automation_buffer ());
_amp->setup_gain_automation (start_frame, end_frame, nframes);
int
InternalSend::set_state (const XMLNode& node, int version)
{
- const XMLProperty* prop;
+ XMLProperty const * prop;
init_gain ();