ardour
editor_routes.h
Go to the documentation of this file.
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 #ifndef __ardour_gtk_editor_route_h__
21 #define __ardour_gtk_editor_route_h__
22 
23 #include "pbd/signals.h"
24 #include "gtkmm2ext/widget_state.h"
25 #include "editor_component.h"
26 
28 {
29 public:
30  EditorRoutes (Editor *);
31 
33 
34  Gtk::Widget& widget () {
35  return _scroller;
36  }
37 
38  void move_selected_tracks (bool);
40 
41 
43  if (!_no_redisplay) {
44  _no_redisplay = true;
45  _redisplay_on_resume = false;
46  }
47  }
48 
49  void resume_redisplay () {
50  _no_redisplay = false;
52  redisplay ();
53  }
54  }
55 
56  void redisplay ();
57  void update_visibility ();
58  void routes_added (std::list<RouteTimeAxisView*> routes);
59  void route_removed (TimeAxisView *);
61  std::list<TimeAxisView*> views () const;
62  void hide_all_tracks (bool);
63  void clear ();
66 
67 private:
68  void initial_display ();
69  void redisplay_real ();
70  void on_input_active_changed (std::string const &);
71  void on_tv_rec_enable_changed (std::string const &);
72  void on_tv_mute_enable_toggled (std::string const &);
73  void on_tv_solo_enable_toggled (std::string const &);
74  void on_tv_solo_isolate_toggled (std::string const &);
75  void on_tv_solo_safe_toggled (std::string const &);
76  void build_menu ();
77  void show_menu ();
79  void row_deleted (Gtk::TreeModel::Path const &);
80  void visible_changed (std::string const &);
81  void active_changed (std::string const &);
82  void reordered (Gtk::TreeModel::Path const &, Gtk::TreeModel::iterator const &, int *);
83  bool button_press (GdkEventButton *);
85  void handle_gui_changes (std::string const &, void *);
87  void update_rec_display ();
88  void update_mute_display ();
89  void update_solo_display (bool);
93  void update_active_display ();
94  void set_all_tracks_visibility (bool);
95  void set_all_audio_midi_visibility (int, bool);
96  void show_all_routes ();
97  void hide_all_routes ();
98  void show_all_audiotracks ();
99  void hide_all_audiotracks ();
100  void show_all_audiobus ();
101  void hide_all_audiobus ();
102  void show_all_miditracks ();
103  void hide_all_miditracks ();
105  void selection_changed ();
106 
108  Glib::RefPtr<Gdk::DragContext> const &, gint, gint, Gtk::SelectionData const &, guint, guint
109  );
110 
111  bool selection_filter (Glib::RefPtr<Gtk::TreeModel> const &, Gtk::TreeModel::Path const &, bool);
112  void name_edit (std::string const &, std::string const &);
114 
115  struct ModelColumns : public Gtk::TreeModel::ColumnRecord {
117  add (text);
118  add (visible);
119  add (rec_state);
120  add (mute_state);
121  add (solo_state);
122  add (solo_visible);
123  add (solo_isolate_state);
124  add (solo_safe_state);
125  add (is_track);
126  add (tv);
127  add (route);
128  add (name_editable);
129  add (is_input_active);
130  add (is_midi);
131  add (active);
132  }
133 
134  Gtk::TreeModelColumn<std::string> text;
135  Gtk::TreeModelColumn<bool> visible;
136  Gtk::TreeModelColumn<uint32_t> rec_state;
137  Gtk::TreeModelColumn<uint32_t> mute_state;
138  Gtk::TreeModelColumn<uint32_t> solo_state;
140  Gtk::TreeModelColumn<bool> solo_visible;
141  Gtk::TreeModelColumn<uint32_t> solo_isolate_state;
142  Gtk::TreeModelColumn<uint32_t> solo_safe_state;
143  Gtk::TreeModelColumn<bool> is_track;
144  Gtk::TreeModelColumn<TimeAxisView*> tv;
145  Gtk::TreeModelColumn<boost::shared_ptr<ARDOUR::Route> > route;
146  Gtk::TreeModelColumn<bool> name_editable;
147  Gtk::TreeModelColumn<bool> is_input_active;
148  Gtk::TreeModelColumn<bool> is_midi;
149  Gtk::TreeModelColumn<bool> active;
150  };
151 
152  Gtk::ScrolledWindow _scroller;
154  Glib::RefPtr<Gtk::ListStore> _model;
159 
165  volatile gint _redisplay_active;
166  volatile gint _queue_tv_update;
167 
168  Gtk::Menu* _menu;
169  Gtk::Widget* old_focus;
171  Gtk::CellEditable* name_editable;
172 
173  bool key_press (GdkEventKey* ev);
174  bool focus_in (GdkEventFocus*);
175  bool focus_out (GdkEventFocus*);
176  bool enter_notify (GdkEventCrossing*);
177  bool leave_notify (GdkEventCrossing*);
178  void name_edit_started (Gtk::CellEditable*, const Glib::ustring&);
179 
181 };
182 
183 #endif /* __ardour_gtk_editor_route_h__ */
void show_all_audiotracks()
volatile gint _queue_tv_update
void sync_order_keys_from_treeview()
void row_deleted(Gtk::TreeModel::Path const &)
void selection_changed()
void update_active_display()
bool _ignore_reorder
void update_rec_display()
void on_tv_solo_safe_toggled(std::string const &)
bool selection_filter(Glib::RefPtr< Gtk::TreeModel > const &, Gtk::TreeModel::Path const &, bool)
bool key_press(GdkEventKey *ev)
void display_drag_data_received(Glib::RefPtr< Gdk::DragContext > const &, gint, gint, Gtk::SelectionData const &, guint, guint)
void update_solo_isolate_display()
uint32_t selection_countdown
void on_tv_solo_enable_toggled(std::string const &)
bool button_press(GdkEventButton *)
void handle_gui_changes(std::string const &, void *)
Gtk::Widget & widget()
Definition: editor_routes.h:34
void hide_all_miditracks()
void update_visibility()
Gtk::TreeModelColumn< bool > active
bool idle_update_mute_rec_solo_etc()
Gtk::TreeModelColumn< bool > is_track
Gtk::TreeModelColumn< bool > name_editable
void move_selected_tracks(bool)
void on_tv_mute_enable_toggled(std::string const &)
bool enter_notify(GdkEventCrossing *)
void active_changed(std::string const &)
void show_all_routes()
void set_session(ARDOUR::Session *)
void hide_track_in_display(TimeAxisView &)
void hide_all_audiotracks()
void sync_treeview_from_order_keys()
Gtk::TreeModelColumn< uint32_t > solo_state
Gtk::TreeModelColumn< uint32_t > mute_state
void hide_all_routes()
void redisplay_real()
void update_mute_display()
void set_all_tracks_visibility(bool)
void name_edit_started(Gtk::CellEditable *, const Glib::ustring &)
void show_all_audiobus()
Gtk::TreeModelColumn< TimeAxisView * > tv
Gtkmm2ext::DnDTreeView< boost::shared_ptr< ARDOUR::Route > > _display
void initial_display()
void visible_changed(std::string const &)
void on_tv_solo_isolate_toggled(std::string const &)
void name_edit(std::string const &, std::string const &)
void routes_added(std::list< RouteTimeAxisView * > routes)
ModelColumns _columns
void show_tracks_with_regions_at_playhead()
bool focus_in(GdkEventFocus *)
Gtk::TreeModelColumn< bool > is_midi
void update_solo_display(bool)
void show_all_miditracks()
void show_track_in_display(TimeAxisView &)
void route_removed(TimeAxisView *)
Gtk::ScrolledWindow _scroller
void suspend_redisplay()
Definition: editor_routes.h:42
void solo_changed_so_update_mute()
void set_all_audio_midi_visibility(int, bool)
volatile gint _redisplay_active
Gtk::TreeModelColumn< std::string > text
Gtk::TreeModelColumn< boost::shared_ptr< ARDOUR::Route > > route
void update_input_active_display()
Gtk::TreeModelColumn< bool > is_input_active
Definition: editor.h:134
void on_input_active_changed(std::string const &)
bool get_relevant_routes(boost::shared_ptr< ARDOUR::RouteList > rl)
bool focus_out(GdkEventFocus *)
void route_property_changed(const PBD::PropertyChange &, boost::weak_ptr< ARDOUR::Route >)
bool leave_notify(GdkEventCrossing *)
Gtk::CellEditable * name_editable
Gtk::TreeModelColumn< uint32_t > solo_safe_state
std::list< TimeAxisView * > views() const
void reset_remote_control_ids()
void hide_all_audiobus()
Gtk::TreeModelColumn< uint32_t > rec_state
void update_solo_safe_display()
Gtk::TreeModelColumn< uint32_t > solo_isolate_state
Gtk::Menu * _menu
void on_tv_rec_enable_changed(std::string const &)
bool _route_deletion_in_progress
Glib::RefPtr< Gtk::ListStore > _model
bool _redisplay_on_resume
Gtk::Widget * old_focus
void hide_all_tracks(bool)
Gtk::TreeModelColumn< bool > solo_visible
Gtk::TreeModelColumn< bool > visible
EditorRoutes(Editor *)
void resume_redisplay()
Definition: editor_routes.h:49
void reordered(Gtk::TreeModel::Path const &, Gtk::TreeModel::iterator const &, int *)