mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 07:45:00 +01:00
Region gain point selection behaves as per track automation.
This commit is contained in:
parent
202a23d513
commit
1451d8043a
1 changed files with 44 additions and 6 deletions
|
|
@ -524,18 +524,56 @@ Editor::button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType it
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GainLineItem:
|
case GainLineItem:
|
||||||
|
if (eff_mouse_mode != MouseRange) {
|
||||||
|
AutomationLine* argl = reinterpret_cast<AutomationLine*> (item->get_data ("line"));
|
||||||
|
|
||||||
|
std::list<Selectable*> selectables;
|
||||||
|
uint32_t before, after;
|
||||||
|
framecnt_t const where = (framecnt_t) floor (event->button.x * samples_per_pixel) - clicked_regionview->region ()->position ();
|
||||||
|
|
||||||
|
if (!argl || !argl->control_points_adjacent (where, before, after)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
selectables.push_back (argl->nth (before));
|
||||||
|
selectables.push_back (argl->nth (after));
|
||||||
|
|
||||||
|
switch (op) {
|
||||||
|
case Selection::Set:
|
||||||
|
if (press) {
|
||||||
|
selection->set (selectables);
|
||||||
|
_mouse_changed_selection = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case Selection::Add:
|
||||||
|
if (press) {
|
||||||
|
selection->add (selectables);
|
||||||
|
_mouse_changed_selection = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case Selection::Toggle:
|
||||||
|
if (press) {
|
||||||
|
selection->toggle (selectables);
|
||||||
|
_mouse_changed_selection = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Selection::Extend:
|
||||||
|
/* XXX */
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case AutomationLineItem:
|
case AutomationLineItem:
|
||||||
if (eff_mouse_mode != MouseRange) {
|
if (eff_mouse_mode != MouseRange) {
|
||||||
AutomationLine* al;
|
AutomationLine* al = reinterpret_cast<AutomationLine*> (item->get_data ("line"));
|
||||||
std::list<Selectable*> selectables;
|
std::list<Selectable*> selectables;
|
||||||
uint32_t before, after;
|
uint32_t before, after;
|
||||||
framecnt_t const where = (framecnt_t) floor (event->button.x * samples_per_pixel);
|
framecnt_t const where = (framecnt_t) floor (event->button.x * samples_per_pixel);
|
||||||
|
|
||||||
if ((al = reinterpret_cast<AutomationLine*> (item->get_data ("line")))) {
|
if (!al || !al->control_points_adjacent (where, before, after)) {
|
||||||
|
break;
|
||||||
if (!al->control_points_adjacent (where, before, after)) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
selectables.push_back (al->nth (before));
|
selectables.push_back (al->nth (before));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue