a-High/LowPass allow 8K samples inclusive
[ardour.git] / gtk2_ardour / editor_selection.cc
index 639e87a848023b565fdafa3942e60ec00cfa0b79..f2681b58e25e5ea32379c95a02314a26f05e1278 100644 (file)
@@ -43,7 +43,7 @@
 #include "midi_region_view.h"
 #include "sfdb_ui.h"
 
-#include "i18n.h"
+#include "pbd/i18n.h"
 
 using namespace std;
 using namespace ARDOUR;
@@ -879,7 +879,12 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op)
                if (!regions.empty()) {
                        selection->add (regions);
                        commit = true;
+               } else if (selection->regions.empty() && !selection->selected (clicked_regionview)) {
+                       /* ensure that at least the clicked regionview is selected. */
+                       selection->set (clicked_regionview);
+                       commit = true;
                }
+
        }
 
 out:
@@ -1088,7 +1093,6 @@ Editor::sensitize_all_region_actions (bool s)
 void
 Editor::sensitize_the_right_region_actions ()
 {
-
        RegionSelection rs = get_regions_from_selection_and_entered ();
        sensitize_all_region_actions (!rs.empty ());
 
@@ -1373,11 +1377,15 @@ Editor::region_selection_changed ()
        _regions->block_change_connection (false);
        editor_regions_selection_changed_connection.block(false);
 
-       if (!_all_region_actions_sensitized) {
-               /* This selection change might have changed what region actions
-                  are allowed, so sensitize them all in case a key is pressed.
-               */
-               sensitize_all_region_actions (true);
+       if (selection->regions.empty()) {
+               sensitize_all_region_actions (false);
+       } else {
+               if (!_all_region_actions_sensitized) {
+                       /* This selection change might have changed what region actions
+                          are allowed, so sensitize them all in case a key is pressed.
+                       */
+                       sensitize_all_region_actions (true);
+               }
        }
 
        if (_session && !_session->transport_rolling() && !selection->regions.empty()) {