From b01bdb7e70f021da764e81a4b55722e746e4885d Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 12 Nov 2007 22:23:01 +0000 Subject: merged with trunk revs 2605-2627 git-svn-id: svn://localhost/ardour2/trunk@2628 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor_keys.cc | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) (limited to 'gtk2_ardour/editor_keys.cc') 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; + } + + } } } -- cgit v1.2.3