summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_keys.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2007-11-12 22:23:01 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2007-11-12 22:23:01 +0000
commitb01bdb7e70f021da764e81a4b55722e746e4885d (patch)
tree3f22af0fc8399bedd6843f7a9a4383295ac7b3cb /gtk2_ardour/editor_keys.cc
parent99d002dbdf2563bcad880628e7876aebe191ba0c (diff)
merged with trunk revs 2605-2627
git-svn-id: svn://localhost/ardour2/trunk@2628 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_keys.cc')
-rw-r--r--gtk2_ardour/editor_keys.cc36
1 files changed, 30 insertions, 6 deletions
diff --git a/gtk2_ardour/editor_keys.cc b/gtk2_ardour/editor_keys.cc
index b3081e8c8a..d06b9f85aa 100644
--- a/gtk2_ardour/editor_keys.cc
+++ b/gtk2_ardour/editor_keys.cc
@@ -41,14 +41,27 @@ using namespace sigc;
void
Editor::keyboard_selection_finish (bool add)
{
+ cerr << "here\n";
+
if (session && have_pending_keyboard_selection) {
- begin_reversible_command (_("keyboard selection"));
+
+ nframes64_t end;
+ bool ignored;
+
+ if (session->transport_rolling()) {
+ end = session->audible_frame();
+ } else {
+ if (!mouse_frame (end, ignored)) {
+ return;
+ }
+ }
+
if (add) {
- selection->add (pending_keyboard_selection_start, session->audible_frame());
+ selection->add (pending_keyboard_selection_start, end);
} else {
- selection->set (0, pending_keyboard_selection_start, session->audible_frame());
+ selection->set (0, pending_keyboard_selection_start, end);
}
- commit_reversible_command ();
+
have_pending_keyboard_selection = false;
}
}
@@ -57,8 +70,19 @@ void
Editor::keyboard_selection_begin ()
{
if (session) {
- pending_keyboard_selection_start = session->audible_frame();
- have_pending_keyboard_selection = true;
+ if (session->transport_rolling()) {
+ pending_keyboard_selection_start = session->audible_frame();
+ have_pending_keyboard_selection = true;
+ } else {
+ bool ignored;
+ nframes64_t where; // XXX fix me
+
+ if (mouse_frame (where, ignored)) {
+ pending_keyboard_selection_start = where;
+ have_pending_keyboard_selection = true;
+ }
+
+ }
}
}