summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_markers.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2012-06-19 13:54:28 +0000
committerCarl Hetherington <carl@carlh.net>2012-06-19 13:54:28 +0000
commitd54fb5f54ec4e3cfb88887a6a0ab5ee9407af0b5 (patch)
tree74428ce58b1fa597cb34115070b5416bb9640bda /gtk2_ardour/editor_markers.cc
parent3dd8fbdefa5ad5a818d1bc7d5952f9aaa97485bc (diff)
Add option to add new range marker from the context menu without needing the keyboard (#4378).
git-svn-id: svn://localhost/ardour2/branches/3.0@12781 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_markers.cc')
-rw-r--r--gtk2_ardour/editor_markers.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc
index 46f4a0ddd5..28706ac7bc 100644
--- a/gtk2_ardour/editor_markers.cc
+++ b/gtk2_ardour/editor_markers.cc
@@ -662,6 +662,31 @@ Editor::mouse_add_new_marker (framepos_t where, bool is_cd, bool is_xrun)
}
void
+Editor::mouse_add_new_range (framepos_t where)
+{
+ if (!_session) {
+ return;
+ }
+
+ /* Make this marker 1/8th of the visible area of the session so that
+ it's reasonably easy to manipulate after creation.
+ */
+
+ framepos_t const end = where + current_page_frames() / 8;
+
+ string name;
+ _session->locations()->next_available_name (name, _("range"));
+ Location* loc = new Location (*_session, where, end, name, Location::IsRangeMarker);
+
+ begin_reversible_command (_("new range marker"));
+ XMLNode& before = _session->locations()->get_state ();
+ _session->locations()->add (loc, true);
+ XMLNode& after = _session->locations()->get_state ();
+ _session->add_command (new MementoCommand<Locations> (*_session->locations(), &before, &after));
+ commit_reversible_command ();
+}
+
+void
Editor::remove_marker (ArdourCanvas::Item& item, GdkEvent*)
{
Marker* marker;