summaryrefslogtreecommitdiff
path: root/libs/ardour/io.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-06-30 02:59:13 +0000
committerCarl Hetherington <carl@carlh.net>2010-06-30 02:59:13 +0000
commit5f67a72c341a96872d9cd3d1de357662295d14b0 (patch)
tree69ac5fad51fc894c0af153121822f479358c57be /libs/ardour/io.cc
parent8efaca01efcdb1c7606d3f2aa18e875fd7a26244 (diff)
Basic tweaks to make the bundles and the port matrix accept that MIDI tracks may have audio IO, and vice versa. Allows connection of instrument tracks using the global port matrix.
git-svn-id: svn://localhost/ardour2/branches/3.0@7335 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/io.cc')
-rw-r--r--libs/ardour/io.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc
index f40cbafb2d..0cc61e1044 100644
--- a/libs/ardour/io.cc
+++ b/libs/ardour/io.cc
@@ -111,6 +111,10 @@ IO::check_bundles_connected ()
check_bundles (_bundles_connected, ports());
}
+/** Check the bundles in list to see which are connected to a given PortSet,
+ * and update list with those that are connected such that every port on every
+ * bundle channel x is connected to port x in ports.
+ */
void
IO::check_bundles (std::vector<UserBundleInfo*>& list, const PortSet& ports)
{
@@ -118,9 +122,9 @@ IO::check_bundles (std::vector<UserBundleInfo*>& list, const PortSet& ports)
for (std::vector<UserBundleInfo*>::iterator i = list.begin(); i != list.end(); ++i) {
- uint32_t const N = (*i)->bundle->nchannels ();
+ uint32_t const N = (*i)->bundle->nchannels().n_total();
- if (_ports.num_ports (default_type()) < N) {
+ if (_ports.num_ports() < N) {
continue;
}
@@ -771,7 +775,7 @@ IO::get_port_counts (const XMLNode& node, int version, ChanCount& n, boost::shar
if ((prop = node.property ("connection")) != 0) {
if ((c = find_possible_bundle (prop->value())) != 0) {
- n = ChanCount::max (n, ChanCount(c->type(), c->nchannels()));
+ n = ChanCount::max (n, c->nchannels());
}
return 0;
}
@@ -780,7 +784,7 @@ IO::get_port_counts (const XMLNode& node, int version, ChanCount& n, boost::shar
if ((*iter)->name() == X_("Bundle")) {
if ((c = find_possible_bundle (prop->value())) != 0) {
- n = ChanCount::max (n, ChanCount(c->type(), c->nchannels()));
+ n = ChanCount::max (n, c->nchannels());
return 0;
} else {
return -1;
@@ -1328,8 +1332,6 @@ IO::setup_bundle ()
_bundle->suspend_signals ();
- _bundle->set_type (default_type ());
-
_bundle->remove_channels ();
if (_direction == Input) {
@@ -1340,7 +1342,7 @@ IO::setup_bundle ()
_bundle->set_name (buf);
uint32_t const ni = _ports.num_ports();
for (uint32_t i = 0; i < ni; ++i) {
- _bundle->add_channel (bundle_channel_name (i, ni));
+ _bundle->add_channel (bundle_channel_name (i, ni), _ports.port(i)->type());
_bundle->set_port (i, _session.engine().make_port_name_non_relative (_ports.port(i)->name()));
}