+ }
+
+ for (DataType::iterator i = DataType::begin(); i != DataType::end(); ++i) {
+ if (!extra_system[*i].empty()) {
+ boost::shared_ptr<Bundle> b = make_bundle_from_ports (extra_system[*i], *i, inputs);
+ system->add_bundle (b);
+ }
+ }
+
+ for (DataType::iterator i = DataType::begin(); i != DataType::end(); ++i) {
+ if (extra_other[*i].empty()) continue;
+ std::string cp;
+ std::vector<std::string> nb;
+ for (uint32_t j = 0; j < extra_other[*i].size(); ++j) {
+ std::string nn = extra_other[*i][j];
+ std::string pf = nn.substr (0, nn.find_first_of (":") + 1);
+ if (pf != cp && !nb.empty()) {
+ boost::shared_ptr<Bundle> b = make_bundle_from_ports (nb, *i, inputs);
+ other->add_bundle (b);
+ nb.clear();
+ }
+ cp = pf;
+ nb.push_back(extra_other[*i][j]);
+ }
+ if (!nb.empty()) {
+ boost::shared_ptr<Bundle> b = make_bundle_from_ports (nb, *i, inputs);
+ other->add_bundle (b);
+ }
+ }
+
+ if (!allow_dups) {
+ system->remove_duplicates ();
+ }
+
+ add_group_if_not_empty (other);
+ if (type != DataType::MIDI) {
+ add_group_if_not_empty (bus);
+ }
+ add_group_if_not_empty (track);
+ add_group_if_not_empty (ardour);
+ add_group_if_not_empty (system);
+
+ emit_changed ();
+}
+
+boost::shared_ptr<Bundle>
+PortGroupList::make_bundle_from_ports (std::vector<std::string> const & p, ARDOUR::DataType type, bool inputs) const
+{
+ boost::shared_ptr<Bundle> b (new Bundle ("", inputs));