summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_group_tabs.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-07-19 21:47:07 +0000
committerCarl Hetherington <carl@carlh.net>2010-07-19 21:47:07 +0000
commit536384ea4ea7d468363ff5f284a817c42083c3b5 (patch)
treefb5c5762e962c827e047a71945d591b9e5526ba4 /gtk2_ardour/editor_group_tabs.cc
parent0cf3e493f98c133359facd7c30a48be19f139e82 (diff)
Tweak group tabs class hierarchy and offer the same menu in both editor and mixer. Fixes #3336.
git-svn-id: svn://localhost/ardour2/branches/3.0@7441 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_group_tabs.cc')
-rw-r--r--gtk2_ardour/editor_group_tabs.cc55
1 files changed, 48 insertions, 7 deletions
diff --git a/gtk2_ardour/editor_group_tabs.cc b/gtk2_ardour/editor_group_tabs.cc
index 04f61aaeef..ccf95b797f 100644
--- a/gtk2_ardour/editor_group_tabs.cc
+++ b/gtk2_ardour/editor_group_tabs.cc
@@ -23,12 +23,13 @@
#include "route_time_axis.h"
#include "utils.h"
#include "editor_route_groups.h"
+#include "editor_routes.h"
using namespace std;
using namespace ARDOUR;
EditorGroupTabs::EditorGroupTabs (Editor* e)
- : GroupTabs (e)
+ : EditorComponent (e)
{
}
@@ -146,14 +147,54 @@ EditorGroupTabs::routes_for_tab (Tab const * t) const
}
-Gtk::Menu*
-EditorGroupTabs::get_menu (RouteGroup *g)
+void
+EditorGroupTabs::add_menu_items (Gtk::Menu* m, RouteGroup* g)
+{
+ using namespace Gtk::Menu_Helpers;
+
+ if (g) {
+ MenuList& items = m->items ();
+ items.push_back (MenuElem (_("Fit to Window"), sigc::bind (sigc::mem_fun (*_editor, &Editor::fit_route_group), g)));
+ }
+}
+
+PBD::PropertyList
+EditorGroupTabs::default_properties () const
+{
+ PBD::PropertyList plist;
+
+ plist.add (Properties::active, true);
+ plist.add (Properties::mute, true);
+ plist.add (Properties::solo, true);
+ plist.add (Properties::recenable, true);
+ plist.add (Properties::edit, true);
+
+ return plist;
+}
+
+string
+EditorGroupTabs::order_key () const
{
- return _editor->_route_groups->menu (g);
+ return X_("editor");
}
-RouteGroup *
-EditorGroupTabs::new_route_group () const
+RouteList
+EditorGroupTabs::selected_routes () const
+{
+ RouteList rl;
+
+ for (TrackSelection::iterator i = _editor->get_selection().tracks.begin(); i != _editor->get_selection().tracks.end(); ++i) {
+ RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (*i);
+ if (rtv) {
+ rl.push_back (rtv->route());
+ }
+ }
+
+ return rl;
+}
+
+void
+EditorGroupTabs::sync_order_keys ()
{
- return _editor->_route_groups->new_route_group ();
+ _editor->_routes->sync_order_keys ("");
}