mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-11 00:56:33 +01:00
Cleanup to previous commit.
git-svn-id: svn://localhost/ardour2/branches/3.0@5376 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
91dae1fb03
commit
fea3992f29
2 changed files with 75 additions and 60 deletions
|
|
@ -289,6 +289,73 @@ PortMatrixGrid::button_press (double x, double y, int b, uint32_t t)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
PortMatrixGrid::set_association (PortMatrixNode node)
|
||||||
|
{
|
||||||
|
if (_matrix->show_only_bundles()) {
|
||||||
|
|
||||||
|
for (uint32_t i = 0; i < node.column.bundle->nchannels(); ++i) {
|
||||||
|
for (uint32_t j = 0; j < node.row.bundle->nchannels(); ++j) {
|
||||||
|
|
||||||
|
ARDOUR::BundleChannel c[2];
|
||||||
|
c[_matrix->column_index()] = ARDOUR::BundleChannel (node.column.bundle, i);
|
||||||
|
c[_matrix->row_index()] = ARDOUR::BundleChannel (node.row.bundle, j);
|
||||||
|
_matrix->set_state (c, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if (node.row.bundle && node.column.bundle) {
|
||||||
|
|
||||||
|
ARDOUR::BundleChannel c[2];
|
||||||
|
c[_matrix->row_index()] = node.row;
|
||||||
|
c[_matrix->column_index()] = node.column;
|
||||||
|
_matrix->set_state (c, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
PortMatrixGrid::toggle_association (PortMatrixNode node)
|
||||||
|
{
|
||||||
|
if (_matrix->show_only_bundles()) {
|
||||||
|
|
||||||
|
PortMatrixNode::State const s = bundle_to_bundle_state (node.column.bundle, node.row.bundle);
|
||||||
|
|
||||||
|
for (uint32_t i = 0; i < node.column.bundle->nchannels(); ++i) {
|
||||||
|
for (uint32_t j = 0; j < node.row.bundle->nchannels(); ++j) {
|
||||||
|
|
||||||
|
ARDOUR::BundleChannel c[2];
|
||||||
|
c[_matrix->column_index()] = ARDOUR::BundleChannel (node.column.bundle, i);
|
||||||
|
c[_matrix->row_index()] = ARDOUR::BundleChannel (node.row.bundle, j);
|
||||||
|
if (s == PortMatrixNode::NOT_ASSOCIATED || s == PortMatrixNode::PARTIAL) {
|
||||||
|
_matrix->set_state (c, i == j);
|
||||||
|
} else {
|
||||||
|
_matrix->set_state (c, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if (node.row.bundle && node.column.bundle) {
|
||||||
|
|
||||||
|
ARDOUR::BundleChannel c[2];
|
||||||
|
c[_matrix->row_index()] = node.row;
|
||||||
|
c[_matrix->column_index()] = node.column;
|
||||||
|
|
||||||
|
PortMatrixNode::State const s = _matrix->get_state (c);
|
||||||
|
|
||||||
|
if (s == PortMatrixNode::ASSOCIATED || s == PortMatrixNode::NOT_ASSOCIATED) {
|
||||||
|
bool const n = !(s == PortMatrixNode::ASSOCIATED);
|
||||||
|
_matrix->set_state (c, n);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
PortMatrixGrid::button_release (double x, double y, int b, uint32_t t)
|
PortMatrixGrid::button_release (double x, double y, int b, uint32_t t)
|
||||||
{
|
{
|
||||||
|
|
@ -298,71 +365,17 @@ PortMatrixGrid::button_release (double x, double y, int b, uint32_t t)
|
||||||
|
|
||||||
list<PortMatrixNode> const p = nodes_on_line (_drag_start_x, _drag_start_y, _drag_x, _drag_y);
|
list<PortMatrixNode> const p = nodes_on_line (_drag_start_x, _drag_start_y, _drag_x, _drag_y);
|
||||||
|
|
||||||
if (_matrix->show_only_bundles()) {
|
for (list<PortMatrixNode>::const_iterator i = p.begin(); i != p.end(); ++i) {
|
||||||
/* XXX: err... */
|
set_association (*i);
|
||||||
} else {
|
|
||||||
for (list<PortMatrixNode>::const_iterator i = p.begin(); i != p.end(); ++i) {
|
|
||||||
|
|
||||||
ARDOUR::BundleChannel c[2];
|
|
||||||
c[_matrix->row_index()] = i->row;
|
|
||||||
c[_matrix->column_index()] = i->column;
|
|
||||||
|
|
||||||
PortMatrixNode::State const s = _matrix->get_state (c);
|
|
||||||
|
|
||||||
if (s == PortMatrixNode::ASSOCIATED || s == PortMatrixNode::NOT_ASSOCIATED) {
|
|
||||||
bool const n = !(s == PortMatrixNode::ASSOCIATED);
|
|
||||||
_matrix->set_state (c, n);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
require_render ();
|
|
||||||
_body->queue_draw ();
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
PortMatrixNode const node = position_to_node (x / grid_spacing(), y / grid_spacing());
|
toggle_association (position_to_node (x / grid_spacing(), y / grid_spacing()));
|
||||||
|
|
||||||
if (_matrix->show_only_bundles()) {
|
|
||||||
|
|
||||||
PortMatrixNode::State const s = bundle_to_bundle_state (node.column.bundle, node.row.bundle);
|
|
||||||
|
|
||||||
for (uint32_t i = 0; i < node.column.bundle->nchannels(); ++i) {
|
|
||||||
for (uint32_t j = 0; j < node.row.bundle->nchannels(); ++j) {
|
|
||||||
|
|
||||||
ARDOUR::BundleChannel c[2];
|
|
||||||
c[_matrix->column_index()] = ARDOUR::BundleChannel (node.column.bundle, i);
|
|
||||||
c[_matrix->row_index()] = ARDOUR::BundleChannel (node.row.bundle, j);
|
|
||||||
if (s == PortMatrixNode::NOT_ASSOCIATED || s == PortMatrixNode::PARTIAL) {
|
|
||||||
_matrix->set_state (c, i == j);
|
|
||||||
} else {
|
|
||||||
_matrix->set_state (c, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
if (node.row.bundle && node.column.bundle) {
|
|
||||||
|
|
||||||
ARDOUR::BundleChannel c[2];
|
|
||||||
c[_matrix->row_index()] = node.row;
|
|
||||||
c[_matrix->column_index()] = node.column;
|
|
||||||
|
|
||||||
PortMatrixNode::State const s = _matrix->get_state (c);
|
|
||||||
|
|
||||||
if (s == PortMatrixNode::ASSOCIATED || s == PortMatrixNode::NOT_ASSOCIATED) {
|
|
||||||
|
|
||||||
bool const n = !(s == PortMatrixNode::ASSOCIATED);
|
|
||||||
_matrix->set_state (c, n);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
require_render ();
|
|
||||||
_body->queue_draw ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
require_render ();
|
||||||
|
_body->queue_draw ();
|
||||||
}
|
}
|
||||||
|
|
||||||
_dragging = false;
|
_dragging = false;
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,8 @@ private:
|
||||||
void draw_unknown_indicator (cairo_t *, uint32_t, uint32_t);
|
void draw_unknown_indicator (cairo_t *, uint32_t, uint32_t);
|
||||||
PortMatrixNode::State bundle_to_bundle_state (boost::shared_ptr<ARDOUR::Bundle>, boost::shared_ptr<ARDOUR::Bundle>) const;
|
PortMatrixNode::State bundle_to_bundle_state (boost::shared_ptr<ARDOUR::Bundle>, boost::shared_ptr<ARDOUR::Bundle>) const;
|
||||||
std::list<PortMatrixNode> nodes_on_line (int, int, int, int) const;
|
std::list<PortMatrixNode> nodes_on_line (int, int, int, int) const;
|
||||||
|
void toggle_association (PortMatrixNode node);
|
||||||
|
void set_association (PortMatrixNode node);
|
||||||
|
|
||||||
bool _dragging;
|
bool _dragging;
|
||||||
bool _moved;
|
bool _moved;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue