fix setting of BWF info (from 3.0). thanks carl
[ardour2.git] / gtk2_ardour / mixer_ui.h
blob1c5ecda8505a6e6e6924ea644a73622dbe9391b6
1 /*
2 Copyright (C) 2000 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_mixer_ui_h__
21 #define __ardour_mixer_ui_h__
23 #include <list>
25 #include <gtkmm/box.h>
26 #include <gtkmm/scrolledwindow.h>
27 #include <gtkmm/eventbox.h>
28 #include <gtkmm/label.h>
29 #include <gtkmm/button.h>
30 #include <gtkmm/frame.h>
31 #include <gtkmm/paned.h>
32 #include <gtkmm/menu.h>
33 #include <gtkmm/treeview.h>
35 #include <pbd/stateful.h>
37 #include <ardour/ardour.h>
38 #include <ardour/io.h>
40 #include "route_redirect_selection.h"
41 #include "enums.h"
43 namespace ARDOUR {
44 class Route;
45 class RouteGroup;
46 class Session;
47 class AudioDiskstream;
50 class MixerStrip;
51 class PluginSelector;
53 class Mixer_UI : public Gtk::Window
55 public:
56 Mixer_UI ();
57 ~Mixer_UI();
59 void connect_to_session (ARDOUR::Session *);
61 PluginSelector& plugin_selector() { return *_plugin_selector; }
63 void set_strip_width (Width);
64 Width get_strip_width () const { return _strip_width; }
66 void unselect_strip_in_display (MixerStrip*);
67 void select_strip_in_display (MixerStrip*);
69 XMLNode& get_state (void);
70 int set_state (const XMLNode& );
72 void show_window ();
73 bool hide_window (GdkEventAny *ev);
74 void show_strip (MixerStrip *);
75 void hide_strip (MixerStrip *);
77 void ensure_float (Gtk::Window&);
78 void toggle_auto_rebinding ();
79 void set_auto_rebinding(bool);
81 RouteRedirectSelection& selection() { return _selection; }
83 static const char* get_order_key();
85 private:
86 ARDOUR::Session *session;
88 bool _visible;
90 Gtk::HBox global_hpacker;
91 Gtk::VBox global_vpacker;
92 Gtk::ScrolledWindow scroller;
93 Gtk::EventBox scroller_base;
94 Gtk::HBox scroller_hpacker;
95 Gtk::VBox mixer_scroller_vpacker;
96 Gtk::VBox list_vpacker;
97 Gtk::Label group_display_button_label;
98 Gtk::Button group_display_button;
99 Gtk::ScrolledWindow track_display_scroller;
100 Gtk::ScrolledWindow group_display_scroller;
101 Gtk::VBox group_display_vbox;
102 Gtk::Frame track_display_frame;
103 Gtk::Frame group_display_frame;
104 Gtk::VPaned rhs_pane1;
105 Gtk::HBox strip_packer;
106 Gtk::HBox out_packer;
107 Gtk::HPaned list_hpane;
109 // for restoring window geometry.
110 int m_root_x, m_root_y, m_width, m_height;
112 void set_window_pos_and_size ();
113 void get_window_pos_and_size ();
115 bool on_key_press_event (GdkEventKey*);
117 void pane_allocation_handler (Gtk::Allocation&, Gtk::Paned*);
119 list<MixerStrip *> strips;
121 bool strip_scroller_button_release (GdkEventButton*);
123 void add_strip (ARDOUR::Session::RouteList&);
124 void remove_strip (MixerStrip *);
126 void hide_all_strips (bool with_select);
127 void unselect_all_strips();
128 void select_all_strips ();
129 void unselect_all_audiotrack_strips ();
130 void select_all_audiotrack_strips ();
131 void unselect_all_audiobus_strips ();
132 void select_all_audiobus_strips ();
134 void auto_rebind_midi_controls ();
135 bool auto_rebinding;
137 void strip_select_op (bool audiotrack, bool select);
138 void select_strip_op (MixerStrip*, bool select);
140 void follow_strip_selection ();
142 gint start_updating ();
143 gint stop_updating ();
145 void disconnect_from_session ();
147 sigc::connection fast_screen_update_connection;
148 void fast_update_strips ();
150 void track_name_changed (MixerStrip *);
152 void redisplay_track_list ();
153 bool no_track_list_redisplay;
154 bool track_display_button_press (GdkEventButton*);
155 #ifdef GTKOSX
156 void queue_draw_all_strips ();
157 #endif
159 void track_list_change (const Gtk::TreeModel::Path&,const Gtk::TreeModel::iterator&);
160 void track_list_delete (const Gtk::TreeModel::Path&);
161 void track_list_reorder (const Gtk::TreeModel::Path& path, const Gtk::TreeModel::iterator& iter, int* new_order);
163 void initial_track_display ();
164 void show_track_list_menu ();
166 void set_all_strips_visibility (bool yn);
167 void set_all_audio_visibility (int tracks, bool yn);
169 void hide_all_routes ();
170 void show_all_routes ();
171 void show_all_audiobus ();
172 void hide_all_audiobus ();
173 void show_all_audiotracks();
174 void hide_all_audiotracks ();
176 Gtk::Menu* mix_group_context_menu;
177 bool in_group_row_change;
179 void group_selected (gint row, gint col, GdkEvent *ev);
180 void group_unselected (gint row, gint col, GdkEvent *ev);
181 void group_display_active_clicked();
182 void new_mix_group ();
183 void remove_selected_mix_group ();
184 void build_mix_group_context_menu ();
185 void activate_all_mix_groups ();
186 void disable_all_mix_groups ();
187 void show_all_mix_groups ();
188 void hide_all_mix_groups ();
189 void add_mix_group (ARDOUR::RouteGroup *);
190 void mix_groups_changed ();
191 void mix_group_name_edit (const Glib::ustring&, const Glib::ustring&);
192 void mix_group_row_change (const Gtk::TreeModel::Path& path,const Gtk::TreeModel::iterator& iter);
194 Gtk::Menu *track_menu;
195 void track_column_click (gint);
196 void build_track_menu ();
198 PluginSelector *_plugin_selector;
200 void strip_name_changed (void *src, MixerStrip *);
202 void group_flags_changed (void *src, ARDOUR::RouteGroup *);
204 /* various treeviews */
206 struct TrackDisplayModelColumns : public Gtk::TreeModel::ColumnRecord {
207 TrackDisplayModelColumns () {
208 add (text);
209 add (visible);
210 add (route);
211 add (strip);
213 Gtk::TreeModelColumn<bool> visible;
214 Gtk::TreeModelColumn<Glib::ustring> text;
215 Gtk::TreeModelColumn<boost::shared_ptr<ARDOUR::Route> > route;
216 Gtk::TreeModelColumn<MixerStrip*> strip;
219 struct GroupDisplayModelColumns : public Gtk::TreeModel::ColumnRecord {
220 GroupDisplayModelColumns() {
221 add (active);
222 add (visible);
223 add (text);
224 add (group);
226 Gtk::TreeModelColumn<bool> active;
227 Gtk::TreeModelColumn<bool> visible;
228 Gtk::TreeModelColumn<Glib::ustring> text;
229 Gtk::TreeModelColumn<ARDOUR::RouteGroup*> group;
232 TrackDisplayModelColumns track_columns;
233 GroupDisplayModelColumns group_columns;
235 Gtk::TreeView track_display;
236 Gtk::TreeView group_display;
238 Glib::RefPtr<Gtk::ListStore> track_model;
239 Glib::RefPtr<Gtk::ListStore> group_model;
241 bool group_display_button_press (GdkEventButton*);
242 void group_display_selection_changed ();
244 bool strip_button_release_event (GdkEventButton*, MixerStrip*);
246 RouteRedirectSelection _selection;
248 Width _strip_width;
250 void sync_order_keys (const char *src);
251 bool strip_redisplay_does_not_reset_order_keys;
252 bool strip_redisplay_does_not_sync_order_keys;
254 static const int32_t default_width = 478;
255 static const int32_t default_height = 765;
258 #endif /* __ardour_mixer_ui_h__ */