support group-override when starting a new Range selection
This commit is contained in:
parent
6089ae9314
commit
419f934ecd
|
@ -51,6 +51,7 @@
|
|||
#include "gtkmm2ext/bindings.h"
|
||||
#include "gtkmm2ext/dndtreeview.h"
|
||||
|
||||
#include "pbd/controllable.h"
|
||||
#include "pbd/stateful.h"
|
||||
#include "pbd/signals.h"
|
||||
|
||||
|
@ -830,7 +831,7 @@ private:
|
|||
|
||||
bool set_selected_control_point_from_click (bool press, Selection::Operation op = Selection::Set);
|
||||
void set_selected_track_from_click (bool press, Selection::Operation op = Selection::Set, bool no_remove=false);
|
||||
void set_selected_track_as_side_effect (Selection::Operation op);
|
||||
void set_selected_track_as_side_effect (Selection::Operation op, PBD::Controllable::GroupControlDisposition gcd = PBD::Controllable::UseGroup);
|
||||
bool set_selected_regionview_from_click (bool press, Selection::Operation op = Selection::Set);
|
||||
|
||||
bool set_selected_regionview_from_map_event (GdkEventAny*, StreamView*, boost::weak_ptr<ARDOUR::Region>);
|
||||
|
|
|
@ -5388,6 +5388,12 @@ SelectionDrag::motion (GdkEvent* event, bool first_move)
|
|||
_track_selection_at_start = _editor->selection->tracks;
|
||||
}
|
||||
|
||||
/* in the case where there was no existing selection, we can check the group_ovveride */
|
||||
PBD::Controllable::GroupControlDisposition gcd = PBD::Controllable::UseGroup;
|
||||
if (ArdourKeyboard::is_group_override_event((GdkEventButton*)event) && _track_selection_at_start.empty()) {
|
||||
gcd = PBD::Controllable::NoGroup;
|
||||
}
|
||||
|
||||
switch (_operation) {
|
||||
case CreateSelection:
|
||||
{
|
||||
|
@ -5416,18 +5422,16 @@ SelectionDrag::motion (GdkEvent* event, bool first_move)
|
|||
if (first_move) {
|
||||
|
||||
if (_add) {
|
||||
|
||||
/* adding to the selection */
|
||||
_editor->set_selected_track_as_side_effect (Selection::Add);
|
||||
_editor->set_selected_track_as_side_effect (Selection::Add, gcd);
|
||||
_editor->clicked_selection = _editor->selection->add (start, end);
|
||||
_add = false;
|
||||
|
||||
} else {
|
||||
|
||||
/* new selection */
|
||||
|
||||
if (_editor->clicked_axisview && !_editor->selection->selected (_editor->clicked_axisview)) {
|
||||
_editor->set_selected_track_as_side_effect (Selection::Set);
|
||||
_editor->set_selected_track_as_side_effect (Selection::Set, gcd);
|
||||
}
|
||||
|
||||
_editor->clicked_selection = _editor->selection->set (start, end);
|
||||
|
@ -5472,7 +5476,7 @@ SelectionDrag::motion (GdkEvent* event, bool first_move)
|
|||
tracks_to_remove.push_back (*i);
|
||||
} else {
|
||||
RouteGroup* rg = (*i)->route_group();
|
||||
if (rg && rg->is_active() && rg->is_select()) {
|
||||
if (rg && rg->is_active() && rg->is_select() && gcd != Controllable::NoGroup) {
|
||||
selected_route_groups.push_back (rg);
|
||||
}
|
||||
}
|
||||
|
@ -5484,7 +5488,7 @@ SelectionDrag::motion (GdkEvent* event, bool first_move)
|
|||
tracks_to_add.push_back (*i);
|
||||
RouteGroup* rg = (*i)->route_group();
|
||||
|
||||
if (rg && rg->is_active() && rg->is_select()) {
|
||||
if (rg && rg->is_active() && rg->is_select() && gcd != Controllable::NoGroup) {
|
||||
selected_route_groups.push_back (rg);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -937,7 +937,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
|||
break;
|
||||
|
||||
case StreamItem:
|
||||
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::RangeSelectModifier)) {
|
||||
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::RangeSelectModifier) && !selection->time.empty()) {
|
||||
_drags->set (new SelectionDrag (this, item, SelectionDrag::SelectionExtend), event);
|
||||
} else {
|
||||
_drags->set (new SelectionDrag (this, item, SelectionDrag::CreateSelection), event);
|
||||
|
@ -953,7 +953,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
|||
break;
|
||||
|
||||
default:
|
||||
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::RangeSelectModifier)) {
|
||||
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::RangeSelectModifier) && !selection->time.empty()) {
|
||||
_drags->set (new SelectionDrag (this, item, SelectionDrag::SelectionExtend), event);
|
||||
} else {
|
||||
_drags->set (new SelectionDrag (this, item, SelectionDrag::CreateSelection), event);
|
||||
|
|
|
@ -205,7 +205,7 @@ Editor::select_all_visible_lanes ()
|
|||
* tracks, in which case nothing will happen unless `force' is true.
|
||||
*/
|
||||
void
|
||||
Editor::set_selected_track_as_side_effect (Selection::Operation op)
|
||||
Editor::set_selected_track_as_side_effect (Selection::Operation op, Controllable::GroupControlDisposition gcd)
|
||||
{
|
||||
if (!clicked_axisview) {
|
||||
return;
|
||||
|
@ -223,7 +223,7 @@ Editor::set_selected_track_as_side_effect (Selection::Operation op)
|
|||
if (selection->selected (clicked_axisview)) {
|
||||
if (group && group->is_active() && group->enabled_property(ARDOUR::Properties::group_select.property_id)) {
|
||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end (); ++i) {
|
||||
if ((*i)->route_group() == group) {
|
||||
if ((*i)->route_group() == group && gcd != Controllable::NoGroup) {
|
||||
selection->remove(*i);
|
||||
}
|
||||
}
|
||||
|
@ -233,7 +233,7 @@ Editor::set_selected_track_as_side_effect (Selection::Operation op)
|
|||
} else {
|
||||
if (group && group->is_active() && group->enabled_property(ARDOUR::Properties::group_select.property_id)) {
|
||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end (); ++i) {
|
||||
if ((*i)->route_group() == group) {
|
||||
if ((*i)->route_group() == group && gcd != Controllable::NoGroup) {
|
||||
selection->add(*i);
|
||||
}
|
||||
}
|
||||
|
@ -246,7 +246,7 @@ Editor::set_selected_track_as_side_effect (Selection::Operation op)
|
|||
case Selection::Add:
|
||||
if (group && group->is_active() && group->enabled_property(ARDOUR::Properties::group_select.property_id)) {
|
||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end (); ++i) {
|
||||
if ((*i)->route_group() == group) {
|
||||
if ((*i)->route_group() == group && gcd != Controllable::NoGroup) {
|
||||
selection->add(*i);
|
||||
}
|
||||
}
|
||||
|
@ -259,7 +259,7 @@ Editor::set_selected_track_as_side_effect (Selection::Operation op)
|
|||
selection->clear();
|
||||
if (group && group->is_active() && group->enabled_property(ARDOUR::Properties::group_select.property_id)) {
|
||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end (); ++i) {
|
||||
if ((*i)->route_group() == group) {
|
||||
if ((*i)->route_group() == group && gcd != Controllable::NoGroup) {
|
||||
selection->add(*i);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue