projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
no more noise during startup.
[ardour.git]
/
gtk2_ardour
/
port_matrix_component.cc
diff --git
a/gtk2_ardour/port_matrix_component.cc
b/gtk2_ardour/port_matrix_component.cc
index 38a07479b0f04749958881e605f2ee65c65c2781..5e11527d299fefc4f4369d7021905a0541320979 100644
(file)
--- a/
gtk2_ardour/port_matrix_component.cc
+++ b/
gtk2_ardour/port_matrix_component.cc
@@
-132,7
+132,7
@@
PortMatrixComponent::group_size (boost::shared_ptr<const PortGroup> g) const
s = bundles.size();
} else {
for (PortGroup::BundleList::const_iterator i = bundles.begin(); i != bundles.end(); ++i) {
s = bundles.size();
} else {
for (PortGroup::BundleList::const_iterator i = bundles.begin(); i != bundles.end(); ++i) {
- s += _matrix->count_of_our_type ((*i)->bundle->nchannels());
+ s += _matrix->count_of_our_type
_min_1
((*i)->bundle->nchannels());
}
}
}
}
@@
-140,7
+140,7
@@
PortMatrixComponent::group_size (boost::shared_ptr<const PortGroup> g) const
}
/** @param bc Channel.
}
/** @param bc Channel.
- * @param group
s List of groups
.
+ * @param group
Group
.
* @return Position of bc in groups in grid units, taking show_only_bundles into account.
*/
uint32_t
* @return Position of bc in groups in grid units, taking show_only_bundles into account.
*/
uint32_t
@@
-159,7
+159,7
@@
PortMatrixComponent::channel_to_position (ARDOUR::BundleChannel bc, boost::share
if (_matrix->show_only_bundles()) {
return p;
} else {
if (_matrix->show_only_bundles()) {
return p;
} else {
- return p + bc.
channel
;
+ return p + bc.
bundle->overall_channel_to_type (_matrix->type (), bc.channel)
;
}
}
}
}
@@
-169,7
+169,7
@@
PortMatrixComponent::channel_to_position (ARDOUR::BundleChannel bc, boost::share
if (_matrix->show_only_bundles()) {
p += 1;
} else {
if (_matrix->show_only_bundles()) {
p += 1;
} else {
- p += _matrix->count_of_our_type ((*i)->bundle->nchannels());
+ p += _matrix->count_of_our_type
_min_1
((*i)->bundle->nchannels());
}
}
}
}
@@
-195,9
+195,15
@@
PortMatrixComponent::position_to_channel (double p, double, boost::shared_ptr<co
} else {
} else {
- uint32_t const s = _matrix->count_of_our_type ((*j)->bundle->nchannels());
+ ARDOUR::ChanCount const N = (*j)->bundle->nchannels ();
+
+ uint32_t const s = _matrix->count_of_our_type_min_1 (N);
if (p < s) {
if (p < s) {
- return ARDOUR::BundleChannel ((*j)->bundle, p);
+ if (p < _matrix->count_of_our_type (N)) {
+ return ARDOUR::BundleChannel ((*j)->bundle, (*j)->bundle->type_channel_to_overall (_matrix->type (), p));
+ } else {
+ return ARDOUR::BundleChannel (boost::shared_ptr<ARDOUR::Bundle> (), -1);
+ }
} else {
p -= s;
}
} else {
p -= s;
}