summaryrefslogtreecommitdiff
path: root/gtk2_ardour/route_time_axis.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2009-06-20 15:40:26 +0000
committerCarl Hetherington <carl@carlh.net>2009-06-20 15:40:26 +0000
commitf0bf3a0c190ced488d1520435df8234ef50971d6 (patch)
tree5e437385cf03c2abf53d57742c9351b99d5dedbf /gtk2_ardour/route_time_axis.cc
parent6b20256ad47de1b4c02553f62c31e7e5c8b0cac8 (diff)
Allow edit group creation from the route UI's menu. Allow new tracks to be put in particular edit groups.
git-svn-id: svn://localhost/ardour2/branches/3.0@5226 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/route_time_axis.cc')
-rw-r--r--gtk2_ardour/route_time_axis.cc24
1 files changed, 23 insertions, 1 deletions
diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc
index 35c5ba6963..3a75ea5b19 100644
--- a/gtk2_ardour/route_time_axis.cc
+++ b/gtk2_ardour/route_time_axis.cc
@@ -75,6 +75,7 @@
#include "simplerect.h"
#include "streamview.h"
#include "utils.h"
+#include "route_group_dialog.h"
#include "ardour/track.h"
@@ -320,13 +321,18 @@ RouteTimeAxisView::edit_click (GdkEventButton *ev)
RadioMenuItem::Group group;
items.clear ();
+
+ items.push_back (MenuElem (_("New group..."), mem_fun (*this, &RouteTimeAxisView::set_edit_group_to_new)));
+
+ items.push_back (SeparatorElem ());
+
items.push_back (RadioMenuElem (group, _("No group"),
bind (mem_fun(*this, &RouteTimeAxisView::set_edit_group_from_menu), (RouteGroup *) 0)));
if (_route->edit_group() == 0) {
static_cast<RadioMenuItem*>(&items.back())->set_active ();
}
-
+
_session.foreach_edit_group (bind (mem_fun (*this, &RouteTimeAxisView::add_edit_group_menu_item), &group));
edit_group_menu.popup (ev->button, ev->time);
@@ -2401,3 +2407,19 @@ RouteTimeAxisView::remove_underlay(StreamView* v)
}
}
+void
+RouteTimeAxisView::set_edit_group_to_new ()
+{
+ RouteGroup* g = new RouteGroup (_session, "", RouteGroup::Active);
+ g->set_active (true, this);
+
+ RouteGroupDialog d (g);
+ int const r = d.do_run ();
+
+ if (r == Gtk::RESPONSE_OK) {
+ _session.add_edit_group (g);
+ _route->set_edit_group (g, this);
+ } else {
+ delete g;
+ }
+}