Make edit groups effective with lassoo selections.
[ardour.git] / gtk2_ardour / editor_keys.cc
index 226863b88b0074b2a92eba392d808e665a29de64..b3081e8c8add34b17ca5d1720c45965c1db540b0 100644 (file)
@@ -15,7 +15,6 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id$
 */
 
 #include <cstdlib>
 #include "ardour_ui.h"
 #include "editor.h"
 #include "time_axis_view.h"
-#include "regionview.h"
+#include "region_view.h"
 #include "selection.h"
 
 #include "i18n.h"
 
 using namespace ARDOUR;
+using namespace PBD;
 using namespace sigc;
 
 void
@@ -43,10 +43,10 @@ Editor::keyboard_selection_finish (bool add)
 {
        if (session && have_pending_keyboard_selection) {
                begin_reversible_command (_("keyboard selection"));
-               if (!add) {
-                       selection->set (0, pending_keyboard_selection_start, session->audible_frame());
-               } else {
+               if (add) {
                        selection->add (pending_keyboard_selection_start, session->audible_frame());
+               } else {
+                       selection->set (0, pending_keyboard_selection_start, session->audible_frame());
                }
                commit_reversible_command ();
                have_pending_keyboard_selection = false;
@@ -65,24 +65,24 @@ Editor::keyboard_selection_begin ()
 void
 Editor::keyboard_duplicate_region ()
 {
-       if (selection->audio_regions.empty()) {
+       if (selection->regions.empty()) {
                return;
        }
 
-       float prefix;
+       float prefix = 0;
        bool was_floating;
 
        if (get_prefix (prefix, was_floating) == 0) {
-               duplicate_some_regions (selection->audio_regions, prefix);
+               duplicate_some_regions (selection->regions, prefix);
        } else {
-               duplicate_some_regions (selection->audio_regions, 1);
+               duplicate_some_regions (selection->regions, 1);
        }
 }
 
 void
 Editor::keyboard_duplicate_selection ()
 {
-       float prefix;
+       float prefix = 0;
        bool was_floating;
 
        if (get_prefix (prefix, was_floating) == 0) {
@@ -95,7 +95,7 @@ Editor::keyboard_duplicate_selection ()
 void
 Editor::keyboard_paste ()
 {
-       float prefix;
+       float prefix = 0;
        bool was_floating;
 
        if (get_prefix (prefix, was_floating) == 0) {
@@ -108,7 +108,7 @@ Editor::keyboard_paste ()
 void
 Editor::keyboard_insert_region_list_selection ()
 {
-       float prefix;
+       float prefix = 0;
        bool was_floating;
 
        if (get_prefix (prefix, was_floating) == 0) {
@@ -121,6 +121,7 @@ Editor::keyboard_insert_region_list_selection ()
 int
 Editor::get_prefix (float& val, bool& was_floating)
 {
-       return Keyboard::the_keyboard().get_prefix (val, was_floating);
+       was_floating = false;
+       return 1;
 }