diff options
author | Robin Gareus <robin@gareus.org> | 2014-06-11 17:14:18 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2014-06-11 17:14:18 +0200 |
commit | ca3c9cae6e36b3d7d0f0192fe6eb46d5e33dd2e9 (patch) | |
tree | f90b55d4fd7401834b3f59719f54b424eb5275c0 /libs/ardour/send.cc | |
parent | 626b2daa8294e8ddb5526c1c6a9540f72b2bd063 (diff) |
basic integration of delaylines (still un-nused)
Diffstat (limited to 'libs/ardour/send.cc')
-rw-r--r-- | libs/ardour/send.cc | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/libs/ardour/send.cc b/libs/ardour/send.cc index 71cab46879..02365e967c 100644 --- a/libs/ardour/send.cc +++ b/libs/ardour/send.cc @@ -73,6 +73,8 @@ Send::name_and_id_new_send (Session& s, Role r, uint32_t& bitslot, bool ignore_b Send::Send (Session& s, boost::shared_ptr<Pannable> p, boost::shared_ptr<MuteMaster> mm, Role r, bool ignore_bitslot) : Delivery (s, p, mm, name_and_id_new_send (s, r, _bitslot, ignore_bitslot), r) , _metering (false) + , _delay_in (0) + , _delay_out (0) { if (_role == Listen) { /* we don't need to do this but it keeps things looking clean @@ -86,6 +88,8 @@ Send::Send (Session& s, boost::shared_ptr<Pannable> p, boost::shared_ptr<MuteMas _amp.reset (new Amp (_session)); _meter.reset (new PeakMeter (_session, name())); + _delayline.reset (new DelayLine (_session, name())); + add_control (_amp->gain_control ()); if (panner_shell()) { @@ -118,6 +122,30 @@ Send::deactivate () } void +Send::set_delay_in(framecnt_t delay) +{ + if (!_delayline) return; + if (_delay_in == delay) { + return; + } + _delay_in = delay; + cerr << "SEND DELAY Pre: " << delay << "\n"; + _delayline.get()->set_delay(_delay_out + _delay_in); +} + +void +Send::set_delay_out(framecnt_t delay) +{ + if (!_delayline) return; + if (_delay_out == delay) { + return; + } + _delay_out = delay; + cerr << "SEND DELAY Post: " << delay << "\n"; + _delayline.get()->set_delay(_delay_out + _delay_in); +} + +void Send::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool) { if (_output->n_ports() == ChanCount::ZERO) { @@ -146,6 +174,8 @@ Send::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframe _amp->setup_gain_automation (start_frame, end_frame, nframes); _amp->run (sendbufs, start_frame, end_frame, nframes, true); + _delayline->run (sendbufs, start_frame, end_frame, nframes, true); + /* deliver to outputs */ Delivery::run (sendbufs, start_frame, end_frame, nframes, true); @@ -301,6 +331,11 @@ Send::configure_io (ChanCount in, ChanCount out) return false; } + if (_delayline && !_delayline->configure_io(in, out)) { + cerr << "send delayline config failed\n"; + return false; + } + reset_panner (); return true; |