+ return 0;
+}
+
+
+ARDOUR::BundleChannel
+PortMatrixComponent::position_to_channel (double p, double, boost::shared_ptr<const PortGroup> group) const
+{
+ p /= grid_spacing ();
+
+ PortGroup::BundleList const & bundles = group->bundles ();
+ for (PortGroup::BundleList::const_iterator j = bundles.begin(); j != bundles.end(); ++j) {
+
+ if (_matrix->show_only_bundles()) {
+
+ if (p < 1) {
+ return ARDOUR::BundleChannel ((*j)->bundle, -1);
+ } else {
+ p -= 1;
+ }
+
+ } else {
+
+ uint32_t const s = (*j)->bundle->nchannels ();
+ if (p < s) {
+ return ARDOUR::BundleChannel ((*j)->bundle, p);
+ } else {
+ p -= s;
+ }
+
+ }
+
+ }
+
+ return ARDOUR::BundleChannel (boost::shared_ptr<ARDOUR::Bundle> (), -1);