Ardour  9.0-rc1-12-g0f3760a8d1
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 <glibmm/threads.h>
36 #include "pbd/fastlog.h"
37 #include "pbd/xml++.h"
38 #include "pbd/undo.h"
39 #include "pbd/stateful.h"
40 #include "pbd/controllable.h"
41 #include "pbd/destructible.h"
42 
43 #include "temporal/domain_swap.h"
44 #include "temporal/types.h"
45 
46 #include "ardour/ardour.h"
47 #include "ardour/gain_control.h"
48 #include "ardour/instrument_info.h"
49 #include "ardour/io.h"
50 #include "ardour/io_vector.h"
52 #include "ardour/types.h"
53 #include "ardour/monitorable.h"
54 #include "ardour/muteable.h"
55 #include "ardour/mute_master.h"
56 #include "ardour/mute_control.h"
58 #include "ardour/stripable.h"
59 #include "ardour/graphnode.h"
60 #include "ardour/automatable.h"
62 #include "ardour/soloable.h"
63 #include "ardour/solo_control.h"
65 #include "ardour/slavable.h"
66 
69 class ArdourWindow;
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  ArdourWindow* comment_editor () const { return _comment_editor_window; }
143  void set_comment_editor (ArdourWindow* w) { _comment_editor_window = w; }
144 
145  bool set_name (const std::string& str);
146  static void set_name_in_state (XMLNode &, const std::string &);
147 
148  std::shared_ptr<MonitorControl> monitoring_control() const { return _monitoring_control; }
149  std::shared_ptr<SurroundSend> surround_send() const { return _surround_send; }
150  std::shared_ptr<SurroundReturn> surround_return() const { return _surround_return; }
151 
153  virtual MonitorState get_input_monitoring_state (bool recording, bool talkback) const { return MonitoringSilence; }
154 
155  /* these are the core of the API of a Route. see the protected sections as well */
156 
157  virtual void filter_input (BufferSet &) {}
158 
159  int roll (pframes_t nframes, samplepos_t start_sample, samplepos_t end_sample, bool& need_butler);
160 
161  int no_roll (pframes_t nframes, samplepos_t start_sample, samplepos_t end_sample, bool state_changing);
162 
164 
165  virtual bool declick_in_progress () const { return false; }
166  virtual bool can_record() { return false; }
167 
170 
171  virtual void realtime_locate (bool) {}
174 
175  /* end of vfunc-based API */
176 
177  void shift (timepos_t const &, timecnt_t const &);
178  void cut_copy_section (timepos_t const& start, timepos_t const& end, timepos_t const& to, SectionOperation const op);
179 
180  /* controls use set_solo() to modify this route's solo state */
181 
183 
184  bool soloed_by_others () const { return _solo_control->soloed_by_others(); }
185  bool soloed_by_others_upstream () const { return _solo_control->soloed_by_others_upstream(); }
186  bool soloed_by_others_downstream () const { return _solo_control->soloed_by_others_downstream(); }
187  bool self_soloed () const { return _solo_control->self_soloed(); }
188  bool soloed () const { return self_soloed () || soloed_by_others (); }
189 
190  void push_solo_upstream (int32_t delta);
191  void push_solo_isolate_upstream (int32_t delta);
192  bool can_solo () const {
193  return !(is_singleton() || is_auditioner() || is_foldbackbus());
194  }
195  bool is_safe () const {
196  return _solo_safe_control->get_value();
197  }
198  bool can_monitor () const {
199  return can_solo() || is_foldbackbus ();
200  }
203 
204  void set_denormal_protection (bool yn);
205  bool denormal_protection() const;
206 
210  MeterPoint meter_point() const { return _pending_meter_point; }
211 
213 
216 
218  DiskIOPoint disk_io_point() const { return _disk_io_point; }
219 
220  void stop_triggers (bool now);
222 
223  /* Processors */
224 
225  std::shared_ptr<Amp> amp() const { return _amp; }
226  std::shared_ptr<Amp> trim() const { return _trim; }
227  std::shared_ptr<PolarityProcessor> polarity() const { return _polarity; }
228  std::shared_ptr<PeakMeter> peak_meter() { return _meter; }
229  std::shared_ptr<const PeakMeter> peak_meter() const { return _meter; }
230  std::shared_ptr<PeakMeter> shared_peak_meter() const { return _meter; }
231  std::shared_ptr<TriggerBox> triggerbox() const { return _triggerbox; }
232 
234 
235  void foreach_processor (std::function<void(std::weak_ptr<Processor>)> method) const {
236  Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
237  for (ProcessorList::const_iterator i = _processors.begin(); i != _processors.end(); ++i) {
238  method (std::weak_ptr<Processor> (*i));
239  }
240  }
241 
242  std::shared_ptr<Processor> nth_processor (uint32_t n) {
243  Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
244  ProcessorList::iterator i;
245  for (i = _processors.begin(); i != _processors.end() && n; ++i, --n) {}
246  if (i == _processors.end()) {
247  return std::shared_ptr<Processor> ();
248  } else {
249  return *i;
250  }
251  }
252 
253  std::shared_ptr<Processor> processor_by_id (PBD::ID) const;
254  std::shared_ptr<Processor> plugin_by_uri (std::string const&, int offset = 0) const;
255 
256  std::shared_ptr<Processor> nth_plugin (uint32_t n) const;
257  std::shared_ptr<Processor> nth_send (uint32_t n) const;
258 
259  bool has_io_processor_named (const std::string&);
260  ChanCount max_processor_streams () const { return processor_max_streams; }
261 
262  std::list<std::string> unknown_processors () const;
263 
264  RoutePinWindowProxy * pinmgr_proxy () const { return _pinmgr_proxy; }
265  void set_pingmgr_proxy (RoutePinWindowProxy* wp) { _pinmgr_proxy = wp ; }
266 
267  PatchChangeGridDialog* patch_selector_dialog () const { return _patch_selector_dialog; }
268  void set_patch_selector_dialog (PatchChangeGridDialog* d) { _patch_selector_dialog = d; }
269 
270  std::shared_ptr<AutomationControl> automation_control_recurse (PBD::ID const & id) const;
271 
273 
275  _pending_surround_send.store (1);
276  }
277 
278  /* special processors */
279 
280  std::shared_ptr<InternalSend> monitor_send() const { return _monitor_send; }
282  std::shared_ptr<Delivery> main_outs() const { return _main_outs; }
283  std::shared_ptr<InternalReturn> internal_return() const { return _intreturn; }
284  std::shared_ptr<MonitorProcessor> monitor_control() const { return _monitor_control; }
285  std::shared_ptr<Send> internal_send_for (std::shared_ptr<const Route> target) const;
290  std::shared_ptr<CapturingProcessor> add_export_point(/* Add some argument for placement later */);
291 
296  ProcessorStreams(size_t i=0, ChanCount c=ChanCount()) : index(i), count(c) {}
297 
298  uint32_t index;
300  };
301 
302  int add_processor (std::shared_ptr<Processor>, Placement placement, ProcessorStreams* err = 0, bool activation_allowed = true);
303  int add_processor_by_index (std::shared_ptr<Processor>, int, ProcessorStreams* err = 0, bool activation_allowed = true);
304  int add_processor (std::shared_ptr<Processor>, std::shared_ptr<Processor>, ProcessorStreams* err = 0, bool activation_allowed = true);
305  int add_processors (const ProcessorList&, std::shared_ptr<Processor>, ProcessorStreams* err = 0);
306  std::shared_ptr<Processor> before_processor_for_placement (Placement);
307  std::shared_ptr<Processor> before_processor_for_index (int);
316  int remove_processor (std::shared_ptr<Processor> proc, ProcessorStreams* err = 0, bool need_process_lock = true);
324  int replace_processor (std::shared_ptr<Processor> old, std::shared_ptr<Processor> sub, ProcessorStreams* err = 0);
326  int reorder_processors (const ProcessorList& new_order, ProcessorStreams* err = 0);
331  void ab_plugins (bool forward);
334  void move_instrument_down (bool postfader = false);
335 
336  bool strict_io () const { return _strict_io; }
337  bool set_strict_io (bool);
348  bool reset_plugin_insert (std::shared_ptr<Processor> proc);
356  bool customize_plugin_insert (std::shared_ptr<Processor> proc, uint32_t count, ChanCount outs, ChanCount sinks);
357  bool add_remove_sidechain (std::shared_ptr<Processor> proc, bool);
358  bool plugin_preset_output (std::shared_ptr<Processor> proc, ChanCount outs);
359 
360  /* enable sidechain input for a given processor
361  *
362  * The sidechain itself is an IO port object with variable number of channels and configured independently.
363  * Adding/removing the port itself however requires reconfiguring the route and is hence
364  * not a plugin operation itself.
365  *
366  * @param proc the processor to add sidechain inputs to
367  * @returns true on success
368  */
369  bool add_sidechain (std::shared_ptr<Processor> proc) { return add_remove_sidechain (proc, true); }
370  /* remove sidechain input from given processor
371  * @param proc the processor to remove the sidechain input from
372  * @returns true on success
373  */
374  bool remove_sidechain (std::shared_ptr<Processor> proc) { return add_remove_sidechain (proc, false); }
375 
376  samplecnt_t update_signal_latency (bool apply_to_delayline = false, bool* delayline_update_needed = NULL);
378 
380  void set_public_port_latencies (samplecnt_t, bool playback, bool with_latcomp) const;
381 
382  samplecnt_t signal_latency() const { return _signal_latency; }
383  samplecnt_t playback_latency (bool incl_downstream = false) const;
384 
388 
389  bool is_track();
390 
397  int64_t track_number() const { return _track_number; }
398 
399  void set_track_number(int64_t tn) {
400  if (tn == _track_number) { return; }
401  _track_number = tn;
402  track_number_changed();
403  PropertyChanged (ARDOUR::Properties::name);
404  }
405 
407  None = 0x0,
408  CanReplace = 0x1,
409  MultiOut = 0x2,
410  };
411 
413  static PBD::Signal<int(std::shared_ptr<Route>, std::shared_ptr<PluginInsert>, PluginSetupOptions )> PluginSetup;
414 
416  static PBD::Signal<void(std::weak_ptr<Route> )> FanOut;
417 
427 
430 
431  /* stateful */
432  XMLNode& get_state() const;
434  virtual int set_state (const XMLNode&, int version);
435  virtual int import_state (const XMLNode&, bool use_pbd_ids = true, bool processor_only = true);
436 
438  void set_processor_state (const XMLNode&, int version);
439  virtual bool set_processor_state (XMLNode const & node, int version, XMLProperty const* prop, ProcessorList& new_order, bool& must_configure);
440 
441  std::weak_ptr<Route> weakroute ();
442 
443  int save_as_template (const std::string& path, const std::string& name, const std::string& description );
444 
446 
447  int add_aux_send (std::shared_ptr<Route>, std::shared_ptr<Processor>);
448  int add_foldback_send (std::shared_ptr<Route>, bool post_fader);
451 
457  bool direct_feeds_according_to_reality (std::shared_ptr<GraphNode>, bool* via_send_only = 0);
458 
459  std::string graph_node_name () const {
460  return name ();
461  }
462 
468  bool direct_feeds_according_to_graph (std::shared_ptr<Route>, bool* via_send_only = 0);
469 
474  bool feeds (std::shared_ptr<Route>);
475 
480  std::set<std::shared_ptr<Route>> signal_sources (bool via_sends_only = false);
481 
486 
487  /* Controls (not all directly owned by the Route) */
488 
489  std::shared_ptr<AutomationControl> get_control (const Evoral::Parameter& param);
490 
491  std::shared_ptr<SoloControl> solo_control() const {
492  return _solo_control;
493  }
494 
495  std::shared_ptr<MuteControl> mute_control() const {
496  return _mute_control;
497  }
498 
499  bool can_be_muted_by_others () const { return can_solo(); }
500  bool muted () const { return _mute_control->muted(); }
501  bool muted_by_masters () const { return _mute_control->muted_by_masters(); }
502  bool muted_by_self () const { return _mute_control->muted_by_self(); }
503  bool muted_by_others_soloing () const;
504 
505  std::shared_ptr<SoloIsolateControl> solo_isolate_control() const {
506  return _solo_isolate_control;
507  }
508 
509  std::shared_ptr<SoloSafeControl> solo_safe_control() const {
510  return _solo_safe_control;
511  }
512 
513  /* Route doesn't own these items, but sub-objects that it does own have them
514  and to make UI code a bit simpler, we provide direct access to them
515  here.
516  */
517 
518  std::shared_ptr<Panner> panner() const; /* may return null */
519  std::shared_ptr<PannerShell> panner_shell() const;
520  std::shared_ptr<Pannable> pannable() const;
521 
522  std::shared_ptr<GainControl> gain_control() const;
523  std::shared_ptr<GainControl> trim_control() const;
524  std::shared_ptr<GainControl> volume_control() const;
525  std::shared_ptr<PhaseControl> phase_control() const;
526 
528 
529  bool volume_applies_to_output () const {
530  return _volume_applies_to_output;
531  }
532 
540  std::shared_ptr<Processor> the_instrument() const;
541  InstrumentInfo& instrument_info() { return _instrument_info; }
542  bool instrument_fanned_out () const { return _instrument_fanned_out;}
543 
544 
545  /* "well-known" controls.
546  * Any or all of these may return NULL.
547  */
548 
549  std::shared_ptr<AutomationControl> pan_azimuth_control() const;
550  std::shared_ptr<AutomationControl> pan_elevation_control() const;
551  std::shared_ptr<AutomationControl> pan_width_control() const;
552  std::shared_ptr<AutomationControl> pan_frontback_control() const;
553  std::shared_ptr<AutomationControl> pan_lfe_control() const;
554 
555  uint32_t eq_band_cnt () const;
556  std::string eq_band_name (uint32_t) const;
557 
558  std::shared_ptr<AutomationControl> mapped_control (enum WellKnownCtrl, uint32_t band = 0) const;
559  std::shared_ptr<ReadOnlyControl> mapped_output (enum WellKnownData) const;
560 
561  std::shared_ptr<AutomationControl> send_level_controllable (uint32_t n, bool locked = false) const;
562  std::shared_ptr<AutomationControl> send_enable_controllable (uint32_t n) const;
563  std::shared_ptr<AutomationControl> send_pan_azimuth_controllable (uint32_t n) const;
564  std::shared_ptr<AutomationControl> send_pan_azimuth_enable_controllable (uint32_t n) const;
565 
566  std::string send_name (uint32_t n) const;
567 
568  std::shared_ptr<AutomationControl> master_send_enable_controllable () const;
569 
571 
573 
574  /* can only be executed by a route for which is_monitor() is true
575  * (i.e. the monitor out)
576  */
577  void monitor_run (samplepos_t start_sample, samplepos_t end_sample, pframes_t nframes);
578 
579  bool slaved_to (std::shared_ptr<VCA>) const;
580  bool slaved () const;
581 
582  virtual void use_captured_sources (SourceList& srcs, CaptureInfos const &) {}
583 
584 
585 protected:
586  friend class Session;
587 
588  void process ();
589 
591  void set_listen (bool);
592 
593  virtual void set_block_size (pframes_t nframes);
594 
595  virtual int no_roll_unlocked (pframes_t nframes, samplepos_t start_sample, samplepos_t end_sample, bool session_state_changing);
596 
597  virtual void snapshot_out_of_band_data (samplecnt_t /* nframes */) {}
598  virtual void write_out_of_band_data (BufferSet&, samplecnt_t /* nframes */) const {}
599  virtual void update_controls (BufferSet const&) {}
600 
602  samplepos_t start_sample, samplepos_t end_sample,
603  pframes_t nframes,
604  bool gain_automation_ok,
605  bool run_disk_processors);
606 
608 
609  virtual void bounce_process (BufferSet& bufs,
610  samplepos_t start_sample, samplecnt_t nframes,
611  std::shared_ptr<Processor> endpoint, bool include_endpoint,
612  bool for_export, bool for_freeze);
613 
614  samplecnt_t bounce_get_latency (std::shared_ptr<Processor> endpoint, bool include_endpoint, bool for_export, bool for_freeze) const;
615  ChanCount bounce_get_output_streams (ChanCount &cc, std::shared_ptr<Processor> endpoint, bool include_endpoint, bool for_export, bool for_freeze) const;
616 
617  bool can_freeze_processor (std::shared_ptr<Processor>, bool allow_routing = false) const;
618 
619  bool _active;
622 
624  mutable Glib::Threads::RWLock _processor_lock;
625 
626  std::shared_ptr<IO> _input;
627  std::shared_ptr<IO> _output;
628 
629  std::shared_ptr<Delivery> _main_outs;
630  std::shared_ptr<InternalSend> _monitor_send;
631  std::shared_ptr<InternalReturn> _intreturn;
632  std::shared_ptr<MonitorProcessor> _monitor_control;
633  std::shared_ptr<Pannable> _pannable;
634  std::shared_ptr<DiskReader> _disk_reader;
635  std::shared_ptr<DiskWriter> _disk_writer;
636 #ifdef HAVE_BEATBOX
637  std::shared_ptr<BeatBox> _beatbox;
638 #endif
639  std::shared_ptr<MonitorControl> _monitoring_control;
640  std::shared_ptr<SurroundSend> _surround_send;
641  std::shared_ptr<SurroundReturn> _surround_return;
642 
644 
645  enum {
646  EmitNone = 0x00,
647  EmitMeterChanged = 0x01,
648  EmitMeterVisibilityChange = 0x02,
649  EmitRtProcessorChange = 0x04,
650  EmitSendReturnChange = 0x08
651  };
652 
654  std::atomic<int> _pending_process_reorder;
655  std::atomic<int> _pending_listen_change;
656  std::atomic<int> _pending_surround_send;
657  std::atomic<int> _pending_signals;
658 
661 
663 
664  bool _recordable : 1;
665 
666  std::shared_ptr<SoloControl> _solo_control;
667  std::shared_ptr<MuteControl> _mute_control;
668  std::shared_ptr<SoloIsolateControl> _solo_isolate_control;
669  std::shared_ptr<SoloSafeControl> _solo_safe_control;
670 
671  std::string _comment;
675 
679 
680  virtual ChanCount input_streams () const;
681 
682  virtual XMLNode& state (bool save_template) const;
683 
685 
687 
690 
691  uint32_t pans_required() const;
693 
694  std::shared_ptr<GainControl> _gain_control;
695  std::shared_ptr<GainControl> _trim_control;
696  std::shared_ptr<GainControl> _volume_control;
697  std::shared_ptr<PhaseControl> _phase_control;
698  std::shared_ptr<Amp> _amp;
699  std::shared_ptr<Amp> _trim;
700  std::shared_ptr<Amp> _volume;
701  std::shared_ptr<PeakMeter> _meter;
702  std::shared_ptr<PolarityProcessor> _polarity;
703  std::shared_ptr<TriggerBox> _triggerbox;
704 
706 
707  std::shared_ptr<DelayLine> _delayline;
708 
709  bool is_internal_processor (std::shared_ptr<Processor>) const;
710 
711  std::shared_ptr<Processor> the_instrument_unlocked() const;
712 
714 
715  virtual void input_change_handler (IOChange, void *src);
716 
717 private:
718  /* no copy construction */
719  Route (Route const &);
720 
721  int set_state_2X (const XMLNode&, int);
722  void set_processor_state_2X (XMLNodeList const &, int);
723 
724  void output_change_handler (IOChange, void *src);
726 
727  void processor_selfdestruct (std::weak_ptr<Processor>);
728  std::vector<std::weak_ptr<Processor> > selfdestruct_sequence;
729  Glib::Threads::Mutex selfdestruct_lock;
730 
733 
735  mutable std::map<Route*, bool> _connection_cache;
736 
737  int configure_processors_unlocked (ProcessorStreams*, Glib::Threads::RWLock::WriterLock*);
739  void apply_processor_order (const ProcessorList& new_order);
740 
741  std::list<std::pair<ChanCount, ChanCount> > try_configure_processors (ChanCount, ProcessorStreams *);
742  std::list<std::pair<ChanCount, ChanCount> > try_configure_processors_unlocked (ChanCount, ProcessorStreams *);
743 
744  bool add_processor_from_xml_2X (const XMLNode&, int);
745 
746  void placement_range (Placement p, ProcessorList::iterator& start, ProcessorList::iterator& end);
747 
748  void set_self_solo (bool yn);
749  void unpan ();
750 
752  samplecnt_t update_port_latencies (PortSet& ports, PortSet& feeders, bool playback, samplecnt_t) const;
753 
755 
756  pframes_t latency_preroll (pframes_t nframes, samplepos_t& start_sample, samplepos_t& end_sample);
757 
758  void run_route (samplepos_t start_sample, samplepos_t end_sample, pframes_t nframes, bool gain_automation_ok, bool run_disk_reader);
759  void fill_buffers_with_input (BufferSet& bufs, std::shared_ptr<IO> io, pframes_t nframes);
760 
764 
765  void set_plugin_state_dir (std::weak_ptr<Processor>, const std::string&);
766 
771  public:
773  : _route (r)
774  , _processors (r->_processors)
775  , _processor_max_streams (r->processor_max_streams)
776  { }
777 
778  void restore () {
779  _route->_processors = _processors;
780  _route->processor_max_streams = _processor_max_streams;
781  }
782 
783  private:
784  /* this should perhaps be a shared_ptr, but ProcessorStates will
785  not hang around long enough for it to matter.
786  */
790  };
791 
792  friend class ProcessorState;
793 
794  std::shared_ptr<CapturingProcessor> _capturing_processor;
795 
796  int64_t _track_number;
802 
803  void add_well_known_ctrl (WellKnownCtrl, std::shared_ptr<PluginInsert>, int param);
805 
806  std::map<WellKnownCtrl, std::vector<std::weak_ptr<AutomationControl>>> _well_known_map;
807 
813  std::weak_ptr<Processor> _processor_after_last_custom_meter;
814 
817 };
818 
819 } // namespace ARDOUR
820 
void None
Definition: TypeList.h:49
ProcessorList _processors
Definition: route.h:788
ChanCount _processor_max_streams
Definition: route.h:789
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:416
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:413
void sidechain_change_handler(IOChange, void *src)
std::shared_ptr< AutomationControl > pan_lfe_control() const
ArdourWindow * _comment_editor_window
Definition: route.h:672
void add_well_known_ctrl(WellKnownCtrl)
int set_state_2X(const XMLNode &, int)
std::shared_ptr< CapturingProcessor > _capturing_processor
Definition: route.h:794
std::shared_ptr< IO > _input
Definition: route.h:626
bool can_solo() const
Definition: route.h:192
int replace_processor(std::shared_ptr< Processor > old, std::shared_ptr< Processor > sub, ProcessorStreams *err=0)
PBD::Signal< void()> io_changed
Definition: route.h:429
void clear_processors(Placement)
std::shared_ptr< MonitorControl > monitoring_control() const
Definition: route.h:148
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
void shift(timepos_t const &, timecnt_t const &)
void push_solo_upstream(int32_t delta)
std::map< Route *, bool > _connection_cache
Definition: route.h:735
void flush_processors()
bool add_sidechain(std::shared_ptr< Processor > proc)
Definition: route.h:369
bool _volume_applies_to_output
Definition: route.h:705
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:598
samplecnt_t playback_latency(bool incl_downstream=false) const
PBD::Signal< void()> track_number_changed
Definition: route.h:396
void reset_instrument_info()
void set_pingmgr_proxy(RoutePinWindowProxy *wp)
Definition: route.h:265
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:231
bool muted_by_others_soloing() const
std::string _comment
Definition: route.h:671
std::shared_ptr< InternalSend > _monitor_send
Definition: route.h:630
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:699
bool can_monitor() const
Definition: route.h:198
std::shared_ptr< MonitorControl > _monitoring_control
Definition: route.h:639
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)
PBD::Signal< void()> processor_latency_changed
Definition: route.h:424
std::shared_ptr< SoloControl > _solo_control
Definition: route.h:666
std::shared_ptr< SoloSafeControl > solo_safe_control() const
Definition: route.h:509
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:542
bool _strict_io
Definition: route.h:797
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:165
std::shared_ptr< AutomationControl > pan_elevation_control() const
int64_t track_number() const
Definition: route.h:397
bool _recordable
Definition: route.h:664
std::shared_ptr< GainControl > volume_control() const
PBD::Signal< void()> denormal_protection_changed
Definition: route.h:386
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:655
ChanCount processor_out_streams
Definition: route.h:689
std::string eq_band_name(uint32_t) const
std::shared_ptr< InternalReturn > internal_return() const
Definition: route.h:283
std::shared_ptr< PolarityProcessor > polarity() const
Definition: route.h:227
samplecnt_t set_private_port_latencies(bool playback) const
InstrumentInfo _instrument_info
Definition: route.h:676
bool muted() const
Definition: route.h:500
samplecnt_t update_port_latencies(PortSet &ports, PortSet &feeders, bool playback, samplecnt_t) const
samplecnt_t _output_latency
Definition: route.h:621
bool can_be_muted_by_others() const
Definition: route.h:499
virtual XMLNode & state(bool save_template) const
int64_t _track_number
Definition: route.h:796
void disable_plugins(Placement)
std::shared_ptr< MuteControl > _mute_control
Definition: route.h:667
std::shared_ptr< Processor > the_instrument_unlocked() const
std::shared_ptr< PeakMeter > _meter
Definition: route.h:701
bool _instrument_fanned_out
Definition: route.h:677
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:640
std::shared_ptr< SoloIsolateControl > solo_isolate_control() const
Definition: route.h:505
void disable_plugins()
void listen_position_changed()
ChanCount max_processor_streams() const
Definition: route.h:260
pframes_t latency_preroll(pframes_t nframes, samplepos_t &start_sample, samplepos_t &end_sample)
void all_visible_processors_active(bool)
DataType _default_type
Definition: route.h:674
bool _have_internal_generator
Definition: route.h:673
bool _active
Definition: route.h:619
std::shared_ptr< Processor > nth_processor(uint32_t n)
Definition: route.h:242
std::vector< std::weak_ptr< Processor > > selfdestruct_sequence
Definition: route.h:728
bool _custom_meter_position_noted
Definition: route.h:809
std::atomic< int > _pending_process_reorder
Definition: route.h:654
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:813
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:632
ProcessorList _pending_processor_order
Definition: route.h:653
void setup_invisible_processors()
std::shared_ptr< Pannable > _pannable
Definition: route.h:633
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:657
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)
virtual void input_change_handler(IOChange, void *src)
void ab_plugins(bool forward)
std::shared_ptr< GainControl > trim_control() const
bool volume_applies_to_output() const
Definition: route.h:529
int reorder_processors(const ProcessorList &new_order, ProcessorStreams *err=0)
void emit_pending_signals()
std::shared_ptr< SoloIsolateControl > _solo_isolate_control
Definition: route.h:668
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:702
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:387
std::shared_ptr< AutomationControl > send_pan_azimuth_controllable(uint32_t n) const
void queue_surround_processors_changed()
Definition: route.h:274
std::shared_ptr< MonitorProcessor > monitor_control() const
Definition: route.h:284
samplecnt_t _signal_latency
Definition: route.h:620
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:799
std::shared_ptr< AutomationControl > send_enable_controllable(uint32_t n) const
PluginSetupOptions
Definition: route.h:406
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:188
std::shared_ptr< SurroundReturn > surround_return() const
Definition: route.h:150
InstrumentInfo & instrument_info()
Definition: route.h:541
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:153
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:495
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:491
gain_t _monitor_gain
Definition: route.h:801
MeterPoint meter_point() const
Definition: route.h:210
std::shared_ptr< IO > _output
Definition: route.h:627
void update_send_delaylines()
virtual void filter_input(BufferSet &)
Definition: route.h:157
bool strict_io() const
Definition: route.h:336
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:599
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:707
int input_port_count_changing(ChanCount)
void apply_processor_order(const ProcessorList &new_order)
std::shared_ptr< PhaseControl > _phase_control
Definition: route.h:697
void set_meter_point(MeterPoint)
void set_loop(ARDOUR::Location *)
IOVector all_outputs() const
ChanCount processor_max_streams
Definition: route.h:688
void push_solo_isolate_upstream(int32_t delta)
std::shared_ptr< GainControl > _gain_control
Definition: route.h:694
std::map< WellKnownCtrl, std::vector< std::weak_ptr< AutomationControl > > > _well_known_map
Definition: route.h:806
virtual bool can_record()
Definition: route.h:166
std::shared_ptr< InternalReturn > _intreturn
Definition: route.h:631
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:149
virtual void snapshot_out_of_band_data(samplecnt_t)
Definition: route.h:597
void set_patch_selector_dialog(PatchChangeGridDialog *d)
Definition: route.h:268
void set_comment(std::string str, void *src)
PBD::Signal< void(RouteProcessorChange)> processors_changed
Definition: route.h:419
std::shared_ptr< const PeakMeter > peak_meter() const
Definition: route.h:229
std::shared_ptr< Send > internal_send_for(std::shared_ptr< const Route > target) const
bool muted_by_self() const
Definition: route.h:502
void set_plugin_state_dir(std::weak_ptr< Processor >, const std::string &)
MeterPoint _meter_point
Definition: route.h:659
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:641
std::shared_ptr< GainControl > _volume_control
Definition: route.h:696
void disable_processors()
bool add_processor_from_xml_2X(const XMLNode &, int)
Glib::Threads::RWLock _processor_lock
Definition: route.h:624
PBD::Signal< void()> meter_change
Definition: route.h:426
RoutePinWindowProxy * _pinmgr_proxy
Definition: route.h:815
std::shared_ptr< AutomationControl > pan_azimuth_control() const
bool feeds(std::shared_ptr< Route >)
std::shared_ptr< Delivery > _main_outs
Definition: route.h:629
void monitor_run(samplepos_t start_sample, samplepos_t end_sample, pframes_t nframes)
std::shared_ptr< GainControl > gain_control() const
void set_comment_editor(ArdourWindow *w)
Definition: route.h:143
bool set_strict_io(bool)
PatchChangeGridDialog * _patch_selector_dialog
Definition: route.h:816
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:374
Location * _loop_location
Definition: route.h:678
std::shared_ptr< Amp > trim() const
Definition: route.h:226
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:399
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
ArdourWindow * comment_editor() const
Definition: route.h:142
virtual void realtime_locate(bool)
Definition: route.h:171
DiskIOPoint disk_io_point() const
Definition: route.h:218
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:582
samplecnt_t signal_latency() const
Definition: route.h:382
void protect_automation()
std::shared_ptr< SoloSafeControl > _solo_safe_control
Definition: route.h:669
bool _in_sidechain_setup
Definition: route.h:800
std::shared_ptr< DiskWriter > _disk_writer
Definition: route.h:635
MeterPoint _pending_meter_point
Definition: route.h:660
std::atomic< int > _pending_surround_send
Definition: route.h:656
bool _in_configure_processors
Definition: route.h:798
Glib::Threads::Mutex selfdestruct_lock
Definition: route.h:729
std::shared_ptr< CapturingProcessor > add_export_point()
bool soloed_by_others_downstream() const
Definition: route.h:186
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:264
std::shared_ptr< Amp > _amp
Definition: route.h:698
std::shared_ptr< Amp > amp() const
Definition: route.h:225
bool soloed_by_others_upstream() const
Definition: route.h:185
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:634
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:280
bool is_safe() const
Definition: route.h:195
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:700
void foreach_processor(std::function< void(std::weak_ptr< Processor >)> method) const
Definition: route.h:235
std::shared_ptr< PhaseControl > phase_control() const
std::shared_ptr< Delivery > main_outs() const
Definition: route.h:282
bool has_external_redirects() const
PatchChangeGridDialog * patch_selector_dialog() const
Definition: route.h:267
std::shared_ptr< PeakMeter > peak_meter()
Definition: route.h:228
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:184
std::shared_ptr< GainControl > _trim_control
Definition: route.h:695
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:187
int configure_processors_unlocked(ProcessorStreams *, Glib::Threads::RWLock::WriterLock *)
ProcessorList _processors
Definition: route.h:623
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:420
bool _denormal_protection
Definition: route.h:662
virtual ~Route()
DiskIOPoint _disk_io_point
Definition: route.h:643
std::shared_ptr< PeakMeter > shared_peak_meter() const
Definition: route.h:230
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:385
std::shared_ptr< AutomationControl > mapped_control(enum WellKnownCtrl, uint32_t band=0) const
virtual int init()
PBD::Signal< void(void *)> SelectedChanged
Definition: route.h:445
std::shared_ptr< TriggerBox > _triggerbox
Definition: route.h:703
std::string graph_node_name() const
Definition: route.h:459
bool muted_by_masters() const
Definition: route.h:501
Definition: id.h:34
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:40
ProcessorStreams(size_t i=0, ChanCount c=ChanCount())
Definition: route.h:296
uint32_t index
Index of processor where configuration failed.
Definition: route.h:298
ChanCount count
Input requested of processor.
Definition: route.h:299
std::vector< XMLNode * > XMLNodeList
Definition: xml++.h:66