- } else if (b == 3) {
-
- _matrix->popup_menu (px, py, t);
-
- }
-}
-
-PortMatrixNode::State
-PortMatrixGrid::get_association (PortMatrixNode node) const
-{
- if (_matrix->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 (!_matrix->should_show (node.row.bundle->channel_type(i)) || !_matrix->should_show (node.column.bundle->channel_type(j))) {
- continue;
- }
-
- ARDOUR::BundleChannel c[2];
- c[_matrix->column_index()] = ARDOUR::BundleChannel (node.row.bundle, i);
- c[_matrix->row_index()] = ARDOUR::BundleChannel (node.column.bundle, j);
-
- PortMatrixNode::State const s = _matrix->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 {