From 948034f15aa8716fc87cc0efefe6152d27de5552 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 27 Jan 2009 18:36:40 +0000 Subject: Make track sends etc. appear in the same bundle as the track. Tidy up bundle channel naming a bit. git-svn-id: svn://localhost/ardour2/branches/3.0@4448 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/bundle.cc | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'libs/ardour/bundle.cc') diff --git a/libs/ardour/bundle.cc b/libs/ardour/bundle.cc index 53fc2f1930..48c0ead6e6 100644 --- a/libs/ardour/bundle.cc +++ b/libs/ardour/bundle.cc @@ -29,6 +29,15 @@ using namespace ARDOUR; using namespace PBD; +Bundle::Bundle (boost::shared_ptr other) + : _channel (other->_channel), + _name (other->_name), + _type (other->_type), + _ports_are_inputs (other->_ports_are_inputs) +{ + +} + uint32_t Bundle::nchannels () const { @@ -211,3 +220,26 @@ Bundle::set_channel_name (uint32_t ch, std::string const & n) NameChanged (); /* EMIT SIGNAL */ } + +/** Take the channels from another bundle and add them to this bundle, + * so that channels from other are added to this (with their ports) + * and are named " ". + */ +void +Bundle::add_channels_from_bundle (boost::shared_ptr other) +{ + uint32_t const ch = nchannels (); + + for (uint32_t i = 0; i < other->nchannels(); ++i) { + + std::stringstream s; + s << other->name() << " " << other->channel_name(i); + + add_channel (s.str()); + + PortList const& pl = other->channel_ports (i); + for (uint32_t j = 0; j < pl.size(); ++j) { + add_port_to_channel (ch + i, pl[j]); + } + } +} -- cgit v1.2.3