Ardour  8.12
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 #ifndef __ardour_route_h__
25 #define __ardour_route_h__
26 
27 #include <atomic>
28 #include <cmath>
29 #include <cstring>
30 #include <list>
31 #include <map>
32 #include <memory>
33 #include <set>
34 #include <string>
35 
36 #include <glibmm/threads.h>
37 #include "pbd/fastlog.h"
38 #include "pbd/xml++.h"
39 #include "pbd/undo.h"
40 #include "pbd/stateful.h"
41 #include "pbd/controllable.h"
42 #include "pbd/destructible.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 
71 namespace ARDOUR {
72 
73 class Amp;
74 class BeatBox;
75 class DelayLine;
76 class Delivery;
77 class DiskReader;
78 class DiskWriter;
79 class IOProcessor;
80 class Panner;
81 class PannerShell;
82 class PolarityProcessor;
83 class PortSet;
84 class Processor;
85 class PluginInsert;
86 class RouteGroup;
87 class Send;
88 class InternalReturn;
89 class Location;
90 class MonitorControl;
91 class MonitorProcessor;
92 class Pannable;
93 class CapturingProcessor;
94 class InternalSend;
95 class VCA;
96 class SoloIsolateControl;
97 class PhaseControl;
98 class MonitorControl;
99 class TriggerBox;
100 class SurroundReturn;
101 class SurroundSend;
102 
104  public GraphNode,
105  public Soloable,
106  public Muteable,
107  public Monitorable,
108  public RouteGroupMember
109 {
110 public:
111 
112  typedef std::list<std::shared_ptr<Processor> > ProcessorList;
113 
115  virtual ~Route();
116 
117  virtual int init ();
118 
119  DataType data_type () const {
120  /* XXX ultimately nice to do away with this concept, but it is
121  quite useful for coders and for users too.
122  */
123  return _default_type;
124  }
125 
126  std::shared_ptr<IO> input() const { return _input; }
127  std::shared_ptr<IO> output() const { return _output; }
130 
131  ChanCount n_inputs() const { return _input->n_ports(); }
132  ChanCount n_outputs() const { return _output->n_ports(); }
133 
134  bool active() const { return _active; }
135  void set_active (bool yn, void *);
136 
137  std::string ensure_track_or_route_name (std::string) const;
138 
139  std::string comment() { return _comment; }
140  void set_comment (std::string str, void *src);
141 
142  bool set_name (const std::string& str);
143  static void set_name_in_state (XMLNode &, const std::string &);
144 
145  std::shared_ptr<MonitorControl> monitoring_control() const { return _monitoring_control; }
146  std::shared_ptr<SurroundSend> surround_send() const { return _surround_send; }
147  std::shared_ptr<SurroundReturn> surround_return() const { return _surround_return; }
148 
150  virtual MonitorState get_input_monitoring_state (bool recording, bool talkback) const { return MonitoringSilence; }
151 
152  /* these are the core of the API of a Route. see the protected sections as well */
153 
154  virtual void filter_input (BufferSet &) {}
155 
156  int roll (pframes_t nframes, samplepos_t start_sample, samplepos_t end_sample, bool& need_butler);
157 
158  int no_roll (pframes_t nframes, samplepos_t start_sample, samplepos_t end_sample, bool state_changing);
159 
161 
162  virtual bool declick_in_progress () const { return false; }
163  virtual bool can_record() { return false; }
164 
167 
168  virtual void realtime_locate (bool) {}
171 
172  /* end of vfunc-based API */
173 
174  void shift (timepos_t const &, timecnt_t const &);
175  void cut_copy_section (timepos_t const& start, timepos_t const& end, timepos_t const& to, SectionOperation const op);
176 
177  /* controls use set_solo() to modify this route's solo state */
178 
180 
181  bool soloed_by_others () const { return _solo_control->soloed_by_others(); }
182  bool soloed_by_others_upstream () const { return _solo_control->soloed_by_others_upstream(); }
183  bool soloed_by_others_downstream () const { return _solo_control->soloed_by_others_downstream(); }
184  bool self_soloed () const { return _solo_control->self_soloed(); }
185  bool soloed () const { return self_soloed () || soloed_by_others (); }
186 
187  void push_solo_upstream (int32_t delta);
188  void push_solo_isolate_upstream (int32_t delta);
189  bool can_solo () const {
190  return !(is_singleton() || is_auditioner() || is_foldbackbus());
191  }
192  bool is_safe () const {
193  return _solo_safe_control->get_value();
194  }
195  bool can_monitor () const {
196  return can_solo() || is_foldbackbus ();
197  }
200 
201  void set_denormal_protection (bool yn);
202  bool denormal_protection() const;
203 
207  MeterPoint meter_point() const { return _pending_meter_point; }
208 
210 
213 
215  DiskIOPoint disk_io_point() const { return _disk_io_point; }
216 
217  void stop_triggers (bool now);
219 
220  /* Processors */
221 
222  std::shared_ptr<Amp> amp() const { return _amp; }
223  std::shared_ptr<Amp> trim() const { return _trim; }
224  std::shared_ptr<PolarityProcessor> polarity() const { return _polarity; }
225  std::shared_ptr<PeakMeter> peak_meter() { return _meter; }
226  std::shared_ptr<const PeakMeter> peak_meter() const { return _meter; }
227  std::shared_ptr<PeakMeter> shared_peak_meter() const { return _meter; }
228  std::shared_ptr<TriggerBox> triggerbox() const { return _triggerbox; }
229 
231 
232  void foreach_processor (boost::function<void(std::weak_ptr<Processor>)> method) const {
233  Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
234  for (ProcessorList::const_iterator i = _processors.begin(); i != _processors.end(); ++i) {
235  method (std::weak_ptr<Processor> (*i));
236  }
237  }
238 
239  std::shared_ptr<Processor> nth_processor (uint32_t n) {
240  Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
241  ProcessorList::iterator i;
242  for (i = _processors.begin(); i != _processors.end() && n; ++i, --n) {}
243  if (i == _processors.end()) {
244  return std::shared_ptr<Processor> ();
245  } else {
246  return *i;
247  }
248  }
249 
250  std::shared_ptr<Processor> processor_by_id (PBD::ID) const;
251 
252  std::shared_ptr<Processor> nth_plugin (uint32_t n) const;
253  std::shared_ptr<Processor> nth_send (uint32_t n) const;
254 
255  bool has_io_processor_named (const std::string&);
256  ChanCount max_processor_streams () const { return processor_max_streams; }
257 
258  std::list<std::string> unknown_processors () const;
259 
260  RoutePinWindowProxy * pinmgr_proxy () const { return _pinmgr_proxy; }
261  void set_pingmgr_proxy (RoutePinWindowProxy* wp) { _pinmgr_proxy = wp ; }
262 
263  PatchChangeGridDialog* patch_selector_dialog () const { return _patch_selector_dialog; }
264  void set_patch_selector_dialog (PatchChangeGridDialog* d) { _patch_selector_dialog = d; }
265 
266  std::shared_ptr<AutomationControl> automation_control_recurse (PBD::ID const & id) const;
267 
269 
271  _pending_surround_send.store (1);
272  }
273 
274  /* special processors */
275 
276  std::shared_ptr<InternalSend> monitor_send() const { return _monitor_send; }
278  std::shared_ptr<Delivery> main_outs() const { return _main_outs; }
279  std::shared_ptr<InternalReturn> internal_return() const { return _intreturn; }
280  std::shared_ptr<MonitorProcessor> monitor_control() const { return _monitor_control; }
281  std::shared_ptr<Send> internal_send_for (std::shared_ptr<const Route> target) const;
286  std::shared_ptr<CapturingProcessor> add_export_point(/* Add some argument for placement later */);
287 
292  ProcessorStreams(size_t i=0, ChanCount c=ChanCount()) : index(i), count(c) {}
293 
294  uint32_t index;
296  };
297 
298  int add_processor (std::shared_ptr<Processor>, Placement placement, ProcessorStreams* err = 0, bool activation_allowed = true);
299  int add_processor_by_index (std::shared_ptr<Processor>, int, ProcessorStreams* err = 0, bool activation_allowed = true);
300  int add_processor (std::shared_ptr<Processor>, std::shared_ptr<Processor>, ProcessorStreams* err = 0, bool activation_allowed = true);
301  int add_processors (const ProcessorList&, std::shared_ptr<Processor>, ProcessorStreams* err = 0);
302  std::shared_ptr<Processor> before_processor_for_placement (Placement);
303  std::shared_ptr<Processor> before_processor_for_index (int);
312  int remove_processor (std::shared_ptr<Processor> proc, ProcessorStreams* err = 0, bool need_process_lock = true);
320  int replace_processor (std::shared_ptr<Processor> old, std::shared_ptr<Processor> sub, ProcessorStreams* err = 0);
322  int reorder_processors (const ProcessorList& new_order, ProcessorStreams* err = 0);
327  void ab_plugins (bool forward);
330  void move_instrument_down (bool postfader = false);
331 
332  bool strict_io () const { return _strict_io; }
333  bool set_strict_io (bool);
344  bool reset_plugin_insert (std::shared_ptr<Processor> proc);
352  bool customize_plugin_insert (std::shared_ptr<Processor> proc, uint32_t count, ChanCount outs, ChanCount sinks);
353  bool add_remove_sidechain (std::shared_ptr<Processor> proc, bool);
354  bool plugin_preset_output (std::shared_ptr<Processor> proc, ChanCount outs);
355 
356  /* enable sidechain input for a given processor
357  *
358  * The sidechain itself is an IO port object with variable number of channels and configured independently.
359  * Adding/removing the port itself however requires reconfiguring the route and is hence
360  * not a plugin operation itself.
361  *
362  * @param proc the processor to add sidechain inputs to
363  * @returns true on success
364  */
365  bool add_sidechain (std::shared_ptr<Processor> proc) { return add_remove_sidechain (proc, true); }
366  /* remove sidechain input from given processor
367  * @param proc the processor to remove the sidechain input from
368  * @returns true on success
369  */
370  bool remove_sidechain (std::shared_ptr<Processor> proc) { return add_remove_sidechain (proc, false); }
371 
372  samplecnt_t update_signal_latency (bool apply_to_delayline = false, bool* delayline_update_needed = NULL);
374 
376  void set_public_port_latencies (samplecnt_t, bool playback, bool with_latcomp) const;
377 
378  samplecnt_t signal_latency() const { return _signal_latency; }
379  samplecnt_t playback_latency (bool incl_downstream = false) const;
380 
381  PBD::Signal0<void> active_changed;
382  PBD::Signal0<void> denormal_protection_changed;
383  PBD::Signal0<void> comment_changed;
384 
385  bool is_track();
386 
392  PBD::Signal0<void> track_number_changed;
393  int64_t track_number() const { return _track_number; }
394 
395  void set_track_number(int64_t tn) {
396  if (tn == _track_number) { return; }
397  _track_number = tn;
398  track_number_changed();
399  PropertyChanged (ARDOUR::Properties::name);
400  }
401 
403  None = 0x0,
404  CanReplace = 0x1,
405  MultiOut = 0x2,
406  };
407 
409  static PBD::Signal3<int, std::shared_ptr<Route>, std::shared_ptr<PluginInsert>, PluginSetupOptions > PluginSetup;
410 
412  static PBD::Signal1<void, std::weak_ptr<Route> > FanOut;
413 
415  PBD::Signal1<void,RouteProcessorChange> processors_changed;
416  PBD::Signal1<void,void*> record_enable_changed;
420  PBD::Signal0<void> processor_latency_changed;
422  PBD::Signal0<void> meter_change;
423 
425  PBD::Signal0<void> io_changed;
426 
427  /* stateful */
428  XMLNode& get_state() const;
430  virtual int set_state (const XMLNode&, int version);
431 
433  void set_processor_state (const XMLNode&, int version);
434  virtual bool set_processor_state (XMLNode const & node, int version, XMLProperty const* prop, ProcessorList& new_order, bool& must_configure);
435 
436  std::weak_ptr<Route> weakroute ();
437 
438  int save_as_template (const std::string& path, const std::string& name, const std::string& description );
439 
440  PBD::Signal1<void,void*> SelectedChanged;
441 
442  int add_aux_send (std::shared_ptr<Route>, std::shared_ptr<Processor>);
443  int add_foldback_send (std::shared_ptr<Route>, bool post_fader);
446 
452  bool direct_feeds_according_to_reality (std::shared_ptr<GraphNode>, bool* via_send_only = 0);
453 
454  std::string graph_node_name () const {
455  return name ();
456  }
457 
463  bool direct_feeds_according_to_graph (std::shared_ptr<Route>, bool* via_send_only = 0);
464 
469  bool feeds (std::shared_ptr<Route>);
470 
475  std::set<std::shared_ptr<Route>> signal_sources (bool via_sends_only = false);
476 
481 
482  /* Controls (not all directly owned by the Route) */
483 
484  std::shared_ptr<AutomationControl> get_control (const Evoral::Parameter& param);
485 
486  std::shared_ptr<SoloControl> solo_control() const {
487  return _solo_control;
488  }
489 
490  std::shared_ptr<MuteControl> mute_control() const {
491  return _mute_control;
492  }
493 
494  bool can_be_muted_by_others () const { return can_solo(); }
495  bool muted () const { return _mute_control->muted(); }
496  bool muted_by_masters () const { return _mute_control->muted_by_masters(); }
497  bool muted_by_self () const { return _mute_control->muted_by_self(); }
498  bool muted_by_others_soloing () const;
499 
500  std::shared_ptr<SoloIsolateControl> solo_isolate_control() const {
501  return _solo_isolate_control;
502  }
503 
504  std::shared_ptr<SoloSafeControl> solo_safe_control() const {
505  return _solo_safe_control;
506  }
507 
508  /* Route doesn't own these items, but sub-objects that it does own have them
509  and to make UI code a bit simpler, we provide direct access to them
510  here.
511  */
512 
513  std::shared_ptr<Panner> panner() const; /* may return null */
514  std::shared_ptr<PannerShell> panner_shell() const;
515  std::shared_ptr<Pannable> pannable() const;
516 
517  std::shared_ptr<GainControl> gain_control() const;
518  std::shared_ptr<GainControl> trim_control() const;
519  std::shared_ptr<GainControl> volume_control() const;
520  std::shared_ptr<PhaseControl> phase_control() const;
521 
523 
524  bool volume_applies_to_output () const {
525  return _volume_applies_to_output;
526  }
527 
535  std::shared_ptr<Processor> the_instrument() const;
536  InstrumentInfo& instrument_info() { return _instrument_info; }
537  bool instrument_fanned_out () const { return _instrument_fanned_out;}
538 
539 
540  /* "well-known" controls.
541  * Any or all of these may return NULL.
542  */
543 
544  std::shared_ptr<AutomationControl> pan_azimuth_control() const;
545  std::shared_ptr<AutomationControl> pan_elevation_control() const;
546  std::shared_ptr<AutomationControl> pan_width_control() const;
547  std::shared_ptr<AutomationControl> pan_frontback_control() const;
548  std::shared_ptr<AutomationControl> pan_lfe_control() const;
549 
550  uint32_t eq_band_cnt () const;
551  std::string eq_band_name (uint32_t) const;
552 
553  std::shared_ptr<AutomationControl> mapped_control (enum WellKnownCtrl, uint32_t band = 0) const;
554  std::shared_ptr<ReadOnlyControl> mapped_output (enum WellKnownData) const;
555 
556  std::shared_ptr<AutomationControl> send_level_controllable (uint32_t n, bool locked = false) const;
557  std::shared_ptr<AutomationControl> send_enable_controllable (uint32_t n) const;
558  std::shared_ptr<AutomationControl> send_pan_azimuth_controllable (uint32_t n) const;
559  std::shared_ptr<AutomationControl> send_pan_azimuth_enable_controllable (uint32_t n) const;
560 
561  std::string send_name (uint32_t n) const;
562 
563  std::shared_ptr<AutomationControl> master_send_enable_controllable () const;
564 
566 
568 
569  /* can only be executed by a route for which is_monitor() is true
570  * (i.e. the monitor out)
571  */
572  void monitor_run (samplepos_t start_sample, samplepos_t end_sample, pframes_t nframes);
573 
574  bool slaved_to (std::shared_ptr<VCA>) const;
575  bool slaved () const;
576 
577  virtual void use_captured_sources (SourceList& srcs, CaptureInfos const &) {}
578 
579 
580 protected:
581  friend class Session;
582 
583  void process ();
584 
586  void set_listen (bool);
587 
588  virtual void set_block_size (pframes_t nframes);
589 
590  virtual int no_roll_unlocked (pframes_t nframes, samplepos_t start_sample, samplepos_t end_sample, bool session_state_changing);
591 
592  virtual void snapshot_out_of_band_data (samplecnt_t /* nframes */) {}
593  virtual void write_out_of_band_data (BufferSet&, samplecnt_t /* nframes */) const {}
594  virtual void update_controls (BufferSet const&) {}
595 
597  samplepos_t start_sample, samplepos_t end_sample,
598  pframes_t nframes,
599  bool gain_automation_ok,
600  bool run_disk_processors);
601 
603 
604  virtual void bounce_process (BufferSet& bufs,
605  samplepos_t start_sample, samplecnt_t nframes,
606  std::shared_ptr<Processor> endpoint, bool include_endpoint,
607  bool for_export, bool for_freeze);
608 
609  samplecnt_t bounce_get_latency (std::shared_ptr<Processor> endpoint, bool include_endpoint, bool for_export, bool for_freeze) const;
610  ChanCount bounce_get_output_streams (ChanCount &cc, std::shared_ptr<Processor> endpoint, bool include_endpoint, bool for_export, bool for_freeze) const;
611 
612  bool can_freeze_processor (std::shared_ptr<Processor>, bool allow_routing = false) const;
613 
614  bool _active;
617 
619  mutable Glib::Threads::RWLock _processor_lock;
620 
621  std::shared_ptr<IO> _input;
622  std::shared_ptr<IO> _output;
623 
624  std::shared_ptr<Delivery> _main_outs;
625  std::shared_ptr<InternalSend> _monitor_send;
626  std::shared_ptr<InternalReturn> _intreturn;
627  std::shared_ptr<MonitorProcessor> _monitor_control;
628  std::shared_ptr<Pannable> _pannable;
629  std::shared_ptr<DiskReader> _disk_reader;
630  std::shared_ptr<DiskWriter> _disk_writer;
631 #ifdef HAVE_BEATBOX
632  std::shared_ptr<BeatBox> _beatbox;
633 #endif
634  std::shared_ptr<MonitorControl> _monitoring_control;
635  std::shared_ptr<SurroundSend> _surround_send;
636  std::shared_ptr<SurroundReturn> _surround_return;
637 
639 
640  enum {
641  EmitNone = 0x00,
642  EmitMeterChanged = 0x01,
643  EmitMeterVisibilityChange = 0x02,
644  EmitRtProcessorChange = 0x04,
645  EmitSendReturnChange = 0x08
646  };
647 
649  std::atomic<int> _pending_process_reorder;
650  std::atomic<int> _pending_listen_change;
651  std::atomic<int> _pending_surround_send;
652  std::atomic<int> _pending_signals;
653 
656 
658 
659  bool _recordable : 1;
660 
661  std::shared_ptr<SoloControl> _solo_control;
662  std::shared_ptr<MuteControl> _mute_control;
663  std::shared_ptr<SoloIsolateControl> _solo_isolate_control;
664  std::shared_ptr<SoloSafeControl> _solo_safe_control;
665 
666  std::string _comment;
669 
673 
674  virtual ChanCount input_streams () const;
675 
676  virtual XMLNode& state (bool save_template) const;
677 
679 
681 
684 
685  uint32_t pans_required() const;
687 
688  std::shared_ptr<GainControl> _gain_control;
689  std::shared_ptr<GainControl> _trim_control;
690  std::shared_ptr<GainControl> _volume_control;
691  std::shared_ptr<PhaseControl> _phase_control;
692  std::shared_ptr<Amp> _amp;
693  std::shared_ptr<Amp> _trim;
694  std::shared_ptr<Amp> _volume;
695  std::shared_ptr<PeakMeter> _meter;
696  std::shared_ptr<PolarityProcessor> _polarity;
697  std::shared_ptr<TriggerBox> _triggerbox;
698 
700 
701  std::shared_ptr<DelayLine> _delayline;
702 
703  bool is_internal_processor (std::shared_ptr<Processor>) const;
704 
705  std::shared_ptr<Processor> the_instrument_unlocked() const;
706 
708 
709 private:
710  /* no copy construction */
711  Route (Route const &);
712 
713  int set_state_2X (const XMLNode&, int);
714  void set_processor_state_2X (XMLNodeList const &, int);
715 
716  void input_change_handler (IOChange, void *src);
717  void output_change_handler (IOChange, void *src);
719 
720  void processor_selfdestruct (std::weak_ptr<Processor>);
721  std::vector<std::weak_ptr<Processor> > selfdestruct_sequence;
722  Glib::Threads::Mutex selfdestruct_lock;
723 
726 
728  mutable std::map<Route*, bool> _connection_cache;
729 
730  int configure_processors_unlocked (ProcessorStreams*, Glib::Threads::RWLock::WriterLock*);
732  void apply_processor_order (const ProcessorList& new_order);
733 
734  std::list<std::pair<ChanCount, ChanCount> > try_configure_processors (ChanCount, ProcessorStreams *);
735  std::list<std::pair<ChanCount, ChanCount> > try_configure_processors_unlocked (ChanCount, ProcessorStreams *);
736 
737  bool add_processor_from_xml_2X (const XMLNode&, int);
738 
739  void placement_range (Placement p, ProcessorList::iterator& start, ProcessorList::iterator& end);
740 
741  void set_self_solo (bool yn);
742  void unpan ();
743 
745  samplecnt_t update_port_latencies (PortSet& ports, PortSet& feeders, bool playback, samplecnt_t) const;
746 
748 
749  pframes_t latency_preroll (pframes_t nframes, samplepos_t& start_sample, samplepos_t& end_sample);
750 
751  void run_route (samplepos_t start_sample, samplepos_t end_sample, pframes_t nframes, bool gain_automation_ok, bool run_disk_reader);
752  void fill_buffers_with_input (BufferSet& bufs, std::shared_ptr<IO> io, pframes_t nframes);
753 
757 
758  void set_plugin_state_dir (std::weak_ptr<Processor>, const std::string&);
759 
764  public:
766  : _route (r)
767  , _processors (r->_processors)
768  , _processor_max_streams (r->processor_max_streams)
769  { }
770 
771  void restore () {
772  _route->_processors = _processors;
773  _route->processor_max_streams = _processor_max_streams;
774  }
775 
776  private:
777  /* this should perhaps be a shared_ptr, but ProcessorStates will
778  not hang around long enough for it to matter.
779  */
783  };
784 
785  friend class ProcessorState;
786 
787  std::shared_ptr<CapturingProcessor> _capturing_processor;
788 
789  int64_t _track_number;
795 
796  void add_well_known_ctrl (WellKnownCtrl, std::shared_ptr<PluginInsert>, int param);
798 
799  std::map<WellKnownCtrl, std::vector<std::weak_ptr<AutomationControl>>> _well_known_map;
800 
806  std::weak_ptr<Processor> _processor_after_last_custom_meter;
807 
810 };
811 
812 } // namespace ARDOUR
813 
814 #endif /* __ardour_route_h__ */
void None
Definition: TypeList.h:49
ProcessorList _processors
Definition: route.h:781
ChanCount _processor_max_streams
Definition: route.h:782
std::shared_ptr< AutomationControl > send_level_controllable(uint32_t n, bool locked=false) const
bool reset_plugin_insert(std::shared_ptr< Processor > proc)
void sidechain_change_handler(IOChange, void *src)
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:787
std::shared_ptr< IO > _input
Definition: route.h:621
bool can_solo() const
Definition: route.h:189
int replace_processor(std::shared_ptr< Processor > old, std::shared_ptr< Processor > sub, ProcessorStreams *err=0)
void clear_processors(Placement)
std::shared_ptr< MonitorControl > monitoring_control() const
Definition: route.h:145
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:126
bool output_port_count_changing(ChanCount)
void shift(timepos_t const &, timecnt_t const &)
void push_solo_upstream(int32_t delta)
std::map< Route *, bool > _connection_cache
Definition: route.h:728
void flush_processors()
bool add_sidechain(std::shared_ptr< Processor > proc)
Definition: route.h:365
bool _volume_applies_to_output
Definition: route.h:699
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:593
samplecnt_t playback_latency(bool incl_downstream=false) const
void reset_instrument_info()
void set_pingmgr_proxy(RoutePinWindowProxy *wp)
Definition: route.h:261
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:228
bool muted_by_others_soloing() const
std::string _comment
Definition: route.h:666
std::shared_ptr< InternalSend > _monitor_send
Definition: route.h:625
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:131
std::shared_ptr< Amp > _trim
Definition: route.h:693
bool can_monitor() const
Definition: route.h:195
std::shared_ptr< MonitorControl > _monitoring_control
Definition: route.h:634
std::string comment()
Definition: route.h:139
void set_disk_io_point(DiskIOPoint)
int add_processor_by_index(std::shared_ptr< Processor >, int, ProcessorStreams *err=0, bool activation_allowed=true)
std::shared_ptr< SoloControl > _solo_control
Definition: route.h:661
std::shared_ptr< SoloSafeControl > solo_safe_control() const
Definition: route.h:504
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:537
bool _strict_io
Definition: route.h:790
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:162
std::shared_ptr< AutomationControl > pan_elevation_control() const
int64_t track_number() const
Definition: route.h:393
bool _recordable
Definition: route.h:659
std::shared_ptr< GainControl > volume_control() const
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:650
ChanCount processor_out_streams
Definition: route.h:683
std::string eq_band_name(uint32_t) const
std::shared_ptr< InternalReturn > internal_return() const
Definition: route.h:279
std::shared_ptr< PolarityProcessor > polarity() const
Definition: route.h:224
samplecnt_t set_private_port_latencies(bool playback) const
InstrumentInfo _instrument_info
Definition: route.h:670
bool muted() const
Definition: route.h:495
samplecnt_t update_port_latencies(PortSet &ports, PortSet &feeders, bool playback, samplecnt_t) const
samplecnt_t _output_latency
Definition: route.h:616
bool can_be_muted_by_others() const
Definition: route.h:494
PBD::Signal0< void > meter_change
Definition: route.h:422
virtual XMLNode & state(bool save_template) const
int64_t _track_number
Definition: route.h:789
void disable_plugins(Placement)
std::shared_ptr< MuteControl > _mute_control
Definition: route.h:662
std::shared_ptr< Processor > the_instrument_unlocked() const
std::shared_ptr< PeakMeter > _meter
Definition: route.h:695
bool _instrument_fanned_out
Definition: route.h:671
PBD::Signal0< void > comment_changed
Definition: route.h:383
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:635
std::shared_ptr< SoloIsolateControl > solo_isolate_control() const
Definition: route.h:500
void disable_plugins()
void listen_position_changed()
ChanCount max_processor_streams() const
Definition: route.h:256
pframes_t latency_preroll(pframes_t nframes, samplepos_t &start_sample, samplepos_t &end_sample)
static PBD::Signal1< void, std::weak_ptr< Route > > FanOut
Definition: route.h:412
void all_visible_processors_active(bool)
DataType _default_type
Definition: route.h:668
bool _have_internal_generator
Definition: route.h:667
bool _active
Definition: route.h:614
std::shared_ptr< Processor > nth_processor(uint32_t n)
Definition: route.h:239
PBD::Signal0< void > io_changed
Definition: route.h:425
std::vector< std::weak_ptr< Processor > > selfdestruct_sequence
Definition: route.h:721
bool _custom_meter_position_noted
Definition: route.h:802
std::atomic< int > _pending_process_reorder
Definition: route.h:649
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:806
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:627
ProcessorList _pending_processor_order
Definition: route.h:648
void setup_invisible_processors()
std::shared_ptr< Pannable > _pannable
Definition: route.h:628
std::shared_ptr< Processor > before_processor_for_placement(Placement)
std::shared_ptr< IO > output() const
Definition: route.h:127
std::atomic< int > _pending_signals
Definition: route.h:652
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:524
int reorder_processors(const ProcessorList &new_order, ProcessorStreams *err=0)
void emit_pending_signals()
std::shared_ptr< SoloIsolateControl > _solo_isolate_control
Definition: route.h:663
DataType data_type() const
Definition: route.h:119
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:696
void set_active(bool yn, void *)
void input_change_handler(IOChange, void *src)
bool customize_plugin_insert(std::shared_ptr< Processor > proc, uint32_t count, ChanCount outs, ChanCount sinks)
std::shared_ptr< AutomationControl > send_pan_azimuth_controllable(uint32_t n) const
void queue_surround_processors_changed()
Definition: route.h:270
PBD::Signal1< void, void * > SelectedChanged
Definition: route.h:440
std::shared_ptr< MonitorProcessor > monitor_control() const
Definition: route.h:280
samplecnt_t _signal_latency
Definition: route.h:615
Route(Route const &)
std::shared_ptr< AutomationControl > send_pan_azimuth_enable_controllable(uint32_t n) const
bool _initial_io_setup
Definition: route.h:792
std::shared_ptr< AutomationControl > send_enable_controllable(uint32_t n) const
PluginSetupOptions
Definition: route.h:402
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
bool soloed() const
Definition: route.h:185
std::shared_ptr< SurroundReturn > surround_return() const
Definition: route.h:147
InstrumentInfo & instrument_info()
Definition: route.h:536
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:150
void enable_monitor_send()
std::list< std::shared_ptr< Processor > > ProcessorList
Definition: route.h:112
std::shared_ptr< MuteControl > mute_control() const
Definition: route.h:490
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:486
gain_t _monitor_gain
Definition: route.h:794
PBD::Signal0< void > processor_latency_changed
Definition: route.h:420
PBD::Signal1< void, void * > record_enable_changed
Definition: route.h:416
MeterPoint meter_point() const
Definition: route.h:207
std::shared_ptr< IO > _output
Definition: route.h:622
void update_send_delaylines()
virtual void filter_input(BufferSet &)
Definition: route.h:154
bool strict_io() const
Definition: route.h:332
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:594
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:701
void apply_processor_order(const ProcessorList &new_order)
std::shared_ptr< PhaseControl > _phase_control
Definition: route.h:691
void set_meter_point(MeterPoint)
void set_loop(ARDOUR::Location *)
IOVector all_outputs() const
ChanCount processor_max_streams
Definition: route.h:682
void push_solo_isolate_upstream(int32_t delta)
std::shared_ptr< GainControl > _gain_control
Definition: route.h:688
std::map< WellKnownCtrl, std::vector< std::weak_ptr< AutomationControl > > > _well_known_map
Definition: route.h:799
virtual bool can_record()
Definition: route.h:163
std::shared_ptr< InternalReturn > _intreturn
Definition: route.h:626
uint32_t eq_band_cnt() const
bool active() const
Definition: route.h:134
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:146
virtual void snapshot_out_of_band_data(samplecnt_t)
Definition: route.h:592
void set_patch_selector_dialog(PatchChangeGridDialog *d)
Definition: route.h:264
void set_comment(std::string str, void *src)
std::shared_ptr< const PeakMeter > peak_meter() const
Definition: route.h:226
std::shared_ptr< Send > internal_send_for(std::shared_ptr< const Route > target) const
bool muted_by_self() const
Definition: route.h:497
void set_plugin_state_dir(std::weak_ptr< Processor >, const std::string &)
MeterPoint _meter_point
Definition: route.h:654
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:636
std::shared_ptr< GainControl > _volume_control
Definition: route.h:690
void disable_processors()
bool add_processor_from_xml_2X(const XMLNode &, int)
Glib::Threads::RWLock _processor_lock
Definition: route.h:619
RoutePinWindowProxy * _pinmgr_proxy
Definition: route.h:808
std::shared_ptr< AutomationControl > pan_azimuth_control() const
bool feeds(std::shared_ptr< Route >)
std::shared_ptr< Delivery > _main_outs
Definition: route.h:624
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:809
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:370
Location * _loop_location
Definition: route.h:672
std::shared_ptr< Amp > trim() const
Definition: route.h:223
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:395
std::shared_ptr< Panner > panner() const
void clear_all_solo_state()
virtual int set_state(const XMLNode &, int version)
void output_change_handler(IOChange, void *src)
ChanCount n_outputs() const
Definition: route.h:132
std::shared_ptr< Processor > nth_plugin(uint32_t n) const
virtual void realtime_locate(bool)
Definition: route.h:168
DiskIOPoint disk_io_point() const
Definition: route.h:215
static void set_name_in_state(XMLNode &, const std::string &)
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:577
samplecnt_t signal_latency() const
Definition: route.h:378
void protect_automation()
std::shared_ptr< SoloSafeControl > _solo_safe_control
Definition: route.h:664
bool _in_sidechain_setup
Definition: route.h:793
std::shared_ptr< DiskWriter > _disk_writer
Definition: route.h:630
MeterPoint _pending_meter_point
Definition: route.h:655
std::atomic< int > _pending_surround_send
Definition: route.h:651
bool _in_configure_processors
Definition: route.h:791
void foreach_processor(boost::function< void(std::weak_ptr< Processor >)> method) const
Definition: route.h:232
Glib::Threads::Mutex selfdestruct_lock
Definition: route.h:722
PBD::Signal0< void > track_number_changed
Definition: route.h:392
std::shared_ptr< CapturingProcessor > add_export_point()
bool soloed_by_others_downstream() const
Definition: route.h:183
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:260
std::shared_ptr< Amp > _amp
Definition: route.h:692
std::shared_ptr< Amp > amp() const
Definition: route.h:222
bool soloed_by_others_upstream() const
Definition: route.h:182
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:629
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)
PBD::Signal0< void > denormal_protection_changed
Definition: route.h:382
bool apply_processor_changes_rt()
PBD::Signal0< void > active_changed
Definition: route.h:381
std::shared_ptr< InternalSend > monitor_send() const
Definition: route.h:276
bool is_safe() const
Definition: route.h:192
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 >)
static PBD::Signal3< int, std::shared_ptr< Route >, std::shared_ptr< PluginInsert >, PluginSetupOptions > PluginSetup
Definition: route.h:409
uint32_t pans_required() const
void set_self_solo(bool yn)
std::shared_ptr< Amp > _volume
Definition: route.h:694
std::shared_ptr< PhaseControl > phase_control() const
std::shared_ptr< Delivery > main_outs() const
Definition: route.h:278
bool has_external_redirects() const
bool input_port_count_changing(ChanCount)
PatchChangeGridDialog * patch_selector_dialog() const
Definition: route.h:263
std::shared_ptr< PeakMeter > peak_meter()
Definition: route.h:225
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:181
std::shared_ptr< GainControl > _trim_control
Definition: route.h:689
bool set_name(const std::string &str)
void set_public_port_latencies(samplecnt_t, bool playback, bool with_latcomp) const
PBD::Signal1< void, RouteProcessorChange > processors_changed
Definition: route.h:415
bool self_soloed() const
Definition: route.h:184
int configure_processors_unlocked(ProcessorStreams *, Glib::Threads::RWLock::WriterLock *)
ProcessorList _processors
Definition: route.h:618
bool add_remove_sidechain(std::shared_ptr< Processor > proc, bool)
std::string ensure_track_or_route_name(std::string) const
bool _denormal_protection
Definition: route.h:657
virtual ~Route()
DiskIOPoint _disk_io_point
Definition: route.h:638
std::shared_ptr< PeakMeter > shared_peak_meter() const
Definition: route.h:227
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)
std::shared_ptr< AutomationControl > mapped_control(enum WellKnownCtrl, uint32_t band=0) const
virtual int init()
std::shared_ptr< TriggerBox > _triggerbox
Definition: route.h:697
std::string graph_node_name() const
Definition: route.h:454
bool muted_by_masters() const
Definition: route.h:496
Definition: id.h:35
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:41
ProcessorStreams(size_t i=0, ChanCount c=ChanCount())
Definition: route.h:292
uint32_t index
Index of processor where configuration failed.
Definition: route.h:294
ChanCount count
Input requested of processor.
Definition: route.h:295
std::vector< XMLNode * > XMLNodeList
Definition: xml++.h:66