summaryrefslogtreecommitdiff
path: root/gtk2_ardour/port_group.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-08-01 10:25:55 +0000
committerCarl Hetherington <carl@carlh.net>2010-08-01 10:25:55 +0000
commita6a34361e689d5ea54fd0039689ee4537fbdced7 (patch)
tree686cb30c4a0a2d71ddcdd05e94445006840c45cf /gtk2_ardour/port_group.cc
parent1dfd97322a14fee21365f7af0c598a30915d0243 (diff)
Fix port matrix crash.
git-svn-id: svn://localhost/ardour2/branches/3.0@7525 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/port_group.cc')
-rw-r--r--gtk2_ardour/port_group.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/gtk2_ardour/port_group.cc b/gtk2_ardour/port_group.cc
index a8e70ea501..6f4d3f86a8 100644
--- a/gtk2_ardour/port_group.cc
+++ b/gtk2_ardour/port_group.cc
@@ -376,7 +376,7 @@ PortGroupList::gather (ARDOUR::Session* session, ARDOUR::DataType type, bool inp
for (list<boost::shared_ptr<IO> >::iterator j = i->ios.begin(); j != i->ios.end(); ++j) {
boost::shared_ptr<Bundle> b = bundle_for_type ((*j)->bundle(), type);
- if (b) {
+ if (b->nchannels() != ChanCount::ZERO) {
if (tv) {
g->add_bundle (b, *j, tv->color ());
} else {
@@ -395,7 +395,7 @@ PortGroupList::gather (ARDOUR::Session* session, ARDOUR::DataType type, bool inp
for (BundleList::iterator i = b->begin(); i != b->end(); ++i) {
if (boost::dynamic_pointer_cast<UserBundle> (*i) && (*i)->ports_are_inputs() == inputs) {
boost::shared_ptr<Bundle> b = bundle_for_type (*i, type);
- if (b) {
+ if (b->nchannels() != ChanCount::ZERO) {
system->add_bundle (b, allow_dups);
}
}
@@ -404,7 +404,7 @@ PortGroupList::gather (ARDOUR::Session* session, ARDOUR::DataType type, bool inp
for (BundleList::iterator i = b->begin(); i != b->end(); ++i) {
if (boost::dynamic_pointer_cast<UserBundle> (*i) == 0 && (*i)->ports_are_inputs() == inputs) {
boost::shared_ptr<Bundle> b = bundle_for_type (*i, type);
- if (b) {
+ if (b->nchannels() != ChanCount::ZERO) {
system->add_bundle (b, allow_dups);
}
}
@@ -414,12 +414,12 @@ PortGroupList::gather (ARDOUR::Session* session, ARDOUR::DataType type, bool inp
if (!inputs) {
boost::shared_ptr<Bundle> b = bundle_for_type (session->the_auditioner()->output()->bundle(), type);
- if (b) {
+ if (b->nchannels() != ChanCount::ZERO) {
ardour->add_bundle (b);
}
b = bundle_for_type (session->click_io()->bundle(), type);
- if (b) {
+ if (b->nchannels() != ChanCount::ZERO) {
ardour->add_bundle (b);
}
}
@@ -499,7 +499,7 @@ PortGroupList::gather (ARDOUR::Session* session, ARDOUR::DataType type, bool inp
if (!extra_system[*i].empty()) {
boost::shared_ptr<Bundle> b = make_bundle_from_ports (extra_system[*i], *i, inputs);
boost::shared_ptr<Bundle> bt = bundle_for_type (b, type);
- if (bt) {
+ if (bt->nchannels() != ChanCount::ZERO) {
system->add_bundle (bt);
}
}
@@ -509,7 +509,7 @@ PortGroupList::gather (ARDOUR::Session* session, ARDOUR::DataType type, bool inp
if (!extra_other[*i].empty()) {
boost::shared_ptr<Bundle> b = make_bundle_from_ports (extra_other[*i], *i, inputs);
boost::shared_ptr<Bundle> bt = bundle_for_type (b, type);
- if (bt) {
+ if (bt->nchannels() != ChanCount::ZERO) {
other->add_bundle (bt);
}
}
@@ -744,7 +744,7 @@ PortGroupList::bundle_for_type (boost::shared_ptr<Bundle> b, DataType t) const
}
/* We must build a new bundle */
- boost::shared_ptr<Bundle> n;
+ boost::shared_ptr<Bundle> n (new ARDOUR::Bundle (b->name(), b->ports_are_inputs()));
for (uint32_t i = 0; i < b->nchannels().n_total(); ++i) {
if (b->channel_type(i) == t) {
n->add_channel (b->channel_name (i), t, b->channel_ports (i));