Split route group list out of Editor.
[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         Gtk::Widget& widget () {
26                 return _scroller;
27         }
28
29         void move_selected_tracks (bool);
30         void initial_display ();
31         void show_track_in_display (TimeAxisView &);
32         void suspend_redisplay () {
33                 _no_redisplay = true;
34         }
35         void resume_redisplay () {
36                 _no_redisplay = false;
37                 redisplay ();
38         }
39         void redisplay ();
40         void update_visibility ();
41         void routes_added (std::list<RouteTimeAxisView*> routes);
42         void hide_track_in_display (TimeAxisView &);
43         std::list<TimeAxisView*> views () const;
44         void hide_all_tracks (bool);
45         void clear ();
46
47 private:
48
49         void on_tv_rec_enable_toggled (Glib::ustring const &);
50         void build_menu ();
51         void show_menu ();
52         void route_deleted (Gtk::TreeModel::Path const &);
53         void changed (Gtk::TreeModel::Path const &, Gtk::TreeModel::iterator const &);
54         void reordered (Gtk::TreeModel::Path const &, Gtk::TreeModel::iterator const &, int *);
55         bool button_press (GdkEventButton *);
56         void route_name_changed (boost::weak_ptr<ARDOUR::Route>);
57         void sync_order_keys (char const *);
58         void route_removed (TimeAxisView *);
59         void handle_gui_changes (std::string const &, void *);
60         void update_rec_display ();
61         void set_all_tracks_visibility (bool);
62         void set_all_audio_visibility (int, bool);
63         void show_all_routes ();
64         void hide_all_routes ();
65         void show_all_audiotracks ();
66         void hide_all_audiotracks ();
67         void show_all_audiobus ();
68         void hide_all_audiobus ();
69         void display_drag_data_received (
70                 Glib::RefPtr<Gdk::DragContext> const &, gint, gint, Gtk::SelectionData const &, guint, guint
71                 );
72         void track_list_reorder (Gtk::TreeModel::Path const &, Gtk::TreeModel::iterator const & iter, int* new_order);
73         bool selection_filter (Glib::RefPtr<Gtk::TreeModel> const &, Gtk::TreeModel::Path const &, bool);
74
75         struct ModelColumns : public Gtk::TreeModel::ColumnRecord {
76                 ModelColumns() { 
77                         add (text);
78                         add (visible);
79                         add (rec_enabled);
80                         add (is_track);
81                         add (tv);
82                         add (route);
83                 }
84                 Gtk::TreeModelColumn<Glib::ustring>  text;
85                 Gtk::TreeModelColumn<bool>           visible;
86                 Gtk::TreeModelColumn<bool>           rec_enabled;
87                 Gtk::TreeModelColumn<bool>           is_track;
88                 Gtk::TreeModelColumn<TimeAxisView*>  tv;
89                 Gtk::TreeModelColumn<boost::shared_ptr<ARDOUR::Route> >  route;
90         };
91
92         Gtk::ScrolledWindow _scroller;
93         Gtkmm2ext::DnDTreeView<boost::shared_ptr<ARDOUR::Route> > _display; 
94         Glib::RefPtr<Gtk::ListStore> _model;
95         ModelColumns _columns;
96         bool _ignore_reorder;
97         bool _no_redisplay;
98         bool _redisplay_does_not_sync_order_keys;
99         bool _redisplay_does_not_reset_order_keys;
100         Gtk::Menu* _menu;
101 };