mp4chaps Lua script: don't clutter global environment
[ardour.git] / gtk2_ardour / editor_route_groups.h
1 /*
2     Copyright (C) 2000-2009 Paul Davis
3
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13
14     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 */
19
20 #ifndef __gtk_ardour_editor_route_groups_h__
21 #define __gtk_ardour_editor_route_groups_h__
22
23 #include <gtkmm/liststore.h>
24 #include <gtkmm/scrolledwindow.h>
25 #include <gtkmm/treemodel.h>
26 #include <gtkmm/treeview.h>
27
28 #include "editor_component.h"
29
30 class EditorRouteGroups : public EditorComponent, public ARDOUR::SessionHandlePtr
31 {
32 public:
33         EditorRouteGroups (Editor *);
34
35         void set_session (ARDOUR::Session *);
36
37         Gtk::Widget& widget () {
38                 return _display_packer;
39         }
40
41         void clear ();
42
43 private:
44
45         struct Columns : public Gtk::TreeModel::ColumnRecord {
46
47                 Columns () {
48                         add (gdkcolor);
49                         add (text);
50                         add (is_visible);
51                         add (gain);
52                         add (gain_relative);
53                         add (mute);
54                         add (solo);
55                         add (record);
56                         add (monitoring);
57                         add (select);
58                         add (active_shared);
59                         add (active_state);
60                         add (routegroup);
61                 }
62
63                 Gtk::TreeModelColumn<Gdk::Color> gdkcolor;
64                 Gtk::TreeModelColumn<std::string> text;
65                 Gtk::TreeModelColumn<bool> is_visible;
66                 Gtk::TreeModelColumn<bool> gain;
67                 Gtk::TreeModelColumn<bool> gain_relative;
68                 Gtk::TreeModelColumn<bool> mute;
69                 Gtk::TreeModelColumn<bool> solo;
70                 Gtk::TreeModelColumn<bool> record;
71                 Gtk::TreeModelColumn<bool> monitoring;
72                 Gtk::TreeModelColumn<bool> select;
73                 Gtk::TreeModelColumn<bool> active_shared;
74                 Gtk::TreeModelColumn<bool> active_state;
75                 Gtk::TreeModelColumn<ARDOUR::RouteGroup*> routegroup;
76         };
77
78         Columns _columns;
79
80         void add (ARDOUR::RouteGroup *);
81         void row_change (const Gtk::TreeModel::Path&,const Gtk::TreeModel::iterator&);
82         void name_edit (const std::string&, const std::string&);
83         void button_clicked ();
84         bool button_press_event (GdkEventButton* ev);
85         void groups_changed ();
86         void property_changed (ARDOUR::RouteGroup*, const PBD::PropertyChange &);
87         void remove_selected ();
88         void run_new_group_dialog ();
89         void row_deleted (Gtk::TreeModel::Path const &);
90
91         Glib::RefPtr<Gtk::ListStore> _model;
92         Glib::RefPtr<Gtk::TreeSelection> _selection;
93         Gtk::TreeView _display;
94         Gtk::ScrolledWindow _scroller;
95         Gtk::VBox _display_packer;
96         bool _in_row_change;
97         bool _in_rebuild;
98         PBD::ScopedConnectionList _property_changed_connections;
99         PBD::ScopedConnection all_route_groups_changed_connection;
100         Gtk::ColorSelectionDialog color_dialog;
101 };
102
103 #endif // __gtk_ardour_editor_route_groups_h__