Add API allowing plugin preset load to affect automation
[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 "gtkmm2ext/stateful_button.h"
24 #include "editor_component.h"
25
26 class EditorRouteGroups : public EditorComponent, public ARDOUR::SessionHandlePtr
27 {
28 public:
29         EditorRouteGroups (Editor *);
30
31         void set_session (ARDOUR::Session *);
32
33         Gtk::Widget& widget () {
34                 return _display_packer;
35         }
36
37         void clear ();
38
39 private:
40
41         struct Columns : public Gtk::TreeModel::ColumnRecord {
42
43                 Columns () {
44                         add (gdkcolor);
45                         add (text);
46                         add (is_visible);
47                         add (gain);
48                         add (gain_relative);
49                         add (mute);
50                         add (solo);
51                         add (record);
52                         add (monitoring);
53                         add (select);
54                         add (active_shared);
55                         add (active_state);
56                         add (routegroup);
57                 }
58
59                 Gtk::TreeModelColumn<Gdk::Color> gdkcolor;
60                 Gtk::TreeModelColumn<std::string> text;
61                 Gtk::TreeModelColumn<bool> is_visible;
62                 Gtk::TreeModelColumn<bool> gain;
63                 Gtk::TreeModelColumn<bool> gain_relative;
64                 Gtk::TreeModelColumn<bool> mute;
65                 Gtk::TreeModelColumn<bool> solo;
66                 Gtk::TreeModelColumn<bool> record;
67                 Gtk::TreeModelColumn<bool> monitoring;
68                 Gtk::TreeModelColumn<bool> select;
69                 Gtk::TreeModelColumn<bool> active_shared;
70                 Gtk::TreeModelColumn<bool> active_state;
71                 Gtk::TreeModelColumn<ARDOUR::RouteGroup*> routegroup;
72         };
73
74         Columns _columns;
75
76         void add (ARDOUR::RouteGroup *);
77         void row_change (const Gtk::TreeModel::Path&,const Gtk::TreeModel::iterator&);
78         void name_edit (const std::string&, const std::string&);
79         void button_clicked ();
80         bool button_press_event (GdkEventButton* ev);
81         void groups_changed ();
82         void property_changed (ARDOUR::RouteGroup*, const PBD::PropertyChange &);
83         void remove_selected ();
84         void run_new_group_dialog ();
85         void row_deleted (Gtk::TreeModel::Path const &);
86
87         Glib::RefPtr<Gtk::ListStore> _model;
88         Glib::RefPtr<Gtk::TreeSelection> _selection;
89         Gtk::TreeView _display;
90         Gtk::ScrolledWindow _scroller;
91         Gtk::VBox _display_packer;
92         bool _in_row_change;
93         bool _in_rebuild;
94         PBD::ScopedConnectionList _property_changed_connections;
95         PBD::ScopedConnection all_route_groups_changed_connection;
96         Gtk::ColorSelectionDialog color_dialog;
97 };
98
99 #endif // __gtk_ardour_editor_route_groups_h__