lincoln's patch to show mute/solo in editor RHS track/bus list
[ardour.git] / gtk2_ardour / editor_routes.h
1 /*
2     Copyright (C) 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 class EditorRoutes : public EditorComponent
21 {
22 public:
23         EditorRoutes (Editor *);
24
25         void connect_to_session (ARDOUR::Session *);
26
27         Gtk::Widget& widget () {
28                 return _scroller;
29         }
30
31         void move_selected_tracks (bool);
32         void show_track_in_display (TimeAxisView &);
33         
34         void suspend_redisplay () {
35                 _no_redisplay = true;
36         }
37         
38         void resume_redisplay () {
39                 _no_redisplay = false;
40                 redisplay ();
41         }
42         
43         void redisplay ();
44         void update_visibility ();
45         void routes_added (std::list<RouteTimeAxisView*> routes);
46         void hide_track_in_display (TimeAxisView &);
47         std::list<TimeAxisView*> views () const;
48         void hide_all_tracks (bool);
49         void clear ();
50         void sync_order_keys (std::string const &);
51
52 private:
53
54         void initial_display ();
55         void on_tv_rec_enable_toggled (Glib::ustring const &);
56         void on_tv_mute_enable_toggled (Glib::ustring const &);
57         void on_tv_solo_enable_toggled (Glib::ustring const &);
58         void build_menu ();
59         void show_menu ();
60         void route_deleted (Gtk::TreeModel::Path const &);
61         void changed (Gtk::TreeModel::Path const &, Gtk::TreeModel::iterator const &);
62         void reordered (Gtk::TreeModel::Path const &, Gtk::TreeModel::iterator const &, int *);
63         bool button_press (GdkEventButton *);
64         void route_name_changed (boost::weak_ptr<ARDOUR::Route>);
65         void route_removed (TimeAxisView *);
66         void handle_gui_changes (std::string const &, void *);
67         void update_rec_display ();
68         void update_mute_display (void* /*src*/);
69         void update_solo_display (void* /*src*/);
70         void set_all_tracks_visibility (bool);
71         void set_all_audio_visibility (int, bool);
72         void show_all_routes ();
73         void hide_all_routes ();
74         void show_all_audiotracks ();
75         void hide_all_audiotracks ();
76         void show_all_audiobus ();
77         void hide_all_audiobus ();
78         
79         void display_drag_data_received (
80                 Glib::RefPtr<Gdk::DragContext> const &, gint, gint, Gtk::SelectionData const &, guint, guint
81                 );
82         
83         void track_list_reorder (Gtk::TreeModel::Path const &, Gtk::TreeModel::iterator const & iter, int* new_order);
84         bool selection_filter (Glib::RefPtr<Gtk::TreeModel> const &, Gtk::TreeModel::Path const &, bool);
85         void name_edit (Glib::ustring const &, Glib::ustring const &);
86
87         struct ModelColumns : public Gtk::TreeModel::ColumnRecord {
88                 ModelColumns() {
89                         add (text);
90                         add (visible);
91                         add (rec_enabled);
92                         add (mute_enabled);
93                         add (solo_enabled);
94                         add (is_track);
95                         add (tv);
96                         add (route);
97                 }
98                 
99                 Gtk::TreeModelColumn<Glib::ustring>  text;
100                 Gtk::TreeModelColumn<bool>           visible;
101                 Gtk::TreeModelColumn<bool>           rec_enabled;
102                 Gtk::TreeModelColumn<bool>           mute_enabled;
103                 Gtk::TreeModelColumn<bool>           solo_enabled;
104                 Gtk::TreeModelColumn<bool>           is_track;
105                 Gtk::TreeModelColumn<TimeAxisView*>  tv;
106                 Gtk::TreeModelColumn<boost::shared_ptr<ARDOUR::Route> >  route;
107         };
108
109         Gtk::ScrolledWindow _scroller;
110         Gtkmm2ext::DnDTreeView<boost::shared_ptr<ARDOUR::Route> > _display;
111         Glib::RefPtr<Gtk::ListStore> _model;
112         ModelColumns _columns;
113         
114         bool _ignore_reorder;
115         bool _no_redisplay;
116         bool _redisplay_does_not_sync_order_keys;
117         bool _redisplay_does_not_reset_order_keys;
118         
119         Gtk::Menu* _menu;
120 };