Ardour  9.2-129-gdf5e1050bd
route.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2000-2019 Paul Davis <paul@linuxaudiosystems.com>
3  * Copyright (C) 2006-2014 David Robillard <d@drobilla.net>
4  * Copyright (C) 2008-2012 Carl Hetherington <carl@carlh.net>
5  * Copyright (C) 2013-2019 Robin Gareus <robin@gareus.org>
6  * Copyright (C) 2015-2018 Ben Loftis <ben@harrisonconsoles.com>
7  * Copyright (C) 2015-2018 Len Ovens <len@ovenwerks.net>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License along
20  * with this program; if not, write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22  */
23 
24 #pragma once
25 
26 #include <atomic>
27 #include <cmath>
28 #include <cstring>
29 #include <list>
30 #include <map>
31 #include <memory>
32 #include <set>
33 #include <string>
34 
35 #include "pbd/fastlog.h"
36 #include "pbd/xml++.h"
37 #include "pbd/undo.h"
38 #include "pbd/mutex.h"
39 #include "pbd/stateful.h"
40 #include "pbd/controllable.h"
41 #include "pbd/destructible.h"
42 #include "pbd/rwlock.h"
43 
44 #include "temporal/domain_swap.h"
45 #include "temporal/types.h"
46 
47 #include "ardour/ardour.h"
48 #include "ardour/gain_control.h"
49 #include "ardour/instrument_info.h"
50 #include "ardour/io.h"
51 #include "ardour/io_vector.h"
53 #include "ardour/types.h"
54 #include "ardour/monitorable.h"
55 #include "ardour/muteable.h"
56 #include "ardour/mute_master.h"
57 #include "ardour/mute_control.h"
59 #include "ardour/stripable.h"
60 #include "ardour/graphnode.h"
61 #include "ardour/automatable.h"
63 #include "ardour/soloable.h"
64 #include "ardour/solo_control.h"
66 #include "ardour/slavable.h"
67 
70 class RouteCommentEditor;
71 
72 namespace ARDOUR {
73 
74 class Amp;
75 class BeatBox;
76 class DelayLine;
77 class Delivery;
78 class DiskReader;
79 class DiskWriter;
80 class IOProcessor;
81 class Panner;
82 class PannerShell;
83 class PolarityProcessor;
84 class PortSet;
85 class Processor;
86 class PluginInsert;
87 class RouteGroup;
88 class Send;
89 class InternalReturn;
90 class Location;
91 class MonitorControl;
92 class MonitorProcessor;
93 class Pannable;
94 class CapturingProcessor;
95 class InternalSend;
96 class VCA;
97 class SoloIsolateControl;
98 class PhaseControl;
99 class MonitorControl;
100 class TriggerBox;
101 class SurroundReturn;
102 class SurroundSend;
103 
105  public GraphNode,
106  public Soloable,
107  public Muteable,
108  public Monitorable,
109  public RouteGroupMember
110 {
111 public:
112 
113  typedef std::list<std::shared_ptr<Processor> > ProcessorList;
114 
116  virtual ~Route();
117 
118  virtual int init ();
119 
120  DataType data_type () const {
121  /* XXX ultimately nice to do away with this concept, but it is
122  quite useful for coders and for users too.
123  */
124  return _default_type;
125  }
126 
127  std::shared_ptr<IO> input() const { return _input; }
128  std::shared_ptr<IO> output() const { return _output; }
131 
132  ChanCount n_inputs() const { return _input->n_ports(); }
133  ChanCount n_outputs() const { return _output->n_ports(); }
134 
135  bool active() const { return _active; }
136  void set_active (bool yn, void *);
137 
138  std::string ensure_track_or_route_name (std::string) const;
139 
140  std::string comment() { return _comment; }
141  void set_comment (std::string str, void *src);
142 
143  RouteCommentEditor* comment_editor () const { return _comment_editor_window; }
144  void set_comment_editor (RouteCommentEditor* w) { _comment_editor_window = w; }
145 
146  bool set_name (const std::string& str);
147  static void set_name_in_state (XMLNode &, const std::string &);
148 
149  std::shared_ptr<MonitorControl> monitoring_control() const { return _monitoring_control; }
150  std::shared_ptr<SurroundSend> surround_send() const { return _surround_send; }
151  std::shared_ptr<SurroundReturn> surround_return() const { return _surround_return; }
152 
154  virtual MonitorState get_input_monitoring_state (bool recording, bool talkback) const { return MonitoringSilence; }
155 
156  /* these are the core of the API of a Route. see the protected sections as well */
157 
158  virtual void filter_input (BufferSet &) {}
159 
160  int roll (pframes_t nframes, samplepos_t start_sample, samplepos_t end_sample, bool& need_butler);
161 
162  int no_roll (pframes_t nframes, samplepos_t start_sample, samplepos_t end_sample, bool state_changing);
163 
165 
166  virtual bool declick_in_progress () const { return false; }
167  virtual bool can_record() { return false; }
168 
171 
172  virtual void realtime_locate (bool) {}
175 
176  /* end of vfunc-based API */
177 
178  void shift (timepos_t const &, timecnt_t const &);
179  void cut_copy_section (timepos_t const& start, timepos_t const& end, timepos_t const& to, SectionOperation const op);
180 
181  /* controls use set_solo() to modify this route's solo state */
182 
184 
185  bool soloed_by_others () const { return _solo_control->soloed_by_others(); }
186  bool soloed_by_others_upstream () const { return _solo_control->soloed_by_others_upstream(); }
187  bool soloed_by_others_downstream () const { return _solo_control->soloed_by_others_downstream(); }
188  bool self_soloed () const { return _solo_control->self_soloed(); }
189  bool soloed () const { return self_soloed () || soloed_by_others (); }
190 
191  void push_solo_upstream (int32_t delta);
192  void push_solo_isolate_upstream (int32_t delta);
193  bool can_solo () const {
194  return !(is_singleton() || is_auditioner() || is_foldbackbus());
195  }
196  bool is_safe () const {
197  return _solo_safe_control->get_value();
198  }
199  bool can_monitor () const {
200  return can_solo() || is_foldbackbus ();
201  }
204 
205  void set_denormal_protection (bool yn);
206  bool denormal_protection() const;
207 
211  MeterPoint meter_point() const { return _pending_meter_point; }
212 
214 
217 
219  DiskIOPoint disk_io_point() const { return _disk_io_point; }
220 
221  void stop_triggers (bool now);
223 
224  /* Processors */
225 
226  std::shared_ptr<Amp> amp() const { return _amp; }
227  std::shared_ptr<Amp> trim() const { return _trim; }
228  std::shared_ptr<PolarityProcessor> polarity() const { return _polarity; }
229  std::shared_ptr<PeakMeter> peak_meter() { return _meter; }
230  std::shared_ptr<const PeakMeter> peak_meter() const { return _meter; }
231  std::shared_ptr<PeakMeter> shared_peak_meter() const { return _meter; }
232  std::shared_ptr<TriggerBox> triggerbox() const { return _triggerbox; }
233 
235 
236  void foreach_processor (std::function<void(std::weak_ptr<Processor>)> method) const {
237  PBD::RWLock::ReaderLock lm (_processor_lock);
238  for (ProcessorList::const_iterator i = _processors.begin(); i != _processors.end(); ++i) {
239  method (std::weak_ptr<Processor> (*i));
240  }
241  }
242 
243  std::shared_ptr<Processor> nth_processor (uint32_t n) {
244  PBD::RWLock::ReaderLock lm (_processor_lock);
245  ProcessorList::iterator i;
246  for (i = _processors.begin(); i != _processors.end() && n; ++i, --n) {}
247  if (i == _processors.end()) {
248  return std::shared_ptr<Processor> ();
249  } else {
250  return *i;
251  }
252  }
253 
254  std::shared_ptr<Processor> processor_by_id (PBD::ID) const;
255  std::shared_ptr<Processor> plugin_by_uri (std::string const&, int offset = 0) const;
256 
257  std::shared_ptr<Processor> nth_plugin (uint32_t n) const;
258  std::shared_ptr<Processor> nth_send (uint32_t n) const;
259 
260  bool has_io_processor_named (const std::string&);
261  ChanCount max_processor_streams () const { return processor_max_streams; }
262 
263  std::list<std::string> unknown_processors () const;
264 
265  RoutePinWindowProxy * pinmgr_proxy () const { return _pinmgr_proxy; }
266  void set_pingmgr_proxy (RoutePinWindowProxy* wp) { _pinmgr_proxy = wp ; }
267 
268  PatchChangeGridDialog* patch_selector_dialog () const { return _patch_selector_dialog; }
269  void set_patch_selector_dialog (PatchChangeGridDialog* d) { _patch_selector_dialog = d; }
270 
271  std::shared_ptr<AutomationControl> automation_control_recurse (PBD::ID const & id) const;
272 
274 
276  _pending_surround_send.store (1);
277  }
278 
279  /* special processors */
280 
281  std::shared_ptr<InternalSend> monitor_send() const { return _monitor_send; }
283  std::shared_ptr<Delivery> main_outs() const { return _main_outs; }
284  std::shared_ptr<InternalReturn> internal_return() const { return _intreturn; }
285  std::shared_ptr<MonitorProcessor> monitor_control() const { return _monitor_control; }
286  std::shared_ptr<Send> internal_send_for (std::shared_ptr<const Route> target) const;
291  std::shared_ptr<CapturingProcessor> add_export_point(/* Add some argument for placement later */);
292 
297  ProcessorStreams(size_t i=0, ChanCount c=ChanCount()) : index(i), count(c) {}
298 
299  uint32_t index;
301  };
302 
303  int add_processor (std::shared_ptr<Processor>, Placement placement, ProcessorStreams* err = 0, bool activation_allowed = true);
304  int add_processor_by_index (std::shared_ptr<Processor>, int, ProcessorStreams* err = 0, bool activation_allowed = true);
305  int add_processor (std::shared_ptr<Processor>, std::shared_ptr<Processor>, ProcessorStreams* err = 0, bool activation_allowed = true);
306  int add_processors (const ProcessorList&, std::shared_ptr<Processor>, ProcessorStreams* err = 0);
307  std::shared_ptr<Processor> before_processor_for_placement (Placement);
308  std::shared_ptr<Processor> before_processor_for_index (int);
317  int remove_processor (std::shared_ptr<Processor> proc, ProcessorStreams* err = 0, bool need_process_lock = true);
325  int replace_processor (std::shared_ptr<Processor> old, std::shared_ptr<Processor> sub, ProcessorStreams* err = 0);
327  int reorder_processors (const ProcessorList& new_order, ProcessorStreams* err = 0);
332  void ab_plugins (bool forward);
335  void move_instrument_down (bool postfader = false);
336 
337  bool strict_io () const { return _strict_io; }
338  bool set_strict_io (bool);
349  bool reset_plugin_insert (std::shared_ptr<Processor> proc);
357  bool customize_plugin_insert (std::shared_ptr<Processor> proc, uint32_t count, ChanCount outs, ChanCount sinks);
358  bool add_remove_sidechain (std::shared_ptr<Processor> proc, bool);
359  bool plugin_preset_output (std::shared_ptr<Processor> proc, ChanCount outs);
360 
361  /* enable sidechain input for a given processor
362  *
363  * The sidechain itself is an IO port object with variable number of channels and configured independently.
364  * Adding/removing the port itself however requires reconfiguring the route and is hence
365  * not a plugin operation itself.
366  *
367  * @param proc the processor to add sidechain inputs to
368  * @returns true on success
369  */
370  bool add_sidechain (std::shared_ptr<Processor> proc) { return add_remove_sidechain (proc, true); }
371  /* remove sidechain input from given processor
372  * @param proc the processor to remove the sidechain input from
373  * @returns true on success
374  */
375  bool remove_sidechain (std::shared_ptr<Processor> proc) { return add_remove_sidechain (proc, false); }
376 
377  samplecnt_t update_signal_latency (bool apply_to_delayline = false, bool* delayline_update_needed = NULL);
379 
381  void set_public_port_latencies (samplecnt_t, bool playback, bool with_latcomp) const;
382 
383  samplecnt_t signal_latency() const { return _signal_latency; }
384  samplecnt_t playback_latency (bool incl_downstream = false) const;
385 
389 
390  bool is_track();
391 
398  int64_t track_number() const { return _track_number; }
399 
400  void set_track_number(int64_t tn) {
401  if (tn == _track_number) { return; }
402  _track_number = tn;
403  track_number_changed();
404  PropertyChanged (ARDOUR::Properties::name);
405  }
406 
408  None = 0x0,
409  CanReplace = 0x1,
410  MultiOut = 0x2,
411  };
412 
414  static PBD::Signal<int(std::shared_ptr<Route>, std::shared_ptr<PluginInsert>, PluginSetupOptions )> PluginSetup;
415 
417  static PBD::Signal<void(std::weak_ptr<Route> )> FanOut;
418 
428 
431 
432  /* stateful */
433  XMLNode& get_state() const;
435  virtual int set_state (const XMLNode&, int version);
436  virtual int import_state (const XMLNode&, bool use_pbd_ids = true, bool processor_only = true);
437 
439  void set_processor_state (const XMLNode&, int version);
440  virtual bool set_processor_state (XMLNode const & node, int version, XMLProperty const* prop, ProcessorList& new_order, bool& must_configure);
441 
442  std::weak_ptr<Route> weakroute ();
443 
444  int save_as_template (const std::string& path, const std::string& name, const std::string& description );
445 
447 
448  int add_aux_send (std::shared_ptr<Route>, std::shared_ptr<Processor>);
449  int add_foldback_send (std::shared_ptr<Route>, bool post_fader);
452 
458  bool direct_feeds_according_to_reality (std::shared_ptr<GraphNode>, bool* via_send_only = 0);
459 
460  std::string graph_node_name () const {
461  return name ();
462  }
463 
469  bool direct_feeds_according_to_graph (std::shared_ptr<Route>, bool* via_send_only = 0);
470 
475  bool feeds (std::shared_ptr<Route>);
476 
481  std::set<std::shared_ptr<Route>> signal_sources (bool via_sends_only = false);
482 
487 
488  /* Controls (not all directly owned by the Route) */
489 
490  std::shared_ptr<AutomationControl> get_control (const Evoral::Parameter& param);
491 
492  std::shared_ptr<SoloControl> solo_control() const {
493  return _solo_control;
494  }
495 
496  std::shared_ptr<MuteControl> mute_control() const {
497  return _mute_control;
498  }
499 
500  bool can_be_muted_by_others () const { return can_solo(); }
501  bool muted () const { return _mute_control->muted(); }
502  bool muted_by_masters () const { return _mute_control->muted_by_masters(); }
503  bool muted_by_self () const { return _mute_control->muted_by_self(); }
504  bool muted_by_others_soloing () const;
505 
506  std::shared_ptr<SoloIsolateControl> solo_isolate_control() const {
507  return _solo_isolate_control;
508  }
509 
510  std::shared_ptr<SoloSafeControl> solo_safe_control() const {
511  return _solo_safe_control;
512  }
513 
514  /* Route doesn't own these items, but sub-objects that it does own have them
515  and to make UI code a bit simpler, we provide direct access to them
516  here.
517  */
518 
519  std::shared_ptr<Panner> panner() const; /* may return null */
520  std::shared_ptr<PannerShell> panner_shell() const;
521  std::shared_ptr<Pannable> pannable() const;
522 
523  std::shared_ptr<GainControl> gain_control() const;
524  std::shared_ptr<GainControl> trim_control() const;
525  std::shared_ptr<GainControl> volume_control() const;
526  std::shared_ptr<PhaseControl> phase_control() const;
527 
529 
530  bool volume_applies_to_output () const {
531  return _volume_applies_to_output;
532  }
533 
541  std::shared_ptr<Processor> the_instrument() const;
542  InstrumentInfo& instrument_info() { return _instrument_info; }
543  bool instrument_fanned_out () const { return _instrument_fanned_out;}
544 
545 
546  /* "well-known" controls.
547  * Any or all of these may return NULL.
548  */
549 
550  std::shared_ptr<AutomationControl> pan_azimuth_control() const;
551  std::shared_ptr<AutomationControl> pan_elevation_control() const;
552  std::shared_ptr<AutomationControl> pan_width_control() const;
553  std::shared_ptr<AutomationControl> pan_frontback_control() const;
554  std::shared_ptr<AutomationControl> pan_lfe_control() const;
555 
556  uint32_t eq_band_cnt () const;
557  std::string eq_band_name (uint32_t) const;
558 
559  std::shared_ptr<AutomationControl> mapped_control (enum WellKnownCtrl, uint32_t band = 0) const;
560  std::shared_ptr<ReadOnlyControl> mapped_output (enum WellKnownData) const;
561 
562  std::shared_ptr<AutomationControl> send_level_controllable (uint32_t n, bool locked = false) const;
563  std::shared_ptr<AutomationControl> send_enable_controllable (uint32_t n) const;
564  std::shared_ptr<AutomationControl> send_pan_azimuth_controllable (uint32_t n) const;
565  std::shared_ptr<AutomationControl> send_pan_azimuth_enable_controllable (uint32_t n) const;
566 
567  std::string send_name (uint32_t n) const;
568 
569  std::shared_ptr<AutomationControl> master_send_enable_controllable () const;
570 
572 
574 
575  /* can only be executed by a route for which is_monitor() is true
576  * (i.e. the monitor out)
577  */
578  void monitor_run (samplepos_t start_sample, samplepos_t end_sample, pframes_t nframes);
579 
580  bool slaved_to (std::shared_ptr<VCA>) const;
581  bool slaved () const;
582 
583  virtual void use_captured_sources (SourceList& srcs, CaptureInfos const &) {}
584 
585 
586 protected:
587  friend class Session;
588 
589  void process ();
590 
592  void set_listen (bool);
593 
594  virtual void set_block_size (pframes_t nframes);
595 
596  virtual int no_roll_unlocked (pframes_t nframes, samplepos_t start_sample, samplepos_t end_sample, bool session_state_changing);
597 
598  virtual void snapshot_out_of_band_data (samplecnt_t /* nframes */) {}
599  virtual void write_out_of_band_data (BufferSet&, samplecnt_t /* nframes */) const {}
600  virtual void update_controls (BufferSet const&) {}
601 
603  samplepos_t start_sample, samplepos_t end_sample,
604  pframes_t nframes,
605  bool gain_automation_ok,
606  bool run_disk_processors);
607 
609 
610  virtual void bounce_process (BufferSet& bufs,
611  samplepos_t start_sample, samplecnt_t nframes,
612  std::shared_ptr<Processor> endpoint, bool include_endpoint,
613  bool for_export, bool for_freeze);
614 
615  samplecnt_t bounce_get_latency (std::shared_ptr<Processor> endpoint, bool include_endpoint, bool for_export, bool for_freeze) const;
616  ChanCount bounce_get_output_streams (ChanCount &cc, std::shared_ptr<Processor> endpoint, bool include_endpoint, bool for_export, bool for_freeze) const;
617 
618  bool can_freeze_processor (std::shared_ptr<Processor>, bool allow_routing = false) const;
619 
620  bool _active;
623 
626 
627  std::shared_ptr<IO> _input;
628  std::shared_ptr<IO> _output;
629 
630  std::shared_ptr<Delivery> _main_outs;
631  std::shared_ptr<InternalSend> _monitor_send;
632  std::shared_ptr<InternalReturn> _intreturn;
633  std::shared_ptr<MonitorProcessor> _monitor_control;
634  std::shared_ptr<Pannable> _pannable;
635  std::shared_ptr<DiskReader> _disk_reader;
636  std::shared_ptr<DiskWriter> _disk_writer;
637 #ifdef HAVE_BEATBOX
638  std::shared_ptr<BeatBox> _beatbox;
639 #endif
640  std::shared_ptr<MonitorControl> _monitoring_control;
641  std::shared_ptr<SurroundSend> _surround_send;
642  std::shared_ptr<SurroundReturn> _surround_return;
643 
645 
646  enum {
647  EmitNone = 0x00,
648  EmitMeterChanged = 0x01,
649  EmitMeterVisibilityChange = 0x02,
650  EmitRtProcessorChange = 0x04,
651  EmitSendReturnChange = 0x08
652  };
653 
655  std::atomic<int> _pending_process_reorder;
656  std::atomic<int> _pending_listen_change;
657  std::atomic<int> _pending_surround_send;
658  std::atomic<int> _pending_signals;
659 
662 
664 
665  bool _recordable : 1;
666 
667  std::shared_ptr<SoloControl> _solo_control;
668  std::shared_ptr<MuteControl> _mute_control;
669  std::shared_ptr<SoloIsolateControl> _solo_isolate_control;
670  std::shared_ptr<SoloSafeControl> _solo_safe_control;
671 
672  std::string _comment;
674 
680 
681  virtual ChanCount input_streams () const;
682 
683  virtual XMLNode& state (bool save_template) const;
684 
686 
688 
691 
692  uint32_t pans_required() const;
694 
695  std::shared_ptr<GainControl> _gain_control;
696  std::shared_ptr<GainControl> _trim_control;
697  std::shared_ptr<GainControl> _volume_control;
698  std::shared_ptr<PhaseControl> _phase_control;
699  std::shared_ptr<Amp> _amp;
700  std::shared_ptr<Amp> _trim;
701  std::shared_ptr<Amp> _volume;
702  std::shared_ptr<PeakMeter> _meter;
703  std::shared_ptr<PolarityProcessor> _polarity;
704  std::shared_ptr<TriggerBox> _triggerbox;
705 
707 
708  std::shared_ptr<DelayLine> _delayline;
709 
710  bool is_internal_processor (std::shared_ptr<Processor>) const;
711 
712  std::shared_ptr<Processor> the_instrument_unlocked() const;
713 
715 
717 
718 private:
719  /* no copy construction */
720  Route (Route const &);
721 
722  int set_state_2X (const XMLNode&, int);
723  void set_processor_state_2X (XMLNodeList const &, int);
724 
727 
728  void processor_selfdestruct (std::weak_ptr<Processor>);
729  std::vector<std::weak_ptr<Processor> > selfdestruct_sequence;
731 
734 
736  mutable std::map<Route*, bool> _connection_cache;
737 
740  void apply_processor_order (const ProcessorList& new_order);
741 
742  std::list<std::pair<ChanCount, ChanCount> > try_configure_processors (ChanCount, ProcessorStreams *);
743  std::list<std::pair<ChanCount, ChanCount> > try_configure_processors_unlocked (ChanCount, ProcessorStreams *);
744 
745  bool add_processor_from_xml_2X (const XMLNode&, int);
746 
747  void placement_range (Placement p, ProcessorList::iterator& start, ProcessorList::iterator& end);
748 
749  void set_self_solo (bool yn);
750  void unpan ();
751 
753  samplecnt_t update_port_latencies (PortSet& ports, PortSet& feeders, bool playback, samplecnt_t) const;
754 
756 
757  pframes_t latency_preroll (pframes_t nframes, samplepos_t& start_sample, samplepos_t& end_sample);
758 
759  void run_route (samplepos_t start_sample, samplepos_t end_sample, pframes_t nframes, bool gain_automation_ok, bool run_disk_reader);
760  void fill_buffers_with_input (BufferSet& bufs, std::shared_ptr<IO> io, pframes_t nframes);
761 
765 
766  void set_plugin_state_dir (std::weak_ptr<Processor>, const std::string&);
767 
772  public:
774  : _route (r)
775  , _processors (r->_processors)
776  , _processor_max_streams (r->processor_max_streams)
777  { }
778 
779  void restore () {
780  _route->_processors = _processors;
781  _route->processor_max_streams = _processor_max_streams;
782  }
783 
784  private:
785  /* this should perhaps be a shared_ptr, but ProcessorStates will
786  not hang around long enough for it to matter.
787  */
791  };
792 
793  friend class ProcessorState;
794 
795  std::shared_ptr<CapturingProcessor> _capturing_processor;
796 
797  int64_t _track_number;
803 
804  void add_well_known_ctrl (WellKnownCtrl, std::shared_ptr<PluginInsert>, int param);
806 
807  std::map<WellKnownCtrl, std::vector<std::weak_ptr<AutomationControl>>> _well_known_map;
808 
814  std::weak_ptr<Processor> _processor_after_last_custom_meter;
815 
818 };
819 
820 } // namespace ARDOUR
821 
void None
Definition: TypeList.h:49
ProcessorList _processors
Definition: route.h:789
ChanCount _processor_max_streams
Definition: route.h:790
std::shared_ptr< AutomationControl > send_level_controllable(uint32_t n, bool locked=false) const
static PBD::Signal< void(std::weak_ptr< Route >)> FanOut
Definition: route.h:417
bool reset_plugin_insert(std::shared_ptr< Processor > proc)
static PBD::Signal< int(std::shared_ptr< Route >, std::shared_ptr< PluginInsert >, PluginSetupOptions)> PluginSetup
Definition: route.h:414
std::shared_ptr< AutomationControl > pan_lfe_control() const
void add_well_known_ctrl(WellKnownCtrl)
int set_state_2X(const XMLNode &, int)
std::shared_ptr< CapturingProcessor > _capturing_processor
Definition: route.h:795
std::shared_ptr< IO > _input
Definition: route.h:627
bool can_solo() const
Definition: route.h:193
int replace_processor(std::shared_ptr< Processor > old, std::shared_ptr< Processor > sub, ProcessorStreams *err=0)
PBD::Signal< void()> io_changed
Definition: route.h:430
void clear_processors(Placement)
virtual void input_change_handler(IOChange)
std::shared_ptr< MonitorControl > monitoring_control() const
Definition: route.h:149
void process_output_buffers(BufferSet &bufs, samplepos_t start_sample, samplepos_t end_sample, pframes_t nframes, bool gain_automation_ok, bool run_disk_processors)
std::shared_ptr< IO > input() const
Definition: route.h:127
void shift(timepos_t const &, timecnt_t const &)
void push_solo_upstream(int32_t delta)
std::map< Route *, bool > _connection_cache
Definition: route.h:736
void flush_processors()
bool add_sidechain(std::shared_ptr< Processor > proc)
Definition: route.h:370
bool _volume_applies_to_output
Definition: route.h:706
std::list< std::string > unknown_processors() const
XMLNode & get_processor_state()
int remove_processor(std::shared_ptr< Processor > proc, ProcessorStreams *err=0, bool need_process_lock=true)
virtual void write_out_of_band_data(BufferSet &, samplecnt_t) const
Definition: route.h:599
samplecnt_t playback_latency(bool incl_downstream=false) const
PBD::Signal< void()> track_number_changed
Definition: route.h:397
void reset_instrument_info()
void set_pingmgr_proxy(RoutePinWindowProxy *wp)
Definition: route.h:266
void set_processor_state(const XMLNode &, int version)
void move_instrument_down(bool postfader=false)
int remove_processors(const ProcessorList &, ProcessorStreams *err=0)
samplecnt_t update_signal_latency(bool apply_to_delayline=false, bool *delayline_update_needed=NULL)
bool processors_reorder_needs_configure(const ProcessorList &new_order)
std::shared_ptr< TriggerBox > triggerbox() const
Definition: route.h:232
bool muted_by_others_soloing() const
std::string _comment
Definition: route.h:672
std::shared_ptr< InternalSend > _monitor_send
Definition: route.h:631
virtual bool set_processor_state(XMLNode const &node, int version, XMLProperty const *prop, ProcessorList &new_order, bool &must_configure)
ChanCount n_inputs() const
Definition: route.h:132
std::shared_ptr< Amp > _trim
Definition: route.h:700
bool can_monitor() const
Definition: route.h:199
std::shared_ptr< MonitorControl > _monitoring_control
Definition: route.h:640
std::string comment()
Definition: route.h:140
void set_disk_io_point(DiskIOPoint)
int add_processor_by_index(std::shared_ptr< Processor >, int, ProcessorStreams *err=0, bool activation_allowed=true)
PBD::Signal< void()> processor_latency_changed
Definition: route.h:425
std::shared_ptr< SoloControl > _solo_control
Definition: route.h:667
std::shared_ptr< SoloSafeControl > solo_safe_control() const
Definition: route.h:510
std::shared_ptr< AutomationControl > pan_width_control() const
void remove_send_from_internal_return(InternalSend *)
void add_send_to_internal_return(InternalSend *)
bool instrument_fanned_out() const
Definition: route.h:543
bool _strict_io
Definition: route.h:798
void output_change_handler(IOChange)
void set_listen(bool)
SlavableAutomationControlList slavables() const
std::weak_ptr< Route > weakroute()
void maybe_note_meter_position()
virtual void non_realtime_locate(samplepos_t)
virtual bool declick_in_progress() const
Definition: route.h:166
std::shared_ptr< AutomationControl > pan_elevation_control() const
int64_t track_number() const
Definition: route.h:398
bool _recordable
Definition: route.h:665
std::shared_ptr< GainControl > volume_control() const
PBD::Signal< void()> denormal_protection_changed
Definition: route.h:387
bool set_meter_point_unlocked()
bool has_io_processor_named(const std::string &)
ChanCount n_process_buffers()
void set_denormal_protection(bool yn)
std::atomic< int > _pending_listen_change
Definition: route.h:656
ChanCount processor_out_streams
Definition: route.h:690
std::string eq_band_name(uint32_t) const
std::shared_ptr< InternalReturn > internal_return() const
Definition: route.h:284
std::shared_ptr< PolarityProcessor > polarity() const
Definition: route.h:228
samplecnt_t set_private_port_latencies(bool playback) const
InstrumentInfo _instrument_info
Definition: route.h:677
bool muted() const
Definition: route.h:501
samplecnt_t update_port_latencies(PortSet &ports, PortSet &feeders, bool playback, samplecnt_t) const
samplecnt_t _output_latency
Definition: route.h:622
bool can_be_muted_by_others() const
Definition: route.h:500
virtual XMLNode & state(bool save_template) const
int64_t _track_number
Definition: route.h:797
void disable_plugins(Placement)
std::shared_ptr< MuteControl > _mute_control
Definition: route.h:668
std::shared_ptr< Processor > the_instrument_unlocked() const
std::shared_ptr< PeakMeter > _meter
Definition: route.h:702
bool _instrument_fanned_out
Definition: route.h:678
virtual int import_state(const XMLNode &, bool use_pbd_ids=true, bool processor_only=true)
int add_processors(const ProcessorList &, std::shared_ptr< Processor >, ProcessorStreams *err=0)
void enable_surround_send()
std::shared_ptr< SurroundSend > _surround_send
Definition: route.h:641
std::shared_ptr< SoloIsolateControl > solo_isolate_control() const
Definition: route.h:506
void disable_plugins()
void listen_position_changed()
ChanCount max_processor_streams() const
Definition: route.h:261
pframes_t latency_preroll(pframes_t nframes, samplepos_t &start_sample, samplepos_t &end_sample)
void sidechain_change_handler(IOChange)
void all_visible_processors_active(bool)
DataType _default_type
Definition: route.h:676
int configure_processors_unlocked(ProcessorStreams *, PBD::RWLock::WriterLock *)
bool _have_internal_generator
Definition: route.h:675
bool _active
Definition: route.h:620
std::shared_ptr< Processor > nth_processor(uint32_t n)
Definition: route.h:243
std::vector< std::weak_ptr< Processor > > selfdestruct_sequence
Definition: route.h:729
bool _custom_meter_position_noted
Definition: route.h:810
std::atomic< int > _pending_process_reorder
Definition: route.h:655
void non_realtime_transport_stop(samplepos_t now, bool flush)
void processor_selfdestruct(std::weak_ptr< Processor >)
std::weak_ptr< Processor > _processor_after_last_custom_meter
Definition: route.h:814
void automatables(PBD::ControllableSet &) const
virtual int no_roll_unlocked(pframes_t nframes, samplepos_t start_sample, samplepos_t end_sample, bool session_state_changing)
void add_internal_return()
int save_as_template(const std::string &path, const std::string &name, const std::string &description)
int roll(pframes_t nframes, samplepos_t start_sample, samplepos_t end_sample, bool &need_butler)
bool direct_feeds_according_to_reality(std::shared_ptr< GraphNode >, bool *via_send_only=0)
IOVector all_inputs() const
std::shared_ptr< MonitorProcessor > _monitor_control
Definition: route.h:633
ProcessorList _pending_processor_order
Definition: route.h:654
void setup_invisible_processors()
std::shared_ptr< Pannable > _pannable
Definition: route.h:634
std::shared_ptr< Processor > before_processor_for_placement(Placement)
std::shared_ptr< IO > output() const
Definition: route.h:128
std::atomic< int > _pending_signals
Definition: route.h:658
std::shared_ptr< AutomationControl > automation_control_recurse(PBD::ID const &id) const
void run_route(samplepos_t start_sample, samplepos_t end_sample, pframes_t nframes, bool gain_automation_ok, bool run_disk_reader)
void ab_plugins(bool forward)
std::shared_ptr< GainControl > trim_control() const
bool volume_applies_to_output() const
Definition: route.h:530
int reorder_processors(const ProcessorList &new_order, ProcessorStreams *err=0)
void emit_pending_signals()
std::shared_ptr< SoloIsolateControl > _solo_isolate_control
Definition: route.h:669
DataType data_type() const
Definition: route.h:120
virtual void bounce_process(BufferSet &bufs, samplepos_t start_sample, samplecnt_t nframes, std::shared_ptr< Processor > endpoint, bool include_endpoint, bool for_export, bool for_freeze)
void flush_processor_buffers_locked(samplecnt_t nframes)
std::shared_ptr< PannerShell > panner_shell() const
std::shared_ptr< PolarityProcessor > _polarity
Definition: route.h:703
void set_active(bool yn, void *)
bool customize_plugin_insert(std::shared_ptr< Processor > proc, uint32_t count, ChanCount outs, ChanCount sinks)
PBD::Signal< void()> comment_changed
Definition: route.h:388
std::shared_ptr< AutomationControl > send_pan_azimuth_controllable(uint32_t n) const
void queue_surround_processors_changed()
Definition: route.h:275
std::shared_ptr< MonitorProcessor > monitor_control() const
Definition: route.h:285
samplecnt_t _signal_latency
Definition: route.h:621
std::shared_ptr< Processor > plugin_by_uri(std::string const &, int offset=0) const
Route(Route const &)
std::shared_ptr< AutomationControl > send_pan_azimuth_enable_controllable(uint32_t n) const
bool _initial_io_setup
Definition: route.h:800
std::shared_ptr< AutomationControl > send_enable_controllable(uint32_t n) const
PluginSetupOptions
Definition: route.h:407
virtual ChanCount input_streams() const
std::list< std::pair< ChanCount, ChanCount > > try_configure_processors_unlocked(ChanCount, ProcessorStreams *)
void set_meter_type(MeterType t)
bool denormal_protection() const
XMLNode & get_template()
std::shared_ptr< Processor > nth_send(uint32_t n) const
MonitorState monitoring_state() const
int add_foldback_send(std::shared_ptr< Route >, bool post_fader)
std::shared_ptr< AutomationControl > master_send_enable_controllable() const
PBD::RWLock _processor_lock
Definition: route.h:625
bool soloed() const
Definition: route.h:189
std::shared_ptr< SurroundReturn > surround_return() const
Definition: route.h:151
InstrumentInfo & instrument_info()
Definition: route.h:542
int configure_processors(ProcessorStreams *)
std::shared_ptr< Pannable > pannable() const
void apply_latency_compensation()
virtual MonitorState get_input_monitoring_state(bool recording, bool talkback) const
Definition: route.h:154
void enable_monitor_send()
std::list< std::shared_ptr< Processor > > ProcessorList
Definition: route.h:113
std::shared_ptr< MuteControl > mute_control() const
Definition: route.h:496
bool direct_feeds_according_to_graph(std::shared_ptr< Route >, bool *via_send_only=0)
std::shared_ptr< SoloControl > solo_control() const
Definition: route.h:492
gain_t _monitor_gain
Definition: route.h:802
MeterPoint meter_point() const
Definition: route.h:211
std::shared_ptr< IO > _output
Definition: route.h:628
void update_send_delaylines()
virtual void filter_input(BufferSet &)
Definition: route.h:158
bool strict_io() const
Definition: route.h:337
std::list< std::pair< ChanCount, ChanCount > > try_configure_processors(ChanCount, ProcessorStreams *)
std::shared_ptr< AutomationControl > get_control(const Evoral::Parameter &param)
virtual void update_controls(BufferSet const &)
Definition: route.h:600
void set_volume_applies_to_output(bool)
void silence_unlocked(pframes_t)
std::string send_name(uint32_t n) const
std::shared_ptr< DelayLine > _delayline
Definition: route.h:708
int input_port_count_changing(ChanCount)
void apply_processor_order(const ProcessorList &new_order)
std::shared_ptr< PhaseControl > _phase_control
Definition: route.h:698
void set_meter_point(MeterPoint)
void set_loop(ARDOUR::Location *)
IOVector all_outputs() const
ChanCount processor_max_streams
Definition: route.h:689
void push_solo_isolate_upstream(int32_t delta)
std::shared_ptr< GainControl > _gain_control
Definition: route.h:695
std::map< WellKnownCtrl, std::vector< std::weak_ptr< AutomationControl > > > _well_known_map
Definition: route.h:807
virtual bool can_record()
Definition: route.h:167
std::shared_ptr< InternalReturn > _intreturn
Definition: route.h:632
uint32_t eq_band_cnt() const
bool active() const
Definition: route.h:135
void remove_monitor_send()
int add_processor(std::shared_ptr< Processor >, Placement placement, ProcessorStreams *err=0, bool activation_allowed=true)
void disable_processors(Placement)
void set_processor_state_2X(XMLNodeList const &, int)
virtual void set_block_size(pframes_t nframes)
std::shared_ptr< SurroundSend > surround_send() const
Definition: route.h:150
virtual void snapshot_out_of_band_data(samplecnt_t)
Definition: route.h:598
void set_patch_selector_dialog(PatchChangeGridDialog *d)
Definition: route.h:269
void set_comment(std::string str, void *src)
PBD::Signal< void(RouteProcessorChange)> processors_changed
Definition: route.h:420
std::shared_ptr< const PeakMeter > peak_meter() const
Definition: route.h:230
std::shared_ptr< Send > internal_send_for(std::shared_ptr< const Route > target) const
bool muted_by_self() const
Definition: route.h:503
void set_plugin_state_dir(std::weak_ptr< Processor >, const std::string &)
MeterPoint _meter_point
Definition: route.h:660
Route(Session &, std::string name, PresentationInfo::Flag flags=PresentationInfo::Flag(0), DataType default_type=DataType::AUDIO)
std::shared_ptr< SurroundReturn > _surround_return
Definition: route.h:642
std::shared_ptr< GainControl > _volume_control
Definition: route.h:697
void disable_processors()
bool add_processor_from_xml_2X(const XMLNode &, int)
PBD::Signal< void()> meter_change
Definition: route.h:427
RoutePinWindowProxy * _pinmgr_proxy
Definition: route.h:816
std::shared_ptr< AutomationControl > pan_azimuth_control() const
bool feeds(std::shared_ptr< Route >)
std::shared_ptr< Delivery > _main_outs
Definition: route.h:630
void monitor_run(samplepos_t start_sample, samplepos_t end_sample, pframes_t nframes)
std::shared_ptr< GainControl > gain_control() const
bool set_strict_io(bool)
PatchChangeGridDialog * _patch_selector_dialog
Definition: route.h:817
void cut_copy_section(timepos_t const &start, timepos_t const &end, timepos_t const &to, SectionOperation const op)
bool remove_sidechain(std::shared_ptr< Processor > proc)
Definition: route.h:375
PBD::Mutex selfdestruct_lock
Definition: route.h:730
Location * _loop_location
Definition: route.h:679
std::shared_ptr< Amp > trim() const
Definition: route.h:227
void fill_buffers_with_input(BufferSet &bufs, std::shared_ptr< IO > io, pframes_t nframes)
void set_track_number(int64_t tn)
Definition: route.h:400
std::shared_ptr< Panner > panner() const
void clear_all_solo_state()
virtual int set_state(const XMLNode &, int version)
ChanCount n_outputs() const
Definition: route.h:133
std::shared_ptr< Processor > nth_plugin(uint32_t n) const
virtual void realtime_locate(bool)
Definition: route.h:172
DiskIOPoint disk_io_point() const
Definition: route.h:219
static void set_name_in_state(XMLNode &, const std::string &)
int output_port_count_changing(ChanCount)
std::shared_ptr< Processor > the_instrument() const
bool slaved_to(std::shared_ptr< VCA >) const
samplecnt_t bounce_get_latency(std::shared_ptr< Processor > endpoint, bool include_endpoint, bool for_export, bool for_freeze) const
void set_processor_positions()
virtual void realtime_handle_transport_stopped()
void catch_up_on_solo_mute_override()
XMLNode & get_state() const
bool is_internal_processor(std::shared_ptr< Processor >) const
void tempo_map_changed()
virtual void use_captured_sources(SourceList &srcs, CaptureInfos const &)
Definition: route.h:583
samplecnt_t signal_latency() const
Definition: route.h:383
void protect_automation()
std::shared_ptr< SoloSafeControl > _solo_safe_control
Definition: route.h:670
bool _in_sidechain_setup
Definition: route.h:801
std::shared_ptr< DiskWriter > _disk_writer
Definition: route.h:636
MeterPoint _pending_meter_point
Definition: route.h:661
std::atomic< int > _pending_surround_send
Definition: route.h:657
bool _in_configure_processors
Definition: route.h:799
std::shared_ptr< CapturingProcessor > add_export_point()
bool soloed_by_others_downstream() const
Definition: route.h:187
void set_comment_editor(RouteCommentEditor *w)
Definition: route.h:144
int silence(pframes_t)
std::set< std::shared_ptr< Route > > signal_sources(bool via_sends_only=false)
bool slaved() const
RoutePinWindowProxy * pinmgr_proxy() const
Definition: route.h:265
std::shared_ptr< Amp > _amp
Definition: route.h:699
std::shared_ptr< Amp > amp() const
Definition: route.h:226
bool soloed_by_others_upstream() const
Definition: route.h:186
RouteCommentEditor * comment_editor() const
Definition: route.h:143
RouteCommentEditor * _comment_editor_window
Definition: route.h:673
bool can_freeze_processor(std::shared_ptr< Processor >, bool allow_routing=false) const
ChanCount bounce_get_output_streams(ChanCount &cc, std::shared_ptr< Processor > endpoint, bool include_endpoint, bool for_export, bool for_freeze) const
std::shared_ptr< Processor > processor_by_id(PBD::ID) const
bool output_effectively_connected() const
std::shared_ptr< DiskReader > _disk_reader
Definition: route.h:635
std::shared_ptr< ReadOnlyControl > mapped_output(enum WellKnownData) const
bool plugin_preset_output(std::shared_ptr< Processor > proc, ChanCount outs)
void add_well_known_ctrl(WellKnownCtrl, std::shared_ptr< PluginInsert >, int param)
bool apply_processor_changes_rt()
std::shared_ptr< InternalSend > monitor_send() const
Definition: route.h:281
bool is_safe() const
Definition: route.h:196
int add_processor(std::shared_ptr< Processor >, std::shared_ptr< Processor >, ProcessorStreams *err=0, bool activation_allowed=true)
int add_aux_send(std::shared_ptr< Route >, std::shared_ptr< Processor >)
uint32_t pans_required() const
void set_self_solo(bool yn)
std::shared_ptr< Amp > _volume
Definition: route.h:701
void foreach_processor(std::function< void(std::weak_ptr< Processor >)> method) const
Definition: route.h:236
std::shared_ptr< PhaseControl > phase_control() const
std::shared_ptr< Delivery > main_outs() const
Definition: route.h:283
bool has_external_redirects() const
PatchChangeGridDialog * patch_selector_dialog() const
Definition: route.h:268
std::shared_ptr< PeakMeter > peak_meter()
Definition: route.h:229
bool output_effectively_connected_real() const
int no_roll(pframes_t nframes, samplepos_t start_sample, samplepos_t end_sample, bool state_changing)
void placement_range(Placement p, ProcessorList::iterator &start, ProcessorList::iterator &end)
void stop_triggers(bool now)
void solo_control_changed(bool self, PBD::Controllable::GroupControlDisposition)
bool soloed_by_others() const
Definition: route.h:185
std::shared_ptr< GainControl > _trim_control
Definition: route.h:696
bool set_name(const std::string &str)
void set_public_port_latencies(samplecnt_t, bool playback, bool with_latcomp) const
bool self_soloed() const
Definition: route.h:188
ProcessorList _processors
Definition: route.h:624
bool add_remove_sidechain(std::shared_ptr< Processor > proc, bool)
std::string ensure_track_or_route_name(std::string) const
PBD::Signal< void(void *)> record_enable_changed
Definition: route.h:421
bool _denormal_protection
Definition: route.h:663
virtual ~Route()
DiskIOPoint _disk_io_point
Definition: route.h:644
std::shared_ptr< PeakMeter > shared_peak_meter() const
Definition: route.h:231
std::shared_ptr< AutomationControl > pan_frontback_control() const
MeterType meter_type() const
void remove_surround_send()
std::shared_ptr< Processor > before_processor_for_index(int)
PBD::Signal< void()> active_changed
Definition: route.h:386
std::shared_ptr< AutomationControl > mapped_control(enum WellKnownCtrl, uint32_t band=0) const
virtual int init()
PBD::Signal< void(void *)> SelectedChanged
Definition: route.h:446
std::shared_ptr< TriggerBox > _triggerbox
Definition: route.h:704
std::string graph_node_name() const
Definition: route.h:460
bool muted_by_masters() const
Definition: route.h:502
Definition: id.h:33
Definition: xml++.h:114
GtkImageIconNameData name
Definition: gtkimage.h:6
#define LIBARDOUR_API
PBD::PropertyDescriptor< std::string > name
PBD::PropertyDescriptor< timepos_t > start
PBD::PropertyDescriptor< bool > locked
uint32_t pframes_t
std::vector< std::shared_ptr< Source > > SourceList
Temporal::samplecnt_t samplecnt_t
std::vector< CaptureInfo * > CaptureInfos
std::list< std::shared_ptr< SlavableAutomationControl > > SlavableAutomationControlList
Temporal::samplepos_t samplepos_t
void flush()
DebugBits VCA
std::set< std::shared_ptr< Controllable > > ControllableSet
Definition: controllable.h:39
ProcessorStreams(size_t i=0, ChanCount c=ChanCount())
Definition: route.h:297
uint32_t index
Index of processor where configuration failed.
Definition: route.h:299
ChanCount count
Input requested of processor.
Definition: route.h:300
std::vector< XMLNode * > XMLNodeList
Definition: xml++.h:66