2005-09-25 14:42:24 -04:00
|
|
|
/*
|
2009-10-14 12:10:01 -04:00
|
|
|
Copyright (C) 2000 Paul Davis
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <cstdlib>
|
|
|
|
#include <cmath>
|
|
|
|
#include <string>
|
|
|
|
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "pbd/error.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "ardour/session.h"
|
|
|
|
#include "ardour/region.h"
|
2008-01-10 16:20:59 -05:00
|
|
|
#include <gtkmm/treeview.h>
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
#include "ardour_ui.h"
|
|
|
|
#include "editor.h"
|
|
|
|
#include "time_axis_view.h"
|
2006-07-31 23:23:35 -04:00
|
|
|
#include "region_view.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
#include "selection.h"
|
|
|
|
|
|
|
|
#include "i18n.h"
|
|
|
|
|
|
|
|
using namespace ARDOUR;
|
2006-06-21 19:01:03 -04:00
|
|
|
using namespace PBD;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
void
|
|
|
|
Editor::keyboard_selection_finish (bool add)
|
|
|
|
{
|
2009-12-17 13:24:23 -05:00
|
|
|
if (_session && have_pending_keyboard_selection) {
|
2007-11-12 17:23:01 -05:00
|
|
|
|
2010-09-17 14:20:37 -04:00
|
|
|
framepos_t end;
|
2007-11-12 17:23:01 -05:00
|
|
|
bool ignored;
|
|
|
|
|
2009-12-17 13:24:23 -05:00
|
|
|
if (_session->transport_rolling()) {
|
|
|
|
end = _session->audible_frame();
|
2007-11-12 17:23:01 -05:00
|
|
|
} else {
|
|
|
|
if (!mouse_frame (end, ignored)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-03-05 14:39:16 -05:00
|
|
|
if (add) {
|
2007-11-12 17:23:01 -05:00
|
|
|
selection->add (pending_keyboard_selection_start, end);
|
2006-03-05 14:39:16 -05:00
|
|
|
} else {
|
2009-12-13 16:27:19 -05:00
|
|
|
selection->set (pending_keyboard_selection_start, end);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2007-11-12 17:23:01 -05:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
have_pending_keyboard_selection = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Editor::keyboard_selection_begin ()
|
|
|
|
{
|
2009-12-17 13:24:23 -05:00
|
|
|
if (_session) {
|
|
|
|
if (_session->transport_rolling()) {
|
|
|
|
pending_keyboard_selection_start = _session->audible_frame();
|
2007-11-12 17:23:01 -05:00
|
|
|
have_pending_keyboard_selection = true;
|
|
|
|
} else {
|
|
|
|
bool ignored;
|
2010-09-17 14:20:37 -04:00
|
|
|
framepos_t where; // XXX fix me
|
2007-11-12 17:23:01 -05:00
|
|
|
|
|
|
|
if (mouse_frame (where, ignored)) {
|
|
|
|
pending_keyboard_selection_start = where;
|
|
|
|
have_pending_keyboard_selection = true;
|
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2007-11-12 17:23:01 -05:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Editor::keyboard_paste ()
|
|
|
|
{
|
2008-01-10 16:20:59 -05:00
|
|
|
ensure_entered_track_selected (true);
|
|
|
|
paste (1);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2009-07-21 11:55:17 -04:00
|
|
|
Editor::get_prefix (float& /*val*/, bool& was_floating)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2007-02-08 22:36:00 -05:00
|
|
|
was_floating = false;
|
|
|
|
return 1;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|