diff options
author | Carl Hetherington <carl@carlh.net> | 2009-01-27 18:36:40 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2009-01-27 18:36:40 +0000 |
commit | 948034f15aa8716fc87cc0efefe6152d27de5552 (patch) | |
tree | 9d4cd49f8da82942367d73ba5fa2465c7c3d7599 /libs/ardour/bundle.cc | |
parent | b2e163a410a62a20e982b3baac0cf65e611acbce (diff) |
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
Diffstat (limited to 'libs/ardour/bundle.cc')
-rw-r--r-- | libs/ardour/bundle.cc | 32 |
1 files changed, 32 insertions, 0 deletions
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<Bundle> 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 "<other_bundle_name> <other_channel_name>". + */ +void +Bundle::add_channels_from_bundle (boost::shared_ptr<Bundle> 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]); + } + } +} |