2 Copyright (C) 2000 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 #include <sigc++/bind.h>
26 #include <pbd/xml++.h>
27 #include <pbd/enumwriter.h>
29 #include <ardour/timestamps.h>
30 #include <ardour/buffer.h>
31 #include <ardour/audioengine.h>
32 #include <ardour/route.h>
33 #include <ardour/insert.h>
34 #include <ardour/send.h>
35 #include <ardour/session.h>
36 #include <ardour/utils.h>
37 #include <ardour/configuration.h>
38 #include <ardour/cycle_timer.h>
39 #include <ardour/route_group.h>
40 #include <ardour/port.h>
41 #include <ardour/ladspa_plugin.h>
42 #include <ardour/panner.h>
43 #include <ardour/dB.h>
44 #include <ardour/mix.h>
49 using namespace ARDOUR;
53 uint32_t Route::order_key_cnt = 0;
56 Route::Route (Session& sess, string name, int input_min, int input_max, int output_min, int output_max, Flag flg, DataType default_type)
57 : IO (sess, name, input_min, input_max, output_min, output_max, default_type),
59 _solo_control (X_("solo"), *this, ToggleControllable::SoloControl),
60 _mute_control (X_("mute"), *this, ToggleControllable::MuteControl)
65 Route::Route (Session& sess, const XMLNode& node, DataType default_type)
66 : IO (sess, *node.child ("IO"), default_type),
67 _solo_control (X_("solo"), *this, ToggleControllable::SoloControl),
68 _mute_control (X_("mute"), *this, ToggleControllable::MuteControl)
71 _set_state (node, false);
77 redirect_max_outs = 0;
81 _phase_invert = false;
82 order_keys[N_("signal")] = order_key_cnt++;
85 _meter_point = MeterPostFader;
89 _have_internal_generator = false;
91 _pending_declick = true;
92 _remote_control_id = 0;
93 _ignore_gain_on_deliver = true;
98 _mute_affects_pre_fader = Config->get_mute_affects_pre_fader();
99 _mute_affects_post_fader = Config->get_mute_affects_post_fader();
100 _mute_affects_control_outs = Config->get_mute_affects_control_outs();
101 _mute_affects_main_outs = Config->get_mute_affects_main_outs();
104 desired_solo_gain = 1.0;
106 desired_mute_gain = 1.0;
110 input_changed.connect (mem_fun (this, &Route::input_change_handler));
111 output_changed.connect (mem_fun (this, &Route::output_change_handler));
116 clear_redirects (this);
119 delete _control_outs;
124 Route::set_remote_control_id (uint32_t id)
126 if (id != _remote_control_id) {
127 _remote_control_id = id;
128 RemoteControlIDChanged ();
133 Route::remote_control_id() const
135 return _remote_control_id;
139 Route::order_key (string name) const
141 OrderKeys::const_iterator i;
143 if ((i = order_keys.find (name)) == order_keys.end()) {
151 Route::set_order_key (string name, long n)
153 order_keys[name] = n;
154 _session.set_dirty ();
158 Route::inc_gain (gain_t fraction, void *src)
160 IO::inc_gain (fraction, src);
164 Route::set_gain (gain_t val, void *src)
166 if (src != 0 && _mix_group && src != _mix_group && _mix_group->is_active()) {
168 if (_mix_group->is_relative()) {
171 gain_t usable_gain = gain();
172 if (usable_gain < 0.000001f) {
173 usable_gain=0.000001f;
177 if (delta < 0.000001f) {
181 delta -= usable_gain;
183 if (delta == 0.0f) return;
185 gain_t factor = delta / usable_gain;
188 factor = _mix_group->get_max_factor(factor);
189 if (factor == 0.0f) {
194 factor = _mix_group->get_min_factor(factor);
195 if (factor == 0.0f) {
201 _mix_group->apply (&Route::inc_gain, factor, _mix_group);
205 _mix_group->apply (&Route::set_gain, val, _mix_group);
215 IO::set_gain (val, src);
219 Route::process_output_buffers (vector<Sample*>& bufs, uint32_t nbufs,
220 nframes_t start_frame, nframes_t end_frame,
221 nframes_t nframes, nframes_t offset, bool with_redirects, int declick,
225 RedirectList::iterator i;
226 bool post_fader_work = false;
227 bool mute_declick_applied = false;
229 vector<Sample*>::iterator bufiter;
234 gain_t* gab = _session.gain_automation_buffer();
236 switch (Config->get_monitoring_model()) {
237 case HardwareMonitoring:
238 case ExternalMonitoring:
245 declick = _pending_declick;
248 Glib::Mutex::Lock cm (control_outs_lock, Glib::TRY_LOCK);
258 Glib::Mutex::Lock dm (declick_lock, Glib::TRY_LOCK);
261 dmg = desired_mute_gain;
262 dsg = desired_solo_gain;
271 /* ----------------------------------------------------------------------------------------------------
272 GLOBAL DECLICK (for transport changes etc.)
273 -------------------------------------------------------------------------------------------------- */
276 apply_declick (bufs, nbufs, nframes, 0.0, 1.0, false);
277 _pending_declick = 0;
278 } else if (declick < 0) {
279 apply_declick (bufs, nbufs, nframes, 1.0, 0.0, false);
280 _pending_declick = 0;
283 /* no global declick */
285 if (solo_gain != dsg) {
286 apply_declick (bufs, nbufs, nframes, solo_gain, dsg, false);
292 /* ----------------------------------------------------------------------------------------------------
293 INPUT METERING & MONITORING
294 -------------------------------------------------------------------------------------------------- */
296 if (meter && (_meter_point == MeterInput)) {
297 for (n = 0; n < nbufs; ++n) {
298 _peak_power[n] = Session::compute_peak (bufs[n], nframes, _peak_power[n]);
302 if (!_soloed && _mute_affects_pre_fader && (mute_gain != dmg)) {
303 apply_declick (bufs, nbufs, nframes, mute_gain, dmg, false);
305 mute_declick_applied = true;
308 if ((_meter_point == MeterInput) && co) {
310 solo_audible = dsg > 0;
311 mute_audible = dmg > 0;// || !_mute_affects_pre_fader;
313 if ( // muted by solo of another track
317 // muted by mute of this track
321 // rec-enabled but not s/w monitoring
323 // TODO: this is probably wrong
325 (no_monitor && record_enabled() && (!Config->get_auto_input() || _session.actively_recording()))
329 co->silence (nframes, offset);
333 co->deliver_output (bufs, nbufs, nframes, offset);
338 /* ----------------------------------------------------------------------------------------------------
340 -------------------------------------------------------------------------------------------------- */
342 if (with_redirects) {
343 Glib::RWLock::ReaderLock rm (redirect_lock, Glib::TRY_LOCK);
345 if (mute_gain > 0 || !_mute_affects_pre_fader) {
346 for (i = _redirects.begin(); i != _redirects.end(); ++i) {
347 switch ((*i)->placement()) {
350 if (boost::dynamic_pointer_cast<Send>(*i) || boost::dynamic_pointer_cast<PortInsert>(*i)) {
351 (*i)->silence (nframes, offset);
354 (*i)->run (bufs, nbufs, nframes, offset);
358 post_fader_work = true;
363 for (i = _redirects.begin(); i != _redirects.end(); ++i) {
364 switch ((*i)->placement()) {
366 (*i)->silence (nframes, offset);
369 post_fader_work = true;
378 if (!_soloed && (mute_gain != dmg) && !mute_declick_applied && _mute_affects_post_fader) {
379 apply_declick (bufs, nbufs, nframes, mute_gain, dmg, false);
381 mute_declick_applied = true;
384 /* ----------------------------------------------------------------------------------------------------
385 PRE-FADER METERING & MONITORING
386 -------------------------------------------------------------------------------------------------- */
388 if (meter && (_meter_point == MeterPreFader)) {
389 for (n = 0; n < nbufs; ++n) {
390 _peak_power[n] = Session::compute_peak (bufs[n], nframes, _peak_power[n]);
395 if ((_meter_point == MeterPreFader) && co) {
397 solo_audible = dsg > 0;
398 mute_audible = dmg > 0 || !_mute_affects_pre_fader;
400 if ( // muted by solo of another track
404 // muted by mute of this track
408 // rec-enabled but not s/w monitoring
410 (no_monitor && record_enabled() && (!Config->get_auto_input() || _session.actively_recording()))
414 co->silence (nframes, offset);
418 co->deliver_output (bufs, nbufs, nframes, offset);
423 /* ----------------------------------------------------------------------------------------------------
425 -------------------------------------------------------------------------------------------------- */
427 /* if not recording or recording and requiring any monitor signal, then apply gain */
429 if ( // not recording
431 !(record_enabled() && _session.actively_recording()) ||
435 // h/w monitoring not in use
437 (!Config->get_monitoring_model() == HardwareMonitoring &&
439 // AND software monitoring required
441 Config->get_monitoring_model() == SoftwareMonitoring)) {
443 if (apply_gain_automation) {
446 for (n = 0; n < nbufs; ++n) {
447 Sample *sp = bufs[n];
449 for (nframes_t nx = 0; nx < nframes; ++nx) {
454 for (n = 0; n < nbufs; ++n) {
455 Sample *sp = bufs[n];
457 for (nframes_t nx = 0; nx < nframes; ++nx) {
463 if (apply_gain_automation && _session.transport_rolling() && nframes > 0) {
464 _effective_gain = gab[nframes-1];
469 /* manual (scalar) gain */
473 apply_declick (bufs, nbufs, nframes, _gain, dg, _phase_invert);
476 } else if (_gain != 0 && (_phase_invert || _gain != 1.0)) {
478 /* no need to interpolate current gain value,
479 but its non-unity, so apply it. if the gain
480 is zero, do nothing because we'll ship silence
492 for (n = 0; n < nbufs; ++n) {
493 Sample *sp = bufs[n];
494 Session::apply_gain_to_buffer(sp,nframes,this_gain);
497 } else if (_gain == 0) {
498 for (n = 0; n < nbufs; ++n) {
499 memset (bufs[n], 0, sizeof (Sample) * nframes);
506 /* actively recording, no monitoring required; leave buffers as-is to save CPU cycles */
510 /* ----------------------------------------------------------------------------------------------------
512 -------------------------------------------------------------------------------------------------- */
514 /* note that post_fader_work cannot be true unless with_redirects was also true, so don't test both */
516 if (post_fader_work) {
518 Glib::RWLock::ReaderLock rm (redirect_lock, Glib::TRY_LOCK);
520 if (mute_gain > 0 || !_mute_affects_post_fader) {
521 for (i = _redirects.begin(); i != _redirects.end(); ++i) {
522 switch ((*i)->placement()) {
527 if (boost::dynamic_pointer_cast<Send>(*i) || boost::dynamic_pointer_cast<PortInsert>(*i)) {
528 (*i)->silence (nframes, offset);
531 (*i)->run (bufs, nbufs, nframes, offset);
537 for (i = _redirects.begin(); i != _redirects.end(); ++i) {
538 switch ((*i)->placement()) {
542 (*i)->silence (nframes, offset);
550 if (!_soloed && (mute_gain != dmg) && !mute_declick_applied && _mute_affects_control_outs) {
551 apply_declick (bufs, nbufs, nframes, mute_gain, dmg, false);
553 mute_declick_applied = true;
556 /* ----------------------------------------------------------------------------------------------------
558 -------------------------------------------------------------------------------------------------- */
560 if ((_meter_point == MeterPostFader) && co) {
562 solo_audible = solo_gain > 0;
563 mute_audible = dmg > 0 || !_mute_affects_control_outs;
565 if ( // silent anyway
567 (_gain == 0 && !apply_gain_automation) ||
569 // muted by solo of another track
573 // muted by mute of this track
577 // recording but not s/w monitoring
579 (no_monitor && record_enabled() && (!Config->get_auto_input() || _session.actively_recording()))
583 co->silence (nframes, offset);
587 co->deliver_output_no_pan (bufs, nbufs, nframes, offset);
591 /* ----------------------------------------------------------------------
593 ----------------------------------------------------------------------*/
595 if (!_soloed && (mute_gain != dmg) && !mute_declick_applied && _mute_affects_main_outs) {
596 apply_declick (bufs, nbufs, nframes, mute_gain, dmg, false);
598 mute_declick_applied = true;
601 /* ----------------------------------------------------------------------------------------------------
603 -------------------------------------------------------------------------------------------------- */
605 solo_audible = dsg > 0;
606 mute_audible = dmg > 0 || !_mute_affects_main_outs;
608 if (n_outputs() == 0) {
612 } else if (no_monitor && record_enabled() && (!Config->get_auto_input() || _session.actively_recording())) {
614 IO::silence (nframes, offset);
618 if ( // silent anyway
620 (_gain == 0 && !apply_gain_automation) ||
622 // muted by solo of another track, but not using control outs for solo
624 (!solo_audible && (Config->get_solo_model() != SoloBus)) ||
626 // muted by mute of this track
632 /* don't use Route::silence() here, because that causes
633 all outputs (sends, port inserts, etc. to be silent).
636 if (_meter_point == MeterPostFader) {
637 reset_peak_meters ();
640 IO::silence (nframes, offset);
644 if ((_session.transport_speed() > 1.5f ||
645 _session.transport_speed() < -1.5f) &&
646 Config->get_quieten_at_speed()) {
647 pan (bufs, nbufs, nframes, offset, speed_quietning);
649 // cerr << _name << " panner state = " << _panner->automation_state() << endl;
650 if (!_panner->empty() &&
651 (_panner->automation_state() & Play ||
652 ((_panner->automation_state() & Touch) && !_panner->touching()))) {
653 pan_automated (bufs, nbufs, start_frame, end_frame, nframes, offset);
655 pan (bufs, nbufs, nframes, offset, 1.0);
662 /* ----------------------------------------------------------------------------------------------------
664 -------------------------------------------------------------------------------------------------- */
666 if (meter && (_meter_point == MeterPostFader)) {
667 // cerr << "meter post" << endl;
669 if ((_gain == 0 && !apply_gain_automation) || dmg == 0) {
670 uint32_t no = n_outputs();
671 for (n = 0; n < no; ++n) {
675 uint32_t no = n_outputs();
676 for (n = 0; n < no; ++n) {
677 _peak_power[n] = Session::compute_peak (output(n)->get_buffer (nframes) + offset, nframes, _peak_power[n]);
684 Route::n_process_buffers ()
686 return max (n_inputs(), redirect_max_outs);
691 Route::passthru (nframes_t start_frame, nframes_t end_frame, nframes_t nframes, nframes_t offset, int declick, bool meter_first)
693 vector<Sample*>& bufs = _session.get_passthru_buffers();
694 uint32_t limit = n_process_buffers ();
698 collect_input (bufs, limit, nframes, offset);
700 #define meter_stream meter_first
703 for (uint32_t n = 0; n < limit; ++n) {
704 _peak_power[n] = Session::compute_peak (bufs[n], nframes, _peak_power[n]);
706 meter_stream = false;
711 process_output_buffers (bufs, limit, start_frame, end_frame, nframes, offset, true, declick, meter_stream);
717 Route::set_phase_invert (bool yn, void *src)
719 if (_phase_invert != yn) {
722 // phase_invert_changed (src); /* EMIT SIGNAL */
726 Route::set_solo (bool yn, void *src)
732 if (_mix_group && src != _mix_group && _mix_group->is_active()) {
733 _mix_group->apply (&Route::set_solo, yn, _mix_group);
739 solo_changed (src); /* EMIT SIGNAL */
740 _solo_control.Changed (); /* EMIT SIGNAL */
745 Route::set_solo_mute (bool yn)
747 Glib::Mutex::Lock lm (declick_lock);
749 /* Called by Session in response to another Route being soloed.
752 desired_solo_gain = (yn?0.0:1.0);
756 Route::set_solo_safe (bool yn, void *src)
758 if (_solo_safe != yn) {
760 solo_safe_changed (src); /* EMIT SIGNAL */
765 Route::set_mute (bool yn, void *src)
768 if (_mix_group && src != _mix_group && _mix_group->is_active()) {
769 _mix_group->apply (&Route::set_mute, yn, _mix_group);
775 mute_changed (src); /* EMIT SIGNAL */
777 _mute_control.Changed (); /* EMIT SIGNAL */
779 Glib::Mutex::Lock lm (declick_lock);
780 desired_mute_gain = (yn?0.0f:1.0f);
785 Route::add_redirect (boost::shared_ptr<Redirect> redirect, void *src, uint32_t* err_streams)
787 uint32_t old_rmo = redirect_max_outs;
789 if (!_session.engine().connected()) {
794 Glib::RWLock::WriterLock lm (redirect_lock);
796 boost::shared_ptr<PluginInsert> pi;
797 boost::shared_ptr<PortInsert> porti;
799 uint32_t potential_max_streams = 0;
801 if ((pi = boost::dynamic_pointer_cast<PluginInsert>(redirect)) != 0) {
804 if (pi->input_streams() == 0) {
805 /* instrument plugin */
806 _have_internal_generator = true;
809 potential_max_streams = max(pi->input_streams(), pi->output_streams());
811 } else if ((porti = boost::dynamic_pointer_cast<PortInsert>(redirect)) != 0) {
813 /* force new port inserts to start out with an i/o configuration
814 that matches this route's i/o configuration.
816 the "inputs" for the port are supposed to match the output
819 the "outputs" of the route should match the inputs of this
820 route. XXX shouldn't they match the number of active signal
821 streams at the point of insertion?
825 porti->ensure_io (n_outputs (), n_inputs(), false, this);
828 // Ensure peak vector sizes before the plugin is activated
829 while (_peak_power.size() < potential_max_streams) {
830 _peak_power.push_back(0);
832 while (_visible_peak_power.size() < potential_max_streams) {
833 _visible_peak_power.push_back(-INFINITY);
835 while (_max_peak_power.size() < potential_max_streams) {
836 _max_peak_power.push_back(-INFINITY);
839 _redirects.push_back (redirect);
841 if (_reset_plugin_counts (err_streams)) {
842 _redirects.pop_back ();
843 _reset_plugin_counts (0); // it worked before we tried to add it ...
847 redirect->activate ();
848 redirect->active_changed.connect (mem_fun (*this, &Route::redirect_active_proxy));
851 if (redirect_max_outs != old_rmo || old_rmo == 0) {
856 redirects_changed (src); /* EMIT SIGNAL */
861 Route::add_redirects (const RedirectList& others, void *src, uint32_t* err_streams)
863 uint32_t old_rmo = redirect_max_outs;
865 if (!_session.engine().connected()) {
870 Glib::RWLock::WriterLock lm (redirect_lock);
872 RedirectList::iterator existing_end = _redirects.end();
875 uint32_t potential_max_streams = 0;
877 for (RedirectList::const_iterator i = others.begin(); i != others.end(); ++i) {
879 boost::shared_ptr<PluginInsert> pi;
881 if ((pi = boost::dynamic_pointer_cast<PluginInsert>(*i)) != 0) {
884 uint32_t m = max(pi->input_streams(), pi->output_streams());
885 if (m > potential_max_streams)
886 potential_max_streams = m;
889 // Ensure peak vector sizes before the plugin is activated
890 while (_peak_power.size() < potential_max_streams) {
891 _peak_power.push_back(0);
893 while (_visible_peak_power.size() < potential_max_streams) {
894 _visible_peak_power.push_back(-INFINITY);
896 while (_max_peak_power.size() < potential_max_streams) {
897 _max_peak_power.push_back(-INFINITY);
900 _redirects.push_back (*i);
902 if (_reset_plugin_counts (err_streams)) {
904 _redirects.erase (existing_end, _redirects.end());
905 _reset_plugin_counts (0); // it worked before we tried to add it ...
910 (*i)->active_changed.connect (mem_fun (*this, &Route::redirect_active_proxy));
914 if (redirect_max_outs != old_rmo || old_rmo == 0) {
918 redirects_changed (src); /* EMIT SIGNAL */
923 Route::clear_redirects (void *src)
925 uint32_t old_rmo = redirect_max_outs;
927 if (!_session.engine().connected()) {
932 Glib::RWLock::WriterLock lm (redirect_lock);
933 RedirectList::iterator i;
934 for (i = _redirects.begin(); i != _redirects.end(); ++i) {
935 (*i)->drop_references ();
940 if (redirect_max_outs != old_rmo) {
944 redirect_max_outs = 0;
945 _have_internal_generator = false;
946 redirects_changed (src); /* EMIT SIGNAL */
950 Route::remove_redirect (boost::shared_ptr<Redirect> redirect, void *src, uint32_t* err_streams)
952 uint32_t old_rmo = redirect_max_outs;
954 if (!_session.engine().connected()) {
958 redirect_max_outs = 0;
961 Glib::RWLock::WriterLock lm (redirect_lock);
962 RedirectList::iterator i;
963 bool removed = false;
965 for (i = _redirects.begin(); i != _redirects.end(); ++i) {
966 if (*i == redirect) {
968 RedirectList::iterator tmp;
970 /* move along, see failure case for reset_plugin_counts()
971 where we may need to reinsert the redirect.
977 /* stop redirects that send signals to JACK ports
978 from causing noise as a result of no longer being
982 boost::shared_ptr<Send> send;
983 boost::shared_ptr<PortInsert> port_insert;
985 if ((send = boost::dynamic_pointer_cast<Send> (*i)) != 0) {
986 send->disconnect_inputs (this);
987 send->disconnect_outputs (this);
988 } else if ((port_insert = boost::dynamic_pointer_cast<PortInsert> (*i)) != 0) {
989 port_insert->disconnect_inputs (this);
990 port_insert->disconnect_outputs (this);
993 _redirects.erase (i);
1006 if (_reset_plugin_counts (err_streams)) {
1007 /* get back to where we where */
1008 _redirects.insert (i, redirect);
1009 /* we know this will work, because it worked before :) */
1010 _reset_plugin_counts (0);
1016 for (i = _redirects.begin(); i != _redirects.end(); ++i) {
1017 boost::shared_ptr<PluginInsert> pi;
1019 if ((pi = boost::dynamic_pointer_cast<PluginInsert>(*i)) != 0) {
1020 if (pi->is_generator()) {
1026 _have_internal_generator = foo;
1029 if (old_rmo != redirect_max_outs) {
1033 redirect->drop_references ();
1035 redirects_changed (src); /* EMIT SIGNAL */
1040 Route::reset_plugin_counts (uint32_t* lpc)
1042 Glib::RWLock::WriterLock lm (redirect_lock);
1043 return _reset_plugin_counts (lpc);
1048 Route::_reset_plugin_counts (uint32_t* err_streams)
1050 RedirectList::iterator r;
1053 map<Placement,list<InsertCount> > insert_map;
1054 nframes_t initial_streams;
1056 redirect_max_outs = 0;
1060 /* divide inserts up by placement so we get the signal flow
1061 properly modelled. we need to do this because the _redirects
1062 list is not sorted by placement, and because other reasons may
1063 exist now or in the future for this separate treatment.
1066 for (r = _redirects.begin(); r != _redirects.end(); ++r) {
1068 boost::shared_ptr<Insert> insert;
1070 /* do this here in case we bomb out before we get to the end of
1074 redirect_max_outs = max ((*r)->output_streams (), redirect_max_outs);
1076 if ((insert = boost::dynamic_pointer_cast<Insert>(*r)) != 0) {
1078 insert_map[insert->placement()].push_back (InsertCount (insert));
1080 /* reset plugin counts back to one for now so
1081 that we have a predictable, controlled
1082 state to try to configure.
1085 boost::shared_ptr<PluginInsert> pi;
1087 if ((pi = boost::dynamic_pointer_cast<PluginInsert>(insert)) != 0) {
1091 } else if (boost::dynamic_pointer_cast<Send> (*r) != 0) {
1104 /* Now process each placement in order, checking to see if we
1105 can really do what has been requested.
1110 if (check_some_plugin_counts (insert_map[PreFader], n_inputs (), err_streams)) {
1114 /* figure out the streams that will feed into PreFader */
1116 if (!insert_map[PreFader].empty()) {
1117 InsertCount& ic (insert_map[PreFader].back());
1118 initial_streams = ic.insert->compute_output_streams (ic.cnt);
1120 initial_streams = n_inputs ();
1125 if (check_some_plugin_counts (insert_map[PostFader], initial_streams, err_streams)) {
1129 /* OK, everything can be set up correctly, so lets do it */
1131 apply_some_plugin_counts (insert_map[PreFader]);
1132 apply_some_plugin_counts (insert_map[PostFader]);
1134 /* recompute max outs of any redirect */
1138 redirect_max_outs = 0;
1139 RedirectList::iterator prev = _redirects.end();
1141 for (r = _redirects.begin(); r != _redirects.end(); prev = r, ++r) {
1142 boost::shared_ptr<Send> s;
1144 if ((s = boost::dynamic_pointer_cast<Send> (*r)) != 0) {
1145 if (r == _redirects.begin()) {
1146 s->expect_inputs (n_inputs());
1148 s->expect_inputs ((*prev)->output_streams());
1152 redirect_max_outs = max ((*r)->output_streams (), redirect_max_outs);
1161 Route::apply_some_plugin_counts (list<InsertCount>& iclist)
1163 list<InsertCount>::iterator i;
1165 for (i = iclist.begin(); i != iclist.end(); ++i) {
1167 if ((*i).insert->configure_io ((*i).cnt, (*i).in, (*i).out)) {
1170 /* make sure that however many we have, they are all active */
1171 (*i).insert->activate ();
1178 Route::check_some_plugin_counts (list<InsertCount>& iclist, int32_t required_inputs, uint32_t* err_streams)
1180 list<InsertCount>::iterator i;
1182 for (i = iclist.begin(); i != iclist.end(); ++i) {
1184 if (((*i).cnt = (*i).insert->can_support_input_configuration (required_inputs)) < 0) {
1186 *err_streams = required_inputs;
1191 (*i).in = required_inputs;
1192 (*i).out = (*i).insert->compute_output_streams ((*i).cnt);
1194 required_inputs = (*i).out;
1201 Route::copy_redirects (const Route& other, Placement placement, uint32_t* err_streams)
1203 uint32_t old_rmo = redirect_max_outs;
1209 RedirectList to_be_deleted;
1212 Glib::RWLock::WriterLock lm (redirect_lock);
1213 RedirectList::iterator tmp;
1214 RedirectList the_copy;
1216 the_copy = _redirects;
1218 /* remove all relevant redirects */
1220 for (RedirectList::iterator i = _redirects.begin(); i != _redirects.end(); ) {
1224 if ((*i)->placement() == placement) {
1225 to_be_deleted.push_back (*i);
1226 _redirects.erase (i);
1232 /* now copy the relevant ones from "other" */
1234 for (RedirectList::const_iterator i = other._redirects.begin(); i != other._redirects.end(); ++i) {
1235 if ((*i)->placement() == placement) {
1236 _redirects.push_back (Redirect::clone (*i));
1240 /* reset plugin stream handling */
1242 if (_reset_plugin_counts (err_streams)) {
1244 /* FAILED COPY ATTEMPT: we have to restore order */
1246 /* delete all cloned redirects */
1248 for (RedirectList::iterator i = _redirects.begin(); i != _redirects.end(); ) {
1253 if ((*i)->placement() == placement) {
1254 _redirects.erase (i);
1260 /* restore the natural order */
1262 _redirects = the_copy;
1263 redirect_max_outs = old_rmo;
1265 /* we failed, even though things are OK again */
1271 /* SUCCESSFUL COPY ATTEMPT: delete the redirects we removed pre-copy */
1272 to_be_deleted.clear ();
1276 if (redirect_max_outs != old_rmo || old_rmo == 0) {
1280 redirects_changed (this); /* EMIT SIGNAL */
1285 Route::all_redirects_flip ()
1287 Glib::RWLock::ReaderLock lm (redirect_lock);
1289 if (_redirects.empty()) {
1293 bool first_is_on = _redirects.front()->active();
1295 for (RedirectList::iterator i = _redirects.begin(); i != _redirects.end(); ++i) {
1296 (*i)->set_active (!first_is_on, this);
1301 Route::all_redirects_active (bool state)
1303 Glib::RWLock::ReaderLock lm (redirect_lock);
1305 if (_redirects.empty()) {
1309 for (RedirectList::iterator i = _redirects.begin(); i != _redirects.end(); ++i) {
1310 (*i)->set_active (state, this);
1314 struct RedirectSorter {
1315 bool operator() (boost::shared_ptr<const Redirect> a, boost::shared_ptr<const Redirect> b) {
1316 return a->sort_key() < b->sort_key();
1321 Route::sort_redirects (uint32_t* err_streams)
1324 RedirectSorter comparator;
1325 Glib::RWLock::WriterLock lm (redirect_lock);
1326 uint32_t old_rmo = redirect_max_outs;
1328 /* the sweet power of C++ ... */
1330 RedirectList as_it_was_before = _redirects;
1332 _redirects.sort (comparator);
1334 if (_reset_plugin_counts (err_streams)) {
1335 _redirects = as_it_was_before;
1336 redirect_max_outs = old_rmo;
1342 redirects_changed (this); /* EMIT SIGNAL */
1354 Route::get_template()
1356 return state(false);
1360 Route::state(bool full_state)
1362 XMLNode *node = new XMLNode("Route");
1363 RedirectList:: iterator i;
1367 node->add_property("flags", enum_2_string (_flags));
1370 node->add_property("default-type", _default_type.to_string());
1372 node->add_property("active", _active?"yes":"no");
1373 node->add_property("muted", _muted?"yes":"no");
1374 node->add_property("soloed", _soloed?"yes":"no");
1375 node->add_property("phase-invert", _phase_invert?"yes":"no");
1376 node->add_property("mute-affects-pre-fader", _mute_affects_pre_fader?"yes":"no");
1377 node->add_property("mute-affects-post-fader", _mute_affects_post_fader?"yes":"no");
1378 node->add_property("mute-affects-control-outs", _mute_affects_control_outs?"yes":"no");
1379 node->add_property("mute-affects-main-outs", _mute_affects_main_outs?"yes":"no");
1382 node->add_property("edit-group", _edit_group->name());
1385 node->add_property("mix-group", _mix_group->name());
1388 string order_string;
1389 OrderKeys::iterator x = order_keys.begin();
1391 while (x != order_keys.end()) {
1392 order_string += (*x).first;
1393 order_string += '=';
1394 snprintf (buf, sizeof(buf), "%ld", (*x).second);
1395 order_string += buf;
1399 if (x == order_keys.end()) {
1403 order_string += ':';
1405 node->add_property ("order-keys", order_string);
1407 node->add_child_nocopy (IO::state (full_state));
1408 node->add_child_nocopy (_solo_control.get_state ());
1409 node->add_child_nocopy (_mute_control.get_state ());
1411 if (_control_outs) {
1412 XMLNode* cnode = new XMLNode (X_("ControlOuts"));
1413 cnode->add_child_nocopy (_control_outs->state (full_state));
1414 node->add_child_nocopy (*cnode);
1417 if (_comment.length()) {
1418 XMLNode *cmt = node->add_child ("Comment");
1419 cmt->add_content (_comment);
1422 for (i = _redirects.begin(); i != _redirects.end(); ++i) {
1423 node->add_child_nocopy((*i)->state (full_state));
1427 node->add_child_copy (*_extra_xml);
1434 Route::set_deferred_state ()
1437 XMLNodeConstIterator niter;
1439 if (!deferred_state) {
1443 nlist = deferred_state->children();
1445 for (niter = nlist.begin(); niter != nlist.end(); ++niter){
1446 add_redirect_from_xml (**niter);
1449 delete deferred_state;
1454 Route::add_redirect_from_xml (const XMLNode& node)
1456 const XMLProperty *prop;
1458 if (node.name() == "Send") {
1462 boost::shared_ptr<Send> send (new Send (_session, node));
1463 add_redirect (send, this);
1466 catch (failed_constructor &err) {
1467 error << _("Send construction failed") << endmsg;
1471 } else if (node.name() == "Insert") {
1474 if ((prop = node.property ("type")) != 0) {
1476 boost::shared_ptr<Insert> insert;
1478 if (prop->value() == "ladspa" || prop->value() == "Ladspa" || prop->value() == "vst") {
1480 insert.reset (new PluginInsert(_session, node));
1482 } else if (prop->value() == "port") {
1485 insert.reset (new PortInsert (_session, node));
1489 error << string_compose(_("unknown Insert type \"%1\"; ignored"), prop->value()) << endmsg;
1492 add_redirect (insert, this);
1495 error << _("Insert XML node has no type property") << endmsg;
1499 catch (failed_constructor &err) {
1500 warning << _("insert could not be created. Ignored.") << endmsg;
1507 Route::set_state (const XMLNode& node)
1509 return _set_state (node, true);
1513 Route::_set_state (const XMLNode& node, bool call_base)
1516 XMLNodeConstIterator niter;
1518 XMLPropertyList plist;
1519 const XMLProperty *prop;
1521 if (node.name() != "Route"){
1522 error << string_compose(_("Bad node sent to Route::set_state() [%1]"), node.name()) << endmsg;
1526 if ((prop = node.property (X_("flags"))) != 0) {
1527 _flags = Flag (string_2_enum (prop->value(), _flags));
1532 if ((prop = node.property (X_("default-type"))) != 0) {
1533 _default_type = DataType(prop->value());
1534 assert(_default_type != DataType::NIL);
1537 if ((prop = node.property (X_("phase-invert"))) != 0) {
1538 set_phase_invert(prop->value()=="yes"?true:false, this);
1541 if ((prop = node.property (X_("active"))) != 0) {
1542 set_active (prop->value() == "yes");
1545 if ((prop = node.property (X_("muted"))) != 0) {
1546 bool yn = prop->value()=="yes"?true:false;
1548 /* force reset of mute status */
1552 mute_gain = desired_mute_gain;
1555 if ((prop = node.property (X_("soloed"))) != 0) {
1556 bool yn = prop->value()=="yes"?true:false;
1558 /* force reset of solo status */
1561 set_solo (yn, this);
1562 solo_gain = desired_solo_gain;
1565 if ((prop = node.property (X_("mute-affects-pre-fader"))) != 0) {
1566 _mute_affects_pre_fader = (prop->value()=="yes")?true:false;
1569 if ((prop = node.property (X_("mute-affects-post-fader"))) != 0) {
1570 _mute_affects_post_fader = (prop->value()=="yes")?true:false;
1573 if ((prop = node.property (X_("mute-affects-control-outs"))) != 0) {
1574 _mute_affects_control_outs = (prop->value()=="yes")?true:false;
1577 if ((prop = node.property (X_("mute-affects-main-outs"))) != 0) {
1578 _mute_affects_main_outs = (prop->value()=="yes")?true:false;
1581 if ((prop = node.property (X_("edit-group"))) != 0) {
1582 RouteGroup* edit_group = _session.edit_group_by_name(prop->value());
1583 if(edit_group == 0) {
1584 error << string_compose(_("Route %1: unknown edit group \"%2 in saved state (ignored)"), _name, prop->value()) << endmsg;
1586 set_edit_group(edit_group, this);
1590 if ((prop = node.property (X_("order-keys"))) != 0) {
1594 string::size_type colon, equal;
1595 string remaining = prop->value();
1597 while (remaining.length()) {
1599 if ((equal = remaining.find_first_of ('=')) == string::npos || equal == remaining.length()) {
1600 error << string_compose (_("badly formed order key string in state file! [%1] ... ignored."), remaining)
1603 if (sscanf (remaining.substr (equal+1).c_str(), "%ld", &n) != 1) {
1604 error << string_compose (_("badly formed order key string in state file! [%1] ... ignored."), remaining)
1607 set_order_key (remaining.substr (0, equal), n);
1611 colon = remaining.find_first_of (':');
1613 if (colon != string::npos) {
1614 remaining = remaining.substr (colon+1);
1621 nlist = node.children();
1623 if (deferred_state) {
1624 delete deferred_state;
1627 deferred_state = new XMLNode(X_("deferred state"));
1629 /* set parent class properties before anything else */
1631 for (niter = nlist.begin(); niter != nlist.end(); ++niter){
1635 if (child->name() == IO::state_node_name && call_base) {
1637 IO::set_state (*child);
1642 for (niter = nlist.begin(); niter != nlist.end(); ++niter){
1646 if (child->name() == X_("Send")) {
1649 if (!IO::ports_legal) {
1651 deferred_state->add_child_copy (*child);
1654 add_redirect_from_xml (*child);
1657 } else if (child->name() == X_("Insert")) {
1659 if (!IO::ports_legal) {
1661 deferred_state->add_child_copy (*child);
1665 add_redirect_from_xml (*child);
1668 } else if (child->name() == X_("Automation")) {
1670 if ((prop = child->property (X_("path"))) != 0) {
1671 load_automation (prop->value());
1674 } else if (child->name() == X_("ControlOuts")) {
1676 string coutname = _name;
1677 coutname += _("[control]");
1679 _control_outs = new IO (_session, coutname);
1680 _control_outs->set_state (**(child->children().begin()));
1682 } else if (child->name() == X_("Comment")) {
1684 /* XXX this is a terrible API design in libxml++ */
1686 XMLNode *cmt = *(child->children().begin());
1687 _comment = cmt->content();
1689 } else if (child->name() == X_("extra")) {
1690 _extra_xml = new XMLNode (*child);
1691 } else if (child->name() == X_("solo")) {
1692 _solo_control.set_state (*child);
1693 _session.add_controllable (&_solo_control);
1694 } else if (child->name() == X_("mute")) {
1695 _mute_control.set_state (*child);
1696 _session.add_controllable (&_mute_control);
1700 if ((prop = node.property (X_("mix-group"))) != 0) {
1701 RouteGroup* mix_group = _session.mix_group_by_name(prop->value());
1702 if (mix_group == 0) {
1703 error << string_compose(_("Route %1: unknown mix group \"%2 in saved state (ignored)"), _name, prop->value()) << endmsg;
1705 set_mix_group(mix_group, this);
1713 Route::curve_reallocate ()
1715 // _gain_automation_curve.finish_resize ();
1716 // _pan_automation_curve.finish_resize ();
1720 Route::silence (nframes_t nframes, nframes_t offset)
1724 // reset_peak_meters ();
1726 IO::silence (nframes, offset);
1728 if (_control_outs) {
1729 _control_outs->silence (nframes, offset);
1733 Glib::RWLock::ReaderLock lm (redirect_lock, Glib::TRY_LOCK);
1736 for (RedirectList::iterator i = _redirects.begin(); i != _redirects.end(); ++i) {
1737 boost::shared_ptr<PluginInsert> pi;
1738 if (!_active && (pi = boost::dynamic_pointer_cast<PluginInsert> (*i)) != 0) {
1739 // skip plugins, they don't need anything when we're not active
1743 (*i)->silence (nframes, offset);
1746 if (nframes == _session.get_block_size() && offset == 0) {
1756 Route::set_control_outs (const vector<string>& ports)
1758 Glib::Mutex::Lock lm (control_outs_lock);
1759 vector<string>::const_iterator i;
1761 if (_control_outs) {
1762 delete _control_outs;
1766 if (ports.empty()) {
1770 string coutname = _name;
1771 coutname += _("[control]");
1773 _control_outs = new IO (_session, coutname);
1775 /* our control outs need as many outputs as we
1776 have outputs. we track the changes in ::output_change_handler().
1779 _control_outs->ensure_io (0, n_outputs(), true, this);
1785 Route::set_edit_group (RouteGroup *eg, void *src)
1788 if (eg == _edit_group) {
1793 _edit_group->remove (this);
1796 if ((_edit_group = eg) != 0) {
1797 _edit_group->add (this);
1800 _session.set_dirty ();
1801 edit_group_changed (src); /* EMIT SIGNAL */
1805 Route::drop_edit_group (void *src)
1808 _session.set_dirty ();
1809 edit_group_changed (src); /* EMIT SIGNAL */
1813 Route::set_mix_group (RouteGroup *mg, void *src)
1816 if (mg == _mix_group) {
1821 _mix_group->remove (this);
1824 if ((_mix_group = mg) != 0) {
1825 _mix_group->add (this);
1828 _session.set_dirty ();
1829 mix_group_changed (src); /* EMIT SIGNAL */
1833 Route::drop_mix_group (void *src)
1836 _session.set_dirty ();
1837 mix_group_changed (src); /* EMIT SIGNAL */
1841 Route::set_comment (string cmt, void *src)
1844 comment_changed (src);
1845 _session.set_dirty ();
1849 Route::feeds (boost::shared_ptr<Route> other)
1854 uint32_t no = self.n_outputs();
1855 uint32_t ni = other->n_inputs ();
1857 for (i = 0; i < no; ++i) {
1858 for (j = 0; j < ni; ++j) {
1859 if (self.output(i)->connected_to (other->input(j)->name())) {
1865 /* check Redirects which may also interconnect Routes */
1867 for (RedirectList::iterator r = _redirects.begin(); r != _redirects.end(); r++) {
1869 no = (*r)->n_outputs();
1871 for (i = 0; i < no; ++i) {
1872 for (j = 0; j < ni; ++j) {
1873 if ((*r)->output(i)->connected_to (other->input (j)->name())) {
1880 /* check for control room outputs which may also interconnect Routes */
1882 if (_control_outs) {
1884 no = _control_outs->n_outputs();
1886 for (i = 0; i < no; ++i) {
1887 for (j = 0; j < ni; ++j) {
1888 if (_control_outs->output(i)->connected_to (other->input (j)->name())) {
1899 Route::set_mute_config (mute_type t, bool onoff, void *src)
1903 _mute_affects_pre_fader = onoff;
1904 pre_fader_changed(src); /* EMIT SIGNAL */
1908 _mute_affects_post_fader = onoff;
1909 post_fader_changed(src); /* EMIT SIGNAL */
1913 _mute_affects_control_outs = onoff;
1914 control_outs_changed(src); /* EMIT SIGNAL */
1918 _mute_affects_main_outs = onoff;
1919 main_outs_changed(src); /* EMIT SIGNAL */
1925 Route::get_mute_config (mute_type t)
1931 onoff = _mute_affects_pre_fader;
1934 onoff = _mute_affects_post_fader;
1937 onoff = _mute_affects_control_outs;
1940 onoff = _mute_affects_main_outs;
1948 Route::set_active (bool yn)
1951 active_changed(); /* EMIT SIGNAL */
1955 Route::handle_transport_stopped (bool abort_ignored, bool did_locate, bool can_flush_redirects)
1957 nframes_t now = _session.transport_frame();
1960 Glib::RWLock::ReaderLock lm (redirect_lock);
1963 automation_snapshot (now);
1966 for (RedirectList::iterator i = _redirects.begin(); i != _redirects.end(); ++i) {
1968 if (Config->get_plugins_stop_with_transport() && can_flush_redirects) {
1969 (*i)->deactivate ();
1973 (*i)->transport_stopped (now);
1977 IO::transport_stopped (now);
1979 _roll_delay = _initial_delay;
1983 Route::input_change_handler (IOChange change, void *ignored)
1985 if (change & ConfigurationChanged) {
1986 reset_plugin_counts (0);
1991 Route::output_change_handler (IOChange change, void *ignored)
1993 if (change & ConfigurationChanged) {
1994 if (_control_outs) {
1995 _control_outs->ensure_io (0, n_outputs(), true, this);
1998 reset_plugin_counts (0);
2003 Route::pans_required () const
2005 if (n_outputs() < 2) {
2009 return max (n_inputs (), redirect_max_outs);
2013 Route::no_roll (nframes_t nframes, nframes_t start_frame, nframes_t end_frame, nframes_t offset,
2014 bool session_state_changing, bool can_record, bool rec_monitors_input)
2016 if (n_outputs() == 0) {
2020 if (session_state_changing || !_active) {
2021 silence (nframes, offset);
2025 apply_gain_automation = false;
2028 passthru (start_frame, end_frame, nframes, offset, 0, false);
2030 silence (nframes, offset);
2037 Route::check_initial_delay (nframes_t nframes, nframes_t& offset, nframes_t& transport_frame)
2039 if (_roll_delay > nframes) {
2041 _roll_delay -= nframes;
2042 silence (nframes, offset);
2043 /* transport frame is not legal for caller to use */
2046 } else if (_roll_delay > 0) {
2048 nframes -= _roll_delay;
2050 silence (_roll_delay, offset);
2052 offset += _roll_delay;
2053 transport_frame += _roll_delay;
2062 Route::roll (nframes_t nframes, nframes_t start_frame, nframes_t end_frame, nframes_t offset, int declick,
2063 bool can_record, bool rec_monitors_input)
2066 Glib::RWLock::ReaderLock lm (redirect_lock, Glib::TRY_LOCK);
2068 // automation snapshot can also be called from the non-rt context
2069 // and it uses the redirect list, so we take the lock out here
2070 automation_snapshot (_session.transport_frame());
2074 if ((n_outputs() == 0 && _redirects.empty()) || n_inputs() == 0 || !_active) {
2075 silence (nframes, offset);
2079 nframes_t unused = 0;
2081 if ((nframes = check_initial_delay (nframes, offset, unused)) == 0) {
2087 apply_gain_automation = false;
2090 Glib::Mutex::Lock am (automation_lock, Glib::TRY_LOCK);
2092 if (am.locked() && _session.transport_rolling()) {
2094 nframes_t start_frame = end_frame - nframes;
2096 if (gain_automation_playback()) {
2097 apply_gain_automation = _gain_automation_curve.rt_safe_get_vector (start_frame, end_frame, _session.gain_automation_buffer(), nframes);
2102 passthru (start_frame, end_frame, nframes, offset, declick, false);
2108 Route::silent_roll (nframes_t nframes, nframes_t start_frame, nframes_t end_frame, nframes_t offset,
2109 bool can_record, bool rec_monitors_input)
2111 silence (nframes, offset);
2116 Route::toggle_monitor_input ()
2118 for (vector<Port*>::iterator i = _inputs.begin(); i != _inputs.end(); ++i) {
2119 (*i)->ensure_monitor_input(!(*i)->monitoring_input());
2124 Route::has_external_redirects () const
2126 boost::shared_ptr<const PortInsert> pi;
2128 for (RedirectList::const_iterator i = _redirects.begin(); i != _redirects.end(); ++i) {
2129 if ((pi = boost::dynamic_pointer_cast<const PortInsert>(*i)) != 0) {
2131 uint32_t no = pi->n_outputs();
2133 for (uint32_t n = 0; n < no; ++n) {
2135 string port_name = pi->output(n)->name();
2136 string client_name = port_name.substr (0, port_name.find(':'));
2138 /* only say "yes" if the redirect is actually in use */
2140 if (client_name != "ardour" && pi->active()) {
2151 Route::flush_redirects ()
2153 /* XXX shouldn't really try to take this lock, since
2154 this is called from the RT audio thread.
2157 Glib::RWLock::ReaderLock lm (redirect_lock);
2159 for (RedirectList::iterator i = _redirects.begin(); i != _redirects.end(); ++i) {
2160 (*i)->deactivate ();
2166 Route::set_meter_point (MeterPoint p, void *src)
2168 if (_meter_point != p) {
2170 meter_change (src); /* EMIT SIGNAL */
2171 _session.set_dirty ();
2176 Route::update_total_latency ()
2180 for (RedirectList::iterator i = _redirects.begin(); i != _redirects.end(); ++i) {
2181 if ((*i)->active ()) {
2182 _own_latency += (*i)->latency ();
2186 set_port_latency (_own_latency);
2188 /* this (virtual) function is used for pure Routes,
2189 not derived classes like AudioTrack. this means
2190 that the data processed here comes from an input
2191 port, not prerecorded material, and therefore we
2192 have to take into account any input latency.
2195 _own_latency += input_latency ();
2197 return _own_latency;
2201 Route::set_latency_delay (nframes_t longest_session_latency)
2203 _initial_delay = longest_session_latency - _own_latency;
2205 if (_session.transport_stopped()) {
2206 _roll_delay = _initial_delay;
2211 Route::automation_snapshot (nframes_t now)
2213 IO::automation_snapshot (now);
2215 for (RedirectList::iterator i = _redirects.begin(); i != _redirects.end(); ++i) {
2216 (*i)->automation_snapshot (now);
2220 Route::ToggleControllable::ToggleControllable (std::string name, Route& s, ToggleType tp)
2221 : Controllable (name), route (s), type(tp)
2227 Route::ToggleControllable::set_value (float val)
2229 bool bval = ((val >= 0.5f) ? true: false);
2233 route.set_mute (bval, this);
2236 route.set_solo (bval, this);
2244 Route::ToggleControllable::get_value (void) const
2250 val = route.muted() ? 1.0f : 0.0f;
2253 val = route.soloed() ? 1.0f : 0.0f;
2263 Route::set_block_size (nframes_t nframes)
2265 for (RedirectList::iterator i = _redirects.begin(); i != _redirects.end(); ++i) {
2266 (*i)->set_block_size (nframes);
2271 Route::redirect_active_proxy (Redirect* ignored, void* ignored_src)
2273 _session.update_latency_compensation (false, false);
2277 Route::protect_automation ()
2279 switch (gain_automation_state()) {
2282 set_gain_automation_state (Off);
2288 switch (panner().automation_state ()) {
2291 panner().set_automation_state (Off);
2297 for (RedirectList::iterator i = _redirects.begin(); i != _redirects.end(); ++i) {
2298 boost::shared_ptr<PluginInsert> pi;
2299 if ((pi = boost::dynamic_pointer_cast<PluginInsert> (*i)) != 0) {
2300 pi->protect_automation ();
2306 Route::set_pending_declick (int declick)
2309 /* this call is not allowed to turn off a pending declick unless "force" is true */
2311 _pending_declick = declick;
2313 // cerr << _name << ": after setting to " << declick << " pending declick = " << _pending_declick << endl;
2315 _pending_declick = 0;