#include "pbd/stacktrace.h"
-#include "ardour/session.h"
+#include "ardour/midi_region.h"
#include "ardour/playlist.h"
-#include "ardour/route_group.h"
#include "ardour/profile.h"
-#include "ardour/midi_region.h"
-#include "ardour/audioplaylist.h"
+#include "ardour/route_group.h"
+#include "ardour/session.h"
#include "control_protocol/control_protocol.h"
case Selection::Extend:
selection->clear();
- cerr << ("Editor::set_selected_track_as_side_effect case Selection::Add not yet implemented\n");
break;
}
}
return false;
}
- if (!press) {
- return true;
- }
-
switch (op) {
case Selection::Set:
- selection->set (clicked_control_point);
+ if (press) {
+ selection->set (clicked_control_point);
+ }
break;
case Selection::Add:
- selection->add (clicked_control_point);
+ if (press) {
+ selection->add (clicked_control_point);
+ }
break;
case Selection::Toggle:
- selection->toggle (clicked_control_point);
+ /* This is a bit of a hack; if we Primary-Click-Drag a control
+ point (for push drag) we want the point we clicked on to be
+ selected, otherwise we end up confusingly dragging an
+ unselected point. So here we ensure that the point is selected
+ after the press, and if we subsequently get a release (meaning no
+ drag occurred) we set things up so that the toggle has happened.
+ */
+ if (press && !selection->selected (clicked_control_point)) {
+ /* This is the button press, and the control point is not selected; make it so,
+ in case this press leads to a drag. Also note that having done this, we don't
+ need to toggle again on release.
+ */
+ selection->toggle (clicked_control_point);
+ _control_point_toggled_on_press = true;
+ } else if (!press && !_control_point_toggled_on_press) {
+ /* This is the release, and the point wasn't toggled on the press, so do it now */
+ selection->toggle (clicked_control_point);
+ } else {
+ /* Reset our flag */
+ _control_point_toggled_on_press = false;
+ }
break;
case Selection::Extend:
/* XXX */
RouteTimeAxisView* closest = 0;
int distance = INT_MAX;
- int key = rtv->route()->order_key ("editor");
+ int key = rtv->route()->order_key (EditorSort);
for (RegionSelection::iterator x = selection->regions.begin(); x != selection->regions.end(); ++x) {
if (result.second) {
/* newly added to already_in_selection */
- int d = artv->route()->order_key ("editor");
+ int d = artv->route()->order_key (EditorSort);
d -= key;
/* now add all tracks between that one and this one */
- int okey = closest->route()->order_key ("editor");
+ int okey = closest->route()->order_key (EditorSort);
if (okey > key) {
swap (okey, key);
RouteTimeAxisView* artv = dynamic_cast<RouteTimeAxisView*>(*x);
if (artv && artv != rtv) {
- int k = artv->route()->order_key ("editor");
+ int k = artv->route()->order_key (EditorSort);
if (k >= okey && k <= key) {
void
Editor::sensitize_the_right_region_actions ()
{
- if ((mouse_mode == MouseRange) || (mouse_mode != MouseObject && _join_object_range_state == JOIN_OBJECT_RANGE_RANGE)) {
- sensitize_all_region_actions (false);
- if (!selection->time.empty()) {
- _region_actions->get_action("split-region")->set_sensitive (true);
- }
- return;
-
- } else if (mouse_mode != MouseObject) {
- sensitize_all_region_actions (false);
- return;
- }
-
- /* We get here if we are in Object mode */
RegionSelection rs = get_regions_from_selection_and_entered ();
sensitize_all_region_actions (!rs.empty ());