mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 03:36:32 +01:00
Fix crash on mouseover.
git-svn-id: svn://localhost/ardour2/branches/3.0@8236 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
4a9a5dea26
commit
fb0097ca79
5 changed files with 78 additions and 73 deletions
|
|
@ -939,3 +939,69 @@ PortMatrix::count_of_our_type (ChanCount c) const
|
|||
|
||||
return c.get (_type);
|
||||
}
|
||||
|
||||
PortMatrixNode::State
|
||||
PortMatrix::get_association (PortMatrixNode node) const
|
||||
{
|
||||
if (show_only_bundles ()) {
|
||||
|
||||
bool have_off_diagonal_association = false;
|
||||
bool have_diagonal_association = false;
|
||||
bool have_diagonal_not_association = false;
|
||||
|
||||
for (uint32_t i = 0; i < node.row.bundle->nchannels().n_total(); ++i) {
|
||||
|
||||
for (uint32_t j = 0; j < node.column.bundle->nchannels().n_total(); ++j) {
|
||||
|
||||
if (!should_show (node.row.bundle->channel_type(i)) || !should_show (node.column.bundle->channel_type(j))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ARDOUR::BundleChannel c[2];
|
||||
c[column_index()] = ARDOUR::BundleChannel (node.row.bundle, i);
|
||||
c[row_index()] = ARDOUR::BundleChannel (node.column.bundle, j);
|
||||
|
||||
PortMatrixNode::State const s = get_state (c);
|
||||
|
||||
switch (s) {
|
||||
case PortMatrixNode::ASSOCIATED:
|
||||
if (i == j) {
|
||||
have_diagonal_association = true;
|
||||
} else {
|
||||
have_off_diagonal_association = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case PortMatrixNode::NOT_ASSOCIATED:
|
||||
if (i == j) {
|
||||
have_diagonal_not_association = true;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (have_diagonal_association && !have_off_diagonal_association && !have_diagonal_not_association) {
|
||||
return PortMatrixNode::ASSOCIATED;
|
||||
} else if (!have_diagonal_association && !have_off_diagonal_association) {
|
||||
return PortMatrixNode::NOT_ASSOCIATED;
|
||||
}
|
||||
|
||||
return PortMatrixNode::PARTIAL;
|
||||
|
||||
} else {
|
||||
|
||||
ARDOUR::BundleChannel c[2];
|
||||
c[column_index()] = node.column;
|
||||
c[row_index()] = node.row;
|
||||
return get_state (c);
|
||||
|
||||
}
|
||||
|
||||
/* NOTREACHED */
|
||||
return PortMatrixNode::NOT_ASSOCIATED;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue