Primary-modifier click on a node in the port matrix toggles association for everything in a diagonal line down and to the right of the clicked node.
git-svn-id: svn://localhost/ardour2/branches/3.0@6122 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
964e3ee825
commit
be55dcbce3
|
@ -317,7 +317,7 @@ PortMatrixBody::on_button_press_event (GdkEventButton* ev)
|
|||
(*i)->button_press (
|
||||
(*i)->parent_to_component_x (ev->x),
|
||||
(*i)->parent_to_component_y (ev->y),
|
||||
ev->button, ev->time
|
||||
ev->button, ev->time, ev->state
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -333,12 +333,12 @@ PortMatrixBody::on_button_release_event (GdkEventButton* ev)
|
|||
(*i)->button_release (
|
||||
(*i)->parent_to_component_x (ev->x),
|
||||
(*i)->parent_to_component_y (ev->y),
|
||||
ev->button, ev->time
|
||||
ev->button, ev->time, ev->state
|
||||
);
|
||||
} else {
|
||||
(*i)->button_release (
|
||||
-1, -1,
|
||||
ev->button, ev->time
|
||||
ev->button, ev->time, ev->state
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -430,7 +430,7 @@ PortMatrixColumnLabels::position_to_channel (double p, double o, boost::shared_p
|
|||
}
|
||||
|
||||
void
|
||||
PortMatrixColumnLabels::button_press (double x, double y, int b, uint32_t t)
|
||||
PortMatrixColumnLabels::button_press (double x, double y, int b, uint32_t t, guint)
|
||||
{
|
||||
ARDOUR::BundleChannel const gc = position_to_channel (x, y, _matrix->visible_columns());
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ class PortMatrixColumnLabels : public PortMatrixLabels
|
|||
public:
|
||||
PortMatrixColumnLabels (PortMatrix *, PortMatrixBody *);
|
||||
|
||||
void button_press (double, double, int, uint32_t);
|
||||
void button_press (double, double, int, uint32_t, guint);
|
||||
|
||||
double component_to_parent_x (double x) const;
|
||||
double parent_to_component_x (double x) const;
|
||||
|
|
|
@ -49,8 +49,8 @@ public:
|
|||
virtual double parent_to_component_y (double y) const = 0;
|
||||
virtual void mouseover_changed (std::list<PortMatrixNode> const &) = 0;
|
||||
virtual void draw_extra (cairo_t *) = 0;
|
||||
virtual void button_press (double, double, int, uint32_t) {}
|
||||
virtual void button_release (double, double, int, uint32_t) {}
|
||||
virtual void button_press (double, double, int, uint32_t, guint) {}
|
||||
virtual void button_release (double, double, int, uint32_t, guint) {}
|
||||
virtual void motion (double, double) {}
|
||||
|
||||
void set_show_ports (bool);
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "port_matrix_grid.h"
|
||||
#include "port_matrix.h"
|
||||
#include "port_matrix_body.h"
|
||||
#include "keyboard.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
@ -245,16 +246,16 @@ PortMatrixGrid::position_to_node (double x, double y) const
|
|||
}
|
||||
|
||||
void
|
||||
PortMatrixGrid::button_press (double x, double y, int b, uint32_t t)
|
||||
PortMatrixGrid::button_press (double x, double y, int b, uint32_t t, guint)
|
||||
{
|
||||
ARDOUR::BundleChannel const px = position_to_channel (x, y, _matrix->visible_columns());
|
||||
ARDOUR::BundleChannel const py = position_to_channel (y, x, _matrix->visible_rows());
|
||||
|
||||
if (b == 1) {
|
||||
|
||||
|
||||
_dragging = true;
|
||||
_drag_valid = (px.bundle && py.bundle);
|
||||
|
||||
|
||||
_moved = false;
|
||||
_drag_start_x = x / grid_spacing ();
|
||||
_drag_start_y = y / grid_spacing ();
|
||||
|
@ -355,7 +356,7 @@ PortMatrixGrid::set_association (PortMatrixNode node, bool s)
|
|||
}
|
||||
|
||||
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*/, guint s)
|
||||
{
|
||||
if (b == 1) {
|
||||
|
||||
|
@ -376,10 +377,30 @@ PortMatrixGrid::button_release (double x, double y, int b, uint32_t /*t*/)
|
|||
|
||||
} else {
|
||||
|
||||
PortMatrixNode const n = position_to_node (x, y);
|
||||
if (n.row.bundle && n.column.bundle) {
|
||||
PortMatrixNode::State const s = get_association (n);
|
||||
set_association (n, toggle_state (s));
|
||||
if (Keyboard::modifier_state_equals (s, Keyboard::PrimaryModifier)) {
|
||||
/* associate/disassociate things diagonally down and right until we run out */
|
||||
PortMatrixNode::State s = (PortMatrixNode::State) 0;
|
||||
while (1) {
|
||||
PortMatrixNode const n = position_to_node (x, y);
|
||||
if (n.row.bundle && n.column.bundle) {
|
||||
if (s == (PortMatrixNode::State) 0) {
|
||||
s = get_association (n);
|
||||
}
|
||||
set_association (n, toggle_state (s));
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
x += grid_spacing ();
|
||||
y += grid_spacing ();
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
PortMatrixNode const n = position_to_node (x, y);
|
||||
if (n.row.bundle && n.column.bundle) {
|
||||
PortMatrixNode::State const s = get_association (n);
|
||||
set_association (n, toggle_state (s));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -41,8 +41,8 @@ class PortMatrixGrid : public PortMatrixComponent
|
|||
public:
|
||||
PortMatrixGrid (PortMatrix *, PortMatrixBody *);
|
||||
|
||||
void button_press (double, double, int, uint32_t);
|
||||
void button_release (double, double, int, uint32_t);
|
||||
void button_press (double, double, int, uint32_t, guint);
|
||||
void button_release (double, double, int, uint32_t, guint);
|
||||
void motion (double, double);
|
||||
|
||||
double component_to_parent_x (double x) const;
|
||||
|
|
|
@ -122,7 +122,7 @@ PortMatrixRowLabels::render (cairo_t* cr)
|
|||
}
|
||||
|
||||
void
|
||||
PortMatrixRowLabels::button_press (double x, double y, int b, uint32_t t)
|
||||
PortMatrixRowLabels::button_press (double x, double y, int b, uint32_t t, guint)
|
||||
{
|
||||
ARDOUR::BundleChannel const w = position_to_channel (y, x, _matrix->visible_rows());
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ class PortMatrixRowLabels : public PortMatrixLabels
|
|||
public:
|
||||
PortMatrixRowLabels (PortMatrix *, PortMatrixBody *);
|
||||
|
||||
void button_press (double, double, int, uint32_t);
|
||||
void button_press (double, double, int, uint32_t, guint);
|
||||
|
||||
double component_to_parent_x (double x) const;
|
||||
double parent_to_component_x (double x) const;
|
||||
|
|
Loading…
Reference in New Issue
Block a user