Remove erroneous assert which I added earlier.
[ardour2.git] / gtk2_ardour / editor_routes.h
blob2ade937eff362b822ed549729b82f602a819495b
1 /*
2 Copyright (C) 2009 Paul Davis
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.
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.
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.
20 #ifndef __ardour_gtk_editor_route_h__
21 #define __ardour_gtk_editor_route_h__
23 #include "pbd/signals.h"
24 #include "editor_component.h"
26 class EditorRoutes : public EditorComponent, public PBD::ScopedConnectionList, public ARDOUR::SessionHandlePtr
28 public:
29 EditorRoutes (Editor *);
31 void set_session (ARDOUR::Session *);
33 Gtk::Widget& widget () {
34 return _scroller;
37 void move_selected_tracks (bool);
38 void show_track_in_display (TimeAxisView &);
40 void suspend_redisplay () {
41 _no_redisplay = true;
44 void resume_redisplay () {
45 _no_redisplay = false;
46 redisplay ();
49 void redisplay ();
50 void update_visibility ();
51 void routes_added (std::list<RouteTimeAxisView*> routes);
52 void route_removed (TimeAxisView *);
53 void hide_track_in_display (TimeAxisView &);
54 std::list<TimeAxisView*> views () const;
55 void hide_all_tracks (bool);
56 void clear ();
57 void sync_order_keys (std::string const &);
59 private:
61 void initial_display ();
62 void on_input_active_changed (std::string const &);
63 void on_tv_rec_enable_changed (std::string const &);
64 void on_tv_mute_enable_toggled (std::string const &);
65 void on_tv_solo_enable_toggled (std::string const &);
66 void on_tv_solo_isolate_toggled (std::string const &);
67 void on_tv_solo_safe_toggled (std::string const &);
68 void build_menu ();
69 void show_menu ();
70 void route_deleted (Gtk::TreeModel::Path const &);
71 void visible_changed (std::string const &);
72 void reordered (Gtk::TreeModel::Path const &, Gtk::TreeModel::iterator const &, int *);
73 bool button_press (GdkEventButton *);
74 void route_property_changed (const PBD::PropertyChange&, boost::weak_ptr<ARDOUR::Route>);
75 void handle_gui_changes (std::string const &, void *);
76 void update_rec_display ();
77 void update_mute_display ();
78 void update_solo_display (bool);
79 void update_solo_isolate_display ();
80 void update_solo_safe_display ();
81 void update_input_active_display ();
82 void set_all_tracks_visibility (bool);
83 void set_all_audio_midi_visibility (int, bool);
84 void show_all_routes ();
85 void hide_all_routes ();
86 void show_all_audiotracks ();
87 void hide_all_audiotracks ();
88 void show_all_audiobus ();
89 void hide_all_audiobus ();
90 void show_all_miditracks ();
91 void hide_all_miditracks ();
92 void show_tracks_with_regions_at_playhead ();
94 void display_drag_data_received (
95 Glib::RefPtr<Gdk::DragContext> const &, gint, gint, Gtk::SelectionData const &, guint, guint
98 void track_list_reorder (Gtk::TreeModel::Path const &, Gtk::TreeModel::iterator const & iter, int* new_order);
99 bool selection_filter (Glib::RefPtr<Gtk::TreeModel> const &, Gtk::TreeModel::Path const &, bool);
100 void name_edit (std::string const &, std::string const &);
101 void solo_changed_so_update_mute ();
103 struct ModelColumns : public Gtk::TreeModel::ColumnRecord {
104 ModelColumns() {
105 add (text);
106 add (visible);
107 add (rec_state);
108 add (mute_state);
109 add (solo_state);
110 add (solo_isolate_state);
111 add (solo_safe_state);
112 add (is_track);
113 add (tv);
114 add (route);
115 add (name_editable);
116 add (is_input_active);
117 add (is_midi);
120 Gtk::TreeModelColumn<std::string> text;
121 Gtk::TreeModelColumn<bool> visible;
122 Gtk::TreeModelColumn<uint32_t> rec_state;
123 Gtk::TreeModelColumn<uint32_t> mute_state;
124 Gtk::TreeModelColumn<uint32_t> solo_state;
125 Gtk::TreeModelColumn<uint32_t> solo_isolate_state;
126 Gtk::TreeModelColumn<uint32_t> solo_safe_state;
127 Gtk::TreeModelColumn<bool> is_track;
128 Gtk::TreeModelColumn<TimeAxisView*> tv;
129 Gtk::TreeModelColumn<boost::shared_ptr<ARDOUR::Route> > route;
130 Gtk::TreeModelColumn<bool> name_editable;
131 Gtk::TreeModelColumn<bool> is_input_active;
132 Gtk::TreeModelColumn<bool> is_midi;
135 Gtk::ScrolledWindow _scroller;
136 Gtkmm2ext::DnDTreeView<boost::shared_ptr<ARDOUR::Route> > _display;
137 Glib::RefPtr<Gtk::ListStore> _model;
138 ModelColumns _columns;
139 int _name_column;
140 int _visible_column;
142 bool _ignore_reorder;
143 bool _no_redisplay;
144 bool _redisplay_does_not_sync_order_keys;
145 bool _redisplay_does_not_reset_order_keys;
147 Gtk::Menu* _menu;
148 Gtk::Widget* old_focus;
149 uint32_t selection_countdown;
150 Gtk::CellEditable* name_editable;
152 bool key_press (GdkEventKey* ev);
153 bool focus_in (GdkEventFocus*);
154 bool focus_out (GdkEventFocus*);
155 bool enter_notify (GdkEventCrossing*);
156 bool leave_notify (GdkEventCrossing*);
157 void name_edit_started (Gtk::CellEditable*, const Glib::ustring&);
159 bool get_relevant_routes (boost::shared_ptr<ARDOUR::RouteList> rl);
162 #endif /* __ardour_gtk_editor_route_h__ */