View Issue Details

IDProjectCategoryView StatusLast Update
0005639ardourfeaturespublic2013-08-15 16:01
Reportertom_ Assigned To 
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionwon't fix 
Product Version3.0 
Summary0005639: Add Action to use a Range Selection for Time Insertion
Description
quick way to 'insert time' on one or more tracks using a selection

in context menu of a selection, new menu entry:

-Insert Time from Range (Split Intersected)

-> this will insert time (equal to range length) on all tracks that the selection includes
-> regions will be split if necessary
-> glued regions are moved
-> no markers, tempo or other items are moved
-> locked regions are not moved
TagsNo tags attached.

Activities

2013-08-07 20:08

 

add_editor_action_insert-time-from-selection.patch (2,652 bytes)   
From 11aa3ce98778dc7c344be718a08d739ea3110d48 Mon Sep 17 00:00:00 2001
From: Thomas Brand <tom@trellis.ch>
Date: Wed, 7 Aug 2013 21:54:21 +0200
Subject: [PATCH] add insert-time-from-selection editor action

---
 gtk2_ardour/editor.cc     |    3 +++
 gtk2_ardour/editor.h      |    2 ++
 gtk2_ardour/editor_ops.cc |   27 +++++++++++++++++++++++++++
 3 files changed, 32 insertions(+)

diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index 300e317..92db6ab 100644
--- a/gtk2_ardour/editor.cc
+++ b/gtk2_ardour/editor.cc
@@ -1897,6 +1897,9 @@ Editor::add_selection_context_items (Menu_Helpers::MenuList& edit_items)
 	edit_items.push_back (MenuElem (_("Set Punch from Range"), sigc::mem_fun(*this, &Editor::set_punch_from_selection)));
 
 	edit_items.push_back (SeparatorElem());
+	edit_items.push_back (MenuElem (_("Insert Time from Range (Split Intersected)"), sigc::mem_fun(*this, &Editor::insert_time_from_selection)));
+
+	edit_items.push_back (SeparatorElem());
 	edit_items.push_back (MenuElem (_("Add Range Markers"), sigc::mem_fun (*this, &Editor::add_location_from_selection)));
 
 	edit_items.push_back (SeparatorElem());
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h
index 033888c..8bf90c2 100644
--- a/gtk2_ardour/editor.h
+++ b/gtk2_ardour/editor.h
@@ -1331,6 +1331,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
 	void set_punch_from_selection ();
 	void set_punch_from_region ();
 
+	void insert_time_from_selection();
+
 	void set_loop_from_edit_range (bool play);
 	void set_loop_from_region (bool play);
 	void set_punch_from_edit_range ();
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc
index 93a53dd..66eccab 100644
--- a/gtk2_ardour/editor_ops.cc
+++ b/gtk2_ardour/editor_ops.cc
@@ -5644,6 +5644,33 @@ Editor::set_loop_from_selection (bool play)
 }
 
 void
+Editor::insert_time_from_selection ()
+{
+	if (_session == 0 || selection->time.empty()) {
+		return;
+	}
+
+	framepos_t start = selection->time[clicked_selection].start;
+	framepos_t end = selection->time[clicked_selection].end;
+
+	//cerr << "INSERT TIME FROM RANGE " << start << " " << end << "\n";
+
+	InsertTimeOption opt = SplitIntersected;
+
+        insert_time (
+		start,
+		(end-start),
+                opt,
+                false,  //all playlists
+                true,   //move glued regions
+                false,  //move markers
+                false,  //move glued markers
+                false,  //move locked markers
+                false   //move tempo
+                );
+}
+
+void
 Editor::set_loop_from_edit_range (bool play)
 {
 	if (_session == 0) {
-- 
1.7.9.5

tom_

2013-08-15 16:01

reporter   ~0015263

handling via github / pull requests to keep current

Issue History

Date Modified Username Field Change
2013-08-07 20:08 tom_ New Issue
2013-08-07 20:08 tom_ File Added: add_editor_action_insert-time-from-selection.patch
2013-08-15 16:01 tom_ Note Added: 0015263
2013-08-15 16:01 tom_ Status new => closed
2013-08-15 16:01 tom_ Resolution open => won't fix