2 Copyright (C) 2000 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 #include <pbd/error.h>
27 #include <ardour/session.h>
28 #include <ardour/region.h>
30 #include "ardour_ui.h"
32 #include "time_axis_view.h"
33 #include "regionview.h"
34 #include "selection.h"
38 using namespace ARDOUR;
42 Editor::keyboard_selection_finish (bool add)
44 if (session && have_pending_keyboard_selection) {
45 begin_reversible_command (_("keyboard selection"));
47 selection->add (pending_keyboard_selection_start, session->audible_frame());
49 selection->set (0, pending_keyboard_selection_start, session->audible_frame());
51 commit_reversible_command ();
52 have_pending_keyboard_selection = false;
57 Editor::keyboard_selection_begin ()
60 pending_keyboard_selection_start = session->audible_frame();
61 have_pending_keyboard_selection = true;
66 Editor::keyboard_duplicate_region ()
68 if (selection->audio_regions.empty()) {
75 if (get_prefix (prefix, was_floating) == 0) {
76 duplicate_some_regions (selection->audio_regions, prefix);
78 duplicate_some_regions (selection->audio_regions, 1);
83 Editor::keyboard_duplicate_selection ()
88 if (get_prefix (prefix, was_floating) == 0) {
89 duplicate_selection (prefix);
91 duplicate_selection (1);
96 Editor::keyboard_paste ()
101 if (get_prefix (prefix, was_floating) == 0) {
109 Editor::keyboard_insert_region_list_selection ()
114 if (get_prefix (prefix, was_floating) == 0) {
115 insert_region_list_selection (prefix);
117 insert_region_list_selection (1);
122 Editor::get_prefix (float& val, bool& was_floating)
124 return Keyboard::the_keyboard().get_prefix (val, was_floating);