From f0bf3a0c190ced488d1520435df8234ef50971d6 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 20 Jun 2009 15:40:26 +0000 Subject: 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 --- gtk2_ardour/route_time_axis.cc | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'gtk2_ardour/route_time_axis.cc') 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(&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; + } +} -- cgit v1.2.3