2005-09-25 14:42:24 -04:00
|
|
|
/*
|
|
|
|
Copyright (C) 2000 Paul Davis
|
|
|
|
|
|
|
|
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>
|
|
|
|
|
|
|
|
#include <pbd/error.h>
|
|
|
|
|
|
|
|
#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 16:33:00 -04:00
|
|
|
using namespace sigc;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
void
|
|
|
|
Editor::keyboard_selection_finish (bool add)
|
|
|
|
{
|
|
|
|
if (session && have_pending_keyboard_selection) {
|
2007-11-12 17:23:01 -05:00
|
|
|
|
|
|
|
nframes64_t end;
|
|
|
|
bool ignored;
|
|
|
|
|
|
|
|
if (session->transport_rolling()) {
|
|
|
|
end = session->audible_frame();
|
|
|
|
} 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 {
|
2007-11-12 17:23:01 -05:00
|
|
|
selection->set (0, 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 ()
|
|
|
|
{
|
|
|
|
if (session) {
|
2007-11-12 17:23:01 -05:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
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
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Editor::keyboard_insert_region_list_selection ()
|
|
|
|
{
|
2008-01-10 16:20:59 -05:00
|
|
|
insert_region_list_selection (1);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
Editor::get_prefix (float& val, bool& was_floating)
|
|
|
|
{
|
2007-02-08 22:36:00 -05:00
|
|
|
was_floating = false;
|
|
|
|
return 1;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|