/*
- Copyright (C) 2009 Paul Davis
-
- This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the Free
- Software Foundation; either version 2 of the License, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
+ * Copyright (C) 2009-2012 Carl Hetherington <carl@carlh.net>
+ * Copyright (C) 2009-2012 David Robillard <d@drobilla.net>
+ * Copyright (C) 2009-2017 Paul Davis <paul@linuxaudiosystems.com>
+ * Copyright (C) 2013-2017 Robin Gareus <robin@gareus.org>
+ * Copyright (C) 2018 Len Ovens <len@ovenwerks.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
#include <cmath>
#include <algorithm>
{
if (pannable) {
bool is_send = false;
- if (r & (Delivery::Send|Delivery::Aux)) is_send = true;
+ if (r & (Delivery::Send|Delivery::Aux|Delivery::Foldback)) is_send = true;
_panshell = boost::shared_ptr<PannerShell>(new PannerShell (_name, _session, pannable, is_send));
}
{
if (pannable) {
bool is_send = false;
- if (r & (Delivery::Send|Delivery::Aux)) is_send = true;
+ if (r & (Delivery::Send|Delivery::Aux|Delivery::Foldback)) is_send = true;
_panshell = boost::shared_ptr<PannerShell>(new PannerShell (_name, _session, pannable, is_send));
}
}
void
-Delivery::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, double /*speed*/, pframes_t nframes, bool result_required)
+Delivery::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_sample, double /*speed*/, pframes_t nframes, bool result_required)
{
assert (_output);
if (tgain != _current_gain) {
/* target gain has changed */
- _current_gain = Amp::apply_gain (bufs, _session.nominal_frame_rate(), nframes, _current_gain, tgain);
+ _current_gain = Amp::apply_gain (bufs, _session.nominal_sample_rate(), nframes, _current_gain, tgain);
} else if (tgain < GAIN_COEFF_SMALL) {
// Use the panner to distribute audio to output port buffers
- _panshell->run (bufs, output_buffers(), start_frame, end_frame, nframes);
+ _panshell->run (bufs, output_buffers(), start_sample, end_sample, nframes);
// non-audio data will not have been delivered by the panner
if (outs.count ().get (*t) <= n) {
continue;
}
- b->read_from (outs.get (*t, n++), nframes, (*t == DataType::AUDIO ? 0 : -Port::port_offset()));
+ b->read_from (outs.get_available (*t, n++), nframes, (*t == DataType::AUDIO ? 0 : -Port::port_offset()));
}
}
}
}
XMLNode&
-Delivery::state (bool full_state)
+Delivery::state ()
{
- XMLNode& node (IOProcessor::state (full_state));
+ XMLNode& node (IOProcessor::state ());
if (_role & Main) {
node.set_property("type", "main-outs");
}
void
-Delivery::flush_buffers (framecnt_t nframes)
+Delivery::flush_buffers (samplecnt_t nframes)
{
/* io_lock, not taken: function must be called from Session::process() calltree */
}
void
-Delivery::non_realtime_transport_stop (framepos_t now, bool flush)
+Delivery::non_realtime_transport_stop (samplepos_t now, bool flush)
{
Processor::non_realtime_transport_stop (now, flush);
_panshell->pannable()->non_realtime_transport_stop (now, flush);
}
- if (_output) {
- PortSet& ports (_output->ports());
+ if (_output) {
+ PortSet& ports (_output->ports());
- for (PortSet::iterator i = ports.begin(); i != ports.end(); ++i) {
- i->transport_stopped ();
- }
- }
+ for (PortSet::iterator i = ports.begin(); i != ports.end(); ++i) {
+ i->transport_stopped ();
+ }
+ }
}
void
Delivery::realtime_locate ()
{
if (_output) {
- PortSet& ports (_output->ports());
+ PortSet& ports (_output->ports());
- for (PortSet::iterator i = ports.begin(); i != ports.end(); ++i) {
- i->realtime_locate ();
- }
- }
+ for (PortSet::iterator i = ports.begin(); i != ports.end(); ++i) {
+ i->realtime_locate ();
+ }
+ }
}
gain_t
return GAIN_COEFF_ZERO;
}
- MuteMaster::MutePoint mp = MuteMaster::Main; // stupid gcc uninit warning
-
- switch (_role) {
- case Main:
- mp = MuteMaster::Main;
- break;
- case Listen:
- mp = MuteMaster::Listen;
- break;
- case Send:
- case Insert:
- case Aux:
- if (_pre_fader) {
- mp = MuteMaster::PreFader;
- } else {
- mp = MuteMaster::PostFader;
- }
- break;
- }
+ MuteMaster::MutePoint mp = MuteMaster::Main; // stupid gcc uninit warning
- gain_t desired_gain = _mute_master->mute_gain_at (mp);
+ switch (_role) {
+ case Main:
+ mp = MuteMaster::Main;
+ break;
+ case Listen:
+ mp = MuteMaster::Listen;
+ break;
+ case Send:
+ case Insert:
+ case Aux:
+ case Foldback:
+ if (_pre_fader) {
+ mp = MuteMaster::PreFader;
+ } else {
+ mp = MuteMaster::PostFader;
+ }
+ break;
+ }
- if (_role == Listen && _session.monitor_out() && !_session.listening()) {
+ gain_t desired_gain = _mute_master->mute_gain_at (mp);
- /* nobody is soloed, and this delivery is a listen-send to the
- control/monitor/listen bus, we should be silent since
- it gets its signal from the master out.
- */
+ if (_role == Listen && _session.monitor_out() && !_session.listening()) {
- desired_gain = GAIN_COEFF_ZERO;
+ /* nobody is soloed, and this delivery is a listen-send to the
+ * control/monitor/listen bus, we should be silent since
+ * it gets its signal from the master out.
+ */
- }
+ desired_gain = GAIN_COEFF_ZERO;
+ }
return desired_gain;
}