ardour
port_group.cc
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2009 Paul Davis
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 
18 */
19 
20 #include <cstring>
21 #include <boost/shared_ptr.hpp>
22 #include <boost/algorithm/string.hpp>
23 
24 #include "midi++/mmc.h"
25 
26 #include "ardour/audioengine.h"
27 #include "ardour/auditioner.h"
28 #include "ardour/bundle.h"
30 #include "ardour/io_processor.h"
31 #include "ardour/midi_port.h"
33 #include "ardour/session.h"
34 #include "ardour/user_bundle.h"
35 #include "ardour/port.h"
36 
37 #include "control_protocol/control_protocol.h"
38 
39 #include "gui_thread.h"
40 #include "port_group.h"
41 #include "port_matrix.h"
42 #include "time_axis_view.h"
43 #include "public_editor.h"
44 
45 #include "i18n.h"
46 
47 using namespace std;
48 using namespace Gtk;
49 using namespace ARDOUR;
50 
54 PortGroup::PortGroup (std::string const & n)
55  : name (n)
56 {
57 
58 }
59 
61 {
62  for (BundleList::iterator i = _bundles.begin(); i != _bundles.end(); ++i) {
63  delete *i;
64  }
65  _bundles.clear ();
66 }
67 
72 void
74 {
75  add_bundle_internal (b, boost::shared_ptr<IO> (), false, Gdk::Color (), allow_dups);
76 }
77 
82 void
84 {
85  add_bundle_internal (b, io, false, Gdk::Color (), false);
86 }
87 
92 void
94 {
95  add_bundle_internal (b, io, true, c, false);
96 }
97 
99  : bundle (b)
100  , io (iop)
101  , colour (c)
102  , has_colour (has_c)
103 {
104 }
105 
106 void
107 PortGroup::add_bundle_internal (boost::shared_ptr<Bundle> b, boost::shared_ptr<IO> io, bool has_colour, Gdk::Color colour, bool allow_dups)
108 {
109  assert (b.get());
110 
111  if (!allow_dups) {
112 
113  /* don't add this bundle if we already have one with the same ports */
114 
115  BundleList::iterator i = _bundles.begin ();
116  while (i != _bundles.end() && b->has_same_ports ((*i)->bundle) == false) {
117  ++i;
118  }
119 
120  if (i != _bundles.end ()) {
121  return;
122  }
123  }
124 
125  BundleRecord* br = new BundleRecord (b, io, colour, has_colour);
126  b->Changed.connect (br->changed_connection, invalidator (*this), boost::bind (&PortGroup::bundle_changed, this, _1), gui_context());
127  _bundles.push_back (br);
128 
129  Changed ();
130 }
131 
132 void
134 {
135  assert (b.get());
136 
137  BundleList::iterator i = _bundles.begin ();
138  while (i != _bundles.end() && (*i)->bundle != b) {
139  ++i;
140  }
141 
142  if (i == _bundles.end()) {
143  return;
144  }
145 
146  delete *i;
147  _bundles.erase (i);
148 
149  Changed ();
150 }
151 
152 void
154 {
155  BundleChanged (c);
156 }
157 
158 
159 void
161 {
162  for (BundleList::iterator i = _bundles.begin(); i != _bundles.end(); ++i) {
163  delete *i;
164  }
165 
166  _bundles.clear ();
167  Changed ();
168 }
169 
170 bool
171 PortGroup::has_port (std::string const& p) const
172 {
173  for (BundleList::const_iterator i = _bundles.begin(); i != _bundles.end(); ++i) {
174  if ((*i)->bundle->offers_port_alone (p)) {
175  return true;
176  }
177  }
178 
179  return false;
180 }
181 
184 {
185  assert (_bundles.size() == 1);
186  return _bundles.front()->bundle;
187 }
188 
189 
190 ChanCount
192 {
193  ChanCount n;
194  for (BundleList::const_iterator i = _bundles.begin(); i != _bundles.end(); ++i) {
195  n += (*i)->bundle->nchannels ();
196  }
197 
198  return n;
199 }
200 
203 {
204  BundleList::const_iterator i = _bundles.begin ();
205  while (i != _bundles.end() && (*i)->bundle != b) {
206  ++i;
207  }
208 
209  if (i == _bundles.end()) {
210  return boost::shared_ptr<IO> ();
211  }
212 
213  boost::shared_ptr<IO> io ((*i)->io.lock ());
214  return io;
215 }
216 
218 void
220 {
221  BundleList::iterator i = _bundles.begin();
222  while (i != _bundles.end()) {
223 
224  BundleList::iterator tmp = i;
225  ++tmp;
226 
227  bool remove = false;
228 
229  for (BundleList::iterator j = _bundles.begin(); j != _bundles.end(); ++j) {
230 
231  if ((*j)->bundle->nchannels() > (*i)->bundle->nchannels()) {
232  /* this bundle is larger */
233 
234  uint32_t k = 0;
235  while (k < (*i)->bundle->nchannels().n_total()) {
236  /* see if this channel on *i has an equivalent on *j */
237  uint32_t l = 0;
238  while (l < (*j)->bundle->nchannels().n_total() && (*i)->bundle->channel_ports (k) != (*j)->bundle->channel_ports (l)) {
239  ++l;
240  }
241 
242  if (l == (*j)->bundle->nchannels().n_total()) {
243  /* it does not */
244  break;
245  }
246 
247  ++k;
248  }
249 
250  if (k == (*i)->bundle->nchannels().n_total()) {
251  /* all channels on *i are represented by the larger bundle *j, so remove *i */
252  remove = true;
253  break;
254  }
255  }
256  }
257 
258  if (remove) {
259  _bundles.erase (i);
260  }
261 
262  i = tmp;
263  }
264 }
265 
266 
270  : _signals_suspended (false), _pending_change (false), _pending_bundle_change ((Bundle::Change) 0)
271 {
272 
273 }
274 
276 {
277  /* XXX need to clean up bundles, but ownership shared with PortGroups */
278 }
279 
280 void
282  boost::weak_ptr<Processor> wp, list<boost::shared_ptr<IO> >* route_ios, bool inputs, set<boost::shared_ptr<IO> >& used_io
283  )
284 {
285  boost::shared_ptr<Processor> p (wp.lock());
286 
287  if (!p) {
288  return;
289  }
290 
292 
293  if (iop) {
294 
295  boost::shared_ptr<IO> io = inputs ? iop->input() : iop->output();
296 
297  if (io && used_io.find (io) == used_io.end()) {
298  route_ios->push_back (io);
299  used_io.insert (io);
300  }
301  }
302 }
303 
304 struct RouteIOs {
306  route = r;
307  ios.push_back (i);
308  }
309 
311  /* it's ok to use a shared_ptr here as RouteIOs structs are only used during ::gather () */
312  std::list<boost::shared_ptr<IO> > ios;
313 };
314 
316 public:
317  bool operator() (RouteIOs const & a, RouteIOs const & b) {
318  return a.route->order_key () < b.route->order_key ();
319  }
320 };
321 
328 void
329 PortGroupList::gather (ARDOUR::Session* session, ARDOUR::DataType type, bool inputs, bool allow_dups, bool use_session_bundles)
330 {
331  clear ();
332 
333  if (session == 0) {
334  return;
335  }
336 
337  boost::shared_ptr<PortGroup> bus (new PortGroup (string_compose (_("%1 Busses"), PROGRAM_NAME)));
338  boost::shared_ptr<PortGroup> track (new PortGroup (string_compose (_("%1 Tracks"), PROGRAM_NAME)));
339  boost::shared_ptr<PortGroup> system (new PortGroup (_("Hardware")));
340  boost::shared_ptr<PortGroup> ardour (new PortGroup (string_compose (_("%1 Misc"), PROGRAM_NAME)));
341  boost::shared_ptr<PortGroup> other (new PortGroup (_("Other")));
342 
343  /* Find the IOs which have bundles for routes and their processors. We store
344  these IOs in a RouteIOs class so that we can then sort the results by route
345  order key.
346  */
347 
348  boost::shared_ptr<RouteList> routes = session->get_routes ();
349  list<RouteIOs> route_ios;
350 
351  for (RouteList::const_iterator i = routes->begin(); i != routes->end(); ++i) {
352 
353  /* we never show the monitor bus inputs */
354 
355  if (inputs && (*i)->is_monitor()) {
356  continue;
357  }
358 
359  /* keep track of IOs that we have taken bundles from,
360  so that we can avoid taking the same IO from both
361  Route::output() and the main_outs Delivery
362  */
363 
364  set<boost::shared_ptr<IO> > used_io;
365  boost::shared_ptr<IO> io = inputs ? (*i)->input() : (*i)->output();
366  used_io.insert (io);
367 
368  RouteIOs rb (*i, io);
369  (*i)->foreach_processor (boost::bind (&PortGroupList::maybe_add_processor_to_list, this, _1, &rb.ios, inputs, used_io));
370 
371  route_ios.push_back (rb);
372  }
373 
374  /* Sort RouteIOs by the routes' editor order keys */
375  route_ios.sort (RouteIOsComparator ());
376 
377  /* Now put the bundles that belong to these sorted RouteIOs into the PortGroup.
378  Note that if the RouteIO's bundles are multi-type, we may make new Bundles
379  with only the ports of one type.
380  */
381 
382  for (list<RouteIOs>::iterator i = route_ios.begin(); i != route_ios.end(); ++i) {
384 
385  /* Work out which group to put these IOs' bundles in */
387  if (boost::dynamic_pointer_cast<Track> (i->route)) {
388  g = track;
389  } else {
390  g = bus;
391  }
392 
393  for (list<boost::shared_ptr<IO> >::iterator j = i->ios.begin(); j != i->ios.end(); ++j) {
394  if (tv) {
395  g->add_bundle ((*j)->bundle(), *j, tv->color ());
396  } else {
397  g->add_bundle ((*j)->bundle(), *j);
398  }
399  }
400  }
401 
402  /* Bundles owned by the session; add user bundles first, then normal ones, so
403  that UserBundles that offer the same ports as a normal bundle get priority
404  */
405 
406  boost::shared_ptr<BundleList> b = session->bundles ();
407 
408  for (BundleList::iterator i = b->begin(); i != b->end(); ++i) {
409  if (boost::dynamic_pointer_cast<UserBundle> (*i) && (*i)->ports_are_inputs() == inputs) {
410  system->add_bundle (*i, allow_dups);
411  }
412  }
413 
414  /* Only look for non-user bundles if instructed to do so */
415  if (use_session_bundles) {
416  for (BundleList::iterator i = b->begin(); i != b->end(); ++i) {
417  if (boost::dynamic_pointer_cast<UserBundle> (*i) == 0 && (*i)->ports_are_inputs() == inputs) {
418  system->add_bundle (*i, allow_dups);
419  }
420  }
421  }
422 
423  /* Ardour stuff */
424 
425  if (!inputs) {
426  ardour->add_bundle (session->the_auditioner()->output()->bundle());
427  ardour->add_bundle (session->click_io()->bundle());
428  /* Note: the LTC ports do not have the usual ":audio_out 1" postfix, so
429  * ardour->add_bundle (session->ltc_output_io()->bundle());
430  * won't work
431  */
432  boost::shared_ptr<Bundle> ltc (new Bundle (_("LTC Out"), inputs));
433  ltc->add_channel (_("LTC Out"), DataType::AUDIO, session->engine().make_port_name_non_relative (session->ltc_output_port()->name()));
434  ardour->add_bundle (ltc);
435  } else {
436  boost::shared_ptr<Bundle> ltc (new Bundle (_("LTC In"), inputs));
437  ltc->add_channel (_("LTC In"), DataType::AUDIO, session->engine().make_port_name_non_relative (session->ltc_input_port()->name()));
438  ardour->add_bundle (ltc);
439  }
440 
441  /* Ardour's control surfaces */
442 
443  ControlProtocolManager& m = ControlProtocolManager::instance ();
444  for (list<ControlProtocolInfo*>::iterator i = m.control_protocol_info.begin(); i != m.control_protocol_info.end(); ++i) {
445  if ((*i)->protocol) {
446  list<boost::shared_ptr<Bundle> > b = (*i)->protocol->bundles ();
447  for (list<boost::shared_ptr<Bundle> >::iterator j = b.begin(); j != b.end(); ++j) {
448  if ((*j)->ports_are_inputs() == inputs) {
449  ardour->add_bundle (*j);
450  }
451  }
452  }
453  }
454 
455  /* Ardour's sync ports */
456 
457  if ((type == DataType::MIDI || type == DataType::NIL)) {
458  boost::shared_ptr<Bundle> sync (new Bundle (_("Sync"), inputs));
459  AudioEngine* ae = AudioEngine::instance();
460 
461  if (inputs) {
462  sync->add_channel (
463  _("MTC in"), DataType::MIDI, ae->make_port_name_non_relative (session->mtc_input_port()->name())
464  );
465  sync->add_channel (
466  _("MIDI control in"), DataType::MIDI, ae->make_port_name_non_relative (session->midi_input_port()->name())
467  );
468  sync->add_channel (
469  _("MIDI clock in"), DataType::MIDI, ae->make_port_name_non_relative (session->midi_clock_input_port()->name())
470  );
471  sync->add_channel (
472  _("MMC in"), DataType::MIDI, ae->make_port_name_non_relative (session->mmc_input_port()->name())
473  );
474  } else {
475  sync->add_channel (
476  _("MTC out"), DataType::MIDI, ae->make_port_name_non_relative (session->mtc_output_port()->name())
477  );
478  sync->add_channel (
479  _("MIDI control out"), DataType::MIDI, ae->make_port_name_non_relative (session->midi_output_port()->name())
480  );
481  sync->add_channel (
482  _("MIDI clock out"), DataType::MIDI, ae->make_port_name_non_relative (session->midi_clock_output_port()->name())
483  );
484  sync->add_channel (
485  _("MMC out"), DataType::MIDI, ae->make_port_name_non_relative (session->mmc_output_port()->name())
486  );
487  }
488 
489  ardour->add_bundle (sync);
490  }
491 
492  /* Now find all other ports that we haven't thought of yet */
493 
494  std::vector<std::string> extra_system[DataType::num_types];
495  std::vector<std::string> extra_other[DataType::num_types];
496 
497  string lpn (PROGRAM_NAME);
498  boost::to_lower (lpn);
499  string lpnc = lpn;
500  lpnc += ':';
501 
502  vector<string> ports;
503  if (AudioEngine::instance()->get_ports ("", type, inputs ? IsInput : IsOutput, ports) > 0) {
504 
505  for (vector<string>::const_iterator s = ports.begin(); s != ports.end(); ) {
506 
507  std::string const p = *s;
508 
509  if (!system->has_port(p) &&
510  !bus->has_port(p) &&
511  !track->has_port(p) &&
512  !ardour->has_port(p) &&
513  !other->has_port(p)) {
514 
515  /* special hack: ignore MIDI ports labelled Midi-Through. these
516  are basically useless and mess things up for default
517  connections.
518  */
519 
520  if (p.find ("Midi-Through") != string::npos) {
521  ++s;
522  continue;
523  }
524 
525  /* special hack: ignore our monitor inputs (which show up here because
526  we excluded them earlier.
527  */
528 
529  string lp = p;
530  boost::to_lower (lp);
531 
532  if ((lp.find (N_(":monitor")) != string::npos) &&
533  (lp.find (lpn) != string::npos)) {
534  ++s;
535  continue;
536  }
537 
538  /* can't use the audio engine for this as we are looking at non-Ardour ports */
539 
540  PortEngine::PortHandle ph = AudioEngine::instance()->port_engine().get_port_by_name (p);
541  if (ph) {
542  DataType t (AudioEngine::instance()->port_engine().port_data_type (ph));
543  if (t != DataType::NIL) {
544  if (port_has_prefix (p, N_("system:")) ||
545  port_has_prefix (p, N_("alsa_pcm")) ||
546  port_has_prefix (p, lpnc)) {
547  extra_system[t].push_back (p);
548  } else {
549  extra_other[t].push_back (p);
550  }
551  }
552  }
553  }
554 
555  ++s;
556  }
557  }
558 
559  for (DataType::iterator i = DataType::begin(); i != DataType::end(); ++i) {
560  if (!extra_system[*i].empty()) {
561  boost::shared_ptr<Bundle> b = make_bundle_from_ports (extra_system[*i], *i, inputs);
562  system->add_bundle (b);
563  }
564  }
565 
566  for (DataType::iterator i = DataType::begin(); i != DataType::end(); ++i) {
567  if (extra_other[*i].empty()) continue;
568  std::string cp;
569  std::vector<std::string> nb;
570  for (uint32_t j = 0; j < extra_other[*i].size(); ++j) {
571  std::string nn = extra_other[*i][j];
572  std::string pf = nn.substr (0, nn.find_first_of (":") + 1);
573  if (pf != cp && !nb.empty()) {
575  other->add_bundle (b);
576  nb.clear();
577  }
578  cp = pf;
579  nb.push_back(extra_other[*i][j]);
580  }
581  if (!nb.empty()) {
583  other->add_bundle (b);
584  }
585  }
586 
587  if (!allow_dups) {
588  system->remove_duplicates ();
589  }
590 
591  add_group_if_not_empty (other);
592  if (type != DataType::MIDI) {
594  }
595  add_group_if_not_empty (track);
596  add_group_if_not_empty (ardour);
597  add_group_if_not_empty (system);
598 
599  emit_changed ();
600 }
601 
603 PortGroupList::make_bundle_from_ports (std::vector<std::string> const & p, ARDOUR::DataType type, bool inputs) const
604 {
605  boost::shared_ptr<Bundle> b (new Bundle ("", inputs));
606 
607  std::string const pre = common_prefix (p);
608  if (!pre.empty()) {
609  b->set_name (pre.substr (0, pre.length() - 1));
610  }
611 
612  for (uint32_t j = 0; j < p.size(); ++j) {
613  std::string n = p[j].substr (pre.length());
614  std::string pn = AudioEngine::instance()->get_pretty_name_by_name (p[j]);
615  if (!pn.empty()) {
616  n = pn;
617  }
618  b->add_channel (n, type);
619  b->set_port (j, p[j]);
620  }
621 
622  return b;
623 }
624 
625 bool
626 PortGroupList::port_has_prefix (const std::string& n, const std::string& p) const
627 {
628  return n.substr (0, p.length()) == p;
629 }
630 
631 std::string
632 PortGroupList::common_prefix_before (std::vector<std::string> const & p, std::string const & s) const
633 {
634  /* we must have some strings and the first must contain the separator string */
635  if (p.empty() || p[0].find_first_of (s) == std::string::npos) {
636  return "";
637  }
638 
639  /* prefix of the first string */
640  std::string const fp = p[0].substr (0, p[0].find_first_of (s) + 1);
641 
642  /* see if the other strings also start with fp */
643  uint32_t j = 1;
644  while (j < p.size()) {
645  if (p[j].substr (0, fp.length()) != fp) {
646  break;
647  }
648  ++j;
649  }
650 
651  if (j != p.size()) {
652  return "";
653  }
654 
655  return fp;
656 }
657 
658 
659 std::string
660 PortGroupList::common_prefix (std::vector<std::string> const & p) const
661 {
662  /* common prefix before '/' ? */
663  std::string cp = common_prefix_before (p, "/");
664  if (!cp.empty()) {
665  return cp;
666  }
667 
668  cp = common_prefix_before (p, ":");
669  if (!cp.empty()) {
670  return cp;
671  }
672 
673  return "";
674 }
675 
676 void
678 {
679  _groups.clear ();
681  emit_changed ();
682 }
683 
684 
685 PortGroup::BundleList const &
687 {
688  _bundles.clear ();
689 
690  for (PortGroupList::List::const_iterator i = begin (); i != end (); ++i) {
691  std::copy ((*i)->bundles().begin(), (*i)->bundles().end(), std::back_inserter (_bundles));
692  }
693 
694  return _bundles;
695 }
696 
697 ChanCount
699 {
700  ChanCount n;
701 
702  for (PortGroupList::List::const_iterator i = begin(); i != end(); ++i) {
703  n += (*i)->total_channels ();
704  }
705 
706  return n;
707 }
708 
709 void
711 {
712  if (!g->bundles().empty ()) {
713  add_group (g);
714  }
715 }
716 
717 void
719 {
720  _groups.push_back (g);
721 
722  g->Changed.connect (_changed_connections, invalidator (*this), boost::bind (&PortGroupList::emit_changed, this), gui_context());
724 
725  emit_changed ();
726 }
727 
728 void
730 {
731  for (List::iterator i = _groups.begin(); i != _groups.end(); ++i) {
732  (*i)->remove_bundle (b);
733  }
734 
735  emit_changed ();
736 }
737 
738 void
740 {
741  if (_signals_suspended) {
742  _pending_change = true;
743  } else {
744  Changed ();
745  }
746 }
747 
748 void
750 {
751  if (_signals_suspended) {
753  } else {
754  BundleChanged (c);
755  }
756 }
757 void
759 {
760  _signals_suspended = true;
761 }
762 
763 void
765 {
766  if (_pending_change) {
767  Changed ();
768  _pending_change = false;
769  }
770 
771  if (_pending_bundle_change != 0) {
774  }
775 
776  _signals_suspended = false;
777 }
778 
781 {
782  List::const_iterator i = _groups.begin ();
783  while (i != _groups.end()) {
784  boost::shared_ptr<IO> io = (*i)->io_from_bundle (b);
785  if (io) {
786  return io;
787  }
788  ++i;
789  }
790 
791  return boost::shared_ptr<IO> ();
792 }
793 
794 bool
796 {
797  return _groups.empty ();
798 }
799 
PBD::Signal1< void, ARDOUR::Bundle::Change > BundleChanged
Definition: port_group.h:72
void set_port(uint32_t, std::string)
Definition: bundle.cc:139
void suspend_signals()
Definition: port_group.cc:758
List::const_iterator begin() const
Definition: port_group.h:123
void resume_signals()
Definition: port_group.cc:764
void remove_bundle(boost::shared_ptr< ARDOUR::Bundle >)
Definition: port_group.cc:133
void gather(ARDOUR::Session *, ARDOUR::DataType, bool, bool, bool)
Definition: port_group.cc:329
void add_bundle_internal(boost::shared_ptr< ARDOUR::Bundle >, boost::shared_ptr< ARDOUR::IO >, bool, Gdk::Color, bool)
Definition: port_group.cc:107
PBD::ScopedConnectionList _changed_connections
Definition: port_group.h:153
Definition: ardour_ui.h:130
shared_ptr< T > dynamic_pointer_cast(shared_ptr< U > const &r)
Definition: shared_ptr.hpp:396
boost::shared_ptr< ARDOUR::Bundle > make_bundle_from_ports(std::vector< std::string > const &, ARDOUR::DataType, bool) const
Definition: port_group.cc:603
boost::shared_ptr< MidiPort > midi_clock_input_port() const
boost::shared_ptr< MidiPort > mtc_input_port() const
std::list< BundleRecord * > BundleList
Definition: port_group.h:86
void clear()
Definition: port_group.cc:160
Definition: Beats.hpp:239
std::list< ControlProtocolInfo * > control_protocol_info
bool operator()(RouteIOs const &a, RouteIOs const &b)
Definition: port_group.cc:317
bool empty() const
Definition: port_group.cc:795
void emit_bundle_changed(ARDOUR::Bundle::Change)
Definition: port_group.cc:749
PortGroup::BundleList _bundles
Definition: port_group.h:150
RouteIOs(boost::shared_ptr< Route > r, boost::shared_ptr< IO > i)
Definition: port_group.cc:305
void add_group(boost::shared_ptr< PortGroup >)
Definition: port_group.cc:718
#define invalidator(x)
Definition: gui_thread.h:40
virtual TimeAxisView * axis_view_from_route(boost::shared_ptr< ARDOUR::Route >) const =0
bool _pending_change
Definition: port_group.h:155
MIDI::Port * midi_output_port() const
boost::shared_ptr< Auditioner > the_auditioner()
Definition: session.h:673
boost::shared_ptr< ARDOUR::IO > io_from_bundle(boost::shared_ptr< ARDOUR::Bundle >) const
Definition: port_group.cc:780
PBD::ScopedConnectionList _bundle_changed_connections
Definition: port_group.h:152
List::const_iterator end() const
Definition: port_group.h:127
std::string common_prefix_before(std::vector< std::string > const &, std::string const &) const
Definition: port_group.cc:632
void remove_duplicates()
Definition: port_group.cc:219
#define _(Text)
Definition: i18n.h:11
BundleList const & bundles() const
Definition: port_group.h:88
#define port_engine
PBD::Signal0< void > Changed
Definition: port_group.h:69
boost::shared_ptr< IO > click_io()
Definition: session.h:810
uint32_t order_key() const
Definition: route.cc:306
BundleList _bundles
Definition: port_group.h:96
std::string common_prefix(std::vector< std::string > const &) const
Definition: port_group.cc:660
void add_bundle(boost::shared_ptr< ARDOUR::Bundle >, bool allow_dups=false)
Definition: port_group.cc:73
void maybe_add_processor_to_list(boost::weak_ptr< ARDOUR::Processor >, std::list< boost::shared_ptr< ARDOUR::IO > > *, bool, std::set< boost::shared_ptr< ARDOUR::IO > > &)
Definition: port_group.cc:281
void emit_changed()
Definition: port_group.cc:739
bool port_has_prefix(std::string const &, std::string const &) const
Definition: port_group.cc:626
Definition: amp.h:29
PortGroup::BundleList const & bundles() const
Definition: port_group.cc:686
PBD::Signal0< void > Changed
Definition: port_group.h:134
boost::shared_ptr< ARDOUR::IO > io_from_bundle(boost::shared_ptr< ARDOUR::Bundle >) const
Definition: port_group.cc:202
ARDOUR::ChanCount total_channels() const
Definition: port_group.cc:191
ARDOUR::Bundle::Change _pending_bundle_change
Definition: port_group.h:156
boost::shared_ptr< BundleList > bundles()
Definition: session.h:241
#define gui_context()
Definition: gui_thread.h:36
PBD::Signal1< void, ARDOUR::Bundle::Change > BundleChanged
Definition: port_group.h:137
ARDOUR::ChanCount total_channels() const
Definition: port_group.cc:698
boost::shared_ptr< RouteList > get_routes() const
Definition: session.h:229
void add_channel(std::string const &, DataType)
Definition: bundle.cc:155
boost::shared_ptr< IO > input()
Definition: io_processor.h:60
MIDI::Port * mmc_output_port() const
MIDI::Port * midi_input_port() const
T * get() const
Definition: shared_ptr.hpp:268
void bundle_changed(ARDOUR::Bundle::Change)
Definition: port_group.cc:153
std::list< boost::shared_ptr< IO > > ios
Definition: port_group.cc:312
PortGroup(std::string const &n)
Definition: port_group.cc:54
static PublicEditor & instance()
PBD::Signal1< void, Change > Changed
Definition: bundle.h:131
const char * name
boost::shared_ptr< IO > output()
Definition: io_processor.h:62
boost::shared_ptr< Route > route
Definition: port_group.cc:310
PBD::ScopedConnection changed_connection
Definition: port_group.h:81
boost::shared_ptr< Port > ltc_output_port() const
Definition: session.cc:5544
boost::shared_ptr< ARDOUR::Bundle > only_bundle()
Definition: port_group.cc:183
MIDI::Port * mmc_input_port() const
Gdk::Color color() const
Definition: axis_view.h:50
void set_name(std::string const &)
Definition: bundle.cc:491
void add_group_if_not_empty(boost::shared_ptr< PortGroup >)
Definition: port_group.cc:710
std::string make_port_name_non_relative(const std::string &name) const
Definition: port_manager.cc:96
BundleRecord(boost::shared_ptr< ARDOUR::Bundle >, boost::shared_ptr< ARDOUR::IO >, Gdk::Color, bool has_colour)
Definition: port_group.cc:98
bool has_port(std::string const &) const
Definition: port_group.cc:171
bool has_same_ports(boost::shared_ptr< Bundle >) const
Definition: bundle.cc:501
AudioEngine & engine()
Definition: session.h:546
std::string string_compose(const std::string &fmt, const T1 &o1)
Definition: compose.h:208
#define N_(Text)
Definition: i18n.h:12
boost::shared_ptr< MidiPort > midi_clock_output_port() const
boost::shared_ptr< MidiPort > mtc_output_port() const
boost::shared_ptr< Port > ltc_input_port() const
Definition: session.cc:5538
bool _signals_suspended
Definition: port_group.h:154
void remove_bundle(boost::shared_ptr< ARDOUR::Bundle >)
Definition: port_group.cc:729