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