diff options
author | Carl Hetherington <carl@carlh.net> | 2010-07-01 01:14:14 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-07-01 01:14:14 +0000 |
commit | 92e412661772e6b9c83109b7ee4996f4c040d3f4 (patch) | |
tree | 1f1006c61d03b6b68855d812561d931606ff84b3 /libs/ardour/io.cc | |
parent | aad230da6937358b11976c1db3986575b2e412a0 (diff) |
Allow port matrix to show both audio and midi ports at the same time, and use that facility for route IO selectors.
git-svn-id: svn://localhost/ardour2/branches/3.0@7344 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/io.cc')
-rw-r--r-- | libs/ardour/io.cc | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc index 0cc61e1044..338705d633 100644 --- a/libs/ardour/io.cc +++ b/libs/ardour/io.cc @@ -1340,10 +1340,17 @@ IO::setup_bundle () snprintf(buf, sizeof (buf), _("%s out"), _name.val().c_str()); } _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), _ports.port(i)->type()); - _bundle->set_port (i, _session.engine().make_port_name_non_relative (_ports.port(i)->name())); + + int c = 0; + for (DataType::iterator i = DataType::begin(); i != DataType::end(); ++i) { + + uint32_t const N = _ports.count().get (*i); + for (uint32_t j = 0; j < N; ++j) { + _bundle->add_channel (bundle_channel_name (j, N, *i), *i); + _bundle->set_port (c, _session.engine().make_port_name_non_relative (_ports.port(*i, j)->name())); + ++c; + } + } _bundle->resume_signals (); @@ -1397,18 +1404,27 @@ IO::UserBundleInfo::UserBundleInfo (IO* io, boost::shared_ptr<UserBundle> b) } std::string -IO::bundle_channel_name (uint32_t c, uint32_t n) const +IO::bundle_channel_name (uint32_t c, uint32_t n, DataType t) const { char buf[32]; - switch (n) { - case 1: - return _("mono"); - case 2: - return c == 0 ? _("L") : _("R"); - default: + if (t == DataType::AUDIO) { + + switch (n) { + case 1: + return _("mono"); + case 2: + return c == 0 ? _("L") : _("R"); + default: + snprintf (buf, sizeof(buf), _("%d"), (c + 1)); + return buf; + } + + } else { + snprintf (buf, sizeof(buf), _("%d"), (c + 1)); return buf; + } return ""; |