drastic, deep and wide changes to make RouteGroup use boost::shared_ptr<Route> and...
[ardour.git] / gtk2_ardour / route_group_menu.cc
index e42cdedfac1d51b9c489e5322b5698aa5210140c..bd8bcc8a28679473104348a230e8aedb062984a2 100644 (file)
@@ -1,3 +1,22 @@
+/*
+    Copyright (C) 2009 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 <gtkmm/menu.h>
 #include <gtkmm/stock.h>
 #include "ardour/session.h"
@@ -9,8 +28,9 @@
 using namespace Gtk;
 using namespace ARDOUR;
 
-RouteGroupMenu::RouteGroupMenu (Session& s)
-       : _session (s)
+RouteGroupMenu::RouteGroupMenu (Session& s, RouteGroup::Property p)
+       : _session (s),
+         _default_properties (p)
 {
        rebuild (0);
 }
@@ -19,7 +39,7 @@ void
 RouteGroupMenu::rebuild (RouteGroup* curr)
 {
        using namespace Menu_Helpers;
-       
+
        items().clear ();
 
        items().push_back (MenuElem (_("New group..."), mem_fun (*this, &RouteGroupMenu::new_group)));
@@ -31,7 +51,7 @@ RouteGroupMenu::rebuild (RouteGroup* curr)
        if (curr == 0) {
                static_cast<RadioMenuItem*> (&items().back())->set_active ();
        }
-               
+
        _session.foreach_route_group (bind (mem_fun (*this, &RouteGroupMenu::add_item), curr, &group));
 }
 
@@ -41,10 +61,10 @@ RouteGroupMenu::add_item (RouteGroup* rg, RouteGroup* curr, RadioMenuItem::Group
        using namespace Menu_Helpers;
 
        items().push_back (RadioMenuElem (*group, rg->name(), bind (mem_fun(*this, &RouteGroupMenu::set_group), rg)));
-       
+
        if (rg == curr) {
                static_cast<RadioMenuItem*> (&items().back())->set_active ();
-       }       
+       }
 }
 
 void
@@ -53,11 +73,10 @@ RouteGroupMenu::set_group (RouteGroup* g)
        GroupSelected (g);
 }
 
-
 void
 RouteGroupMenu::new_group ()
 {
-       RouteGroup* g = new RouteGroup (_session, "", RouteGroup::Active);
+       RouteGroup* g = new RouteGroup (_session, "", RouteGroup::Active, _default_properties);
 
        RouteGroupDialog d (g, Gtk::Stock::NEW);
        int const r = d.do_run ();