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__
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"
39 #include "route_processor_selection.h"
46 class AudioDiskstream
;
53 class Mixer_UI
: public Gtk::Window
59 void connect_to_session (ARDOUR::Session
*);
61 PluginSelector
* 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
& );
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
; }
84 ARDOUR::Session
*session
;
88 Gtk::HBox global_hpacker
;
89 Gtk::VBox global_vpacker
;
90 Gtk::ScrolledWindow scroller
;
91 Gtk::EventBox scroller_base
;
92 Gtk::HBox scroller_hpacker
;
93 Gtk::VBox mixer_scroller_vpacker
;
94 Gtk::VBox list_vpacker
;
95 Gtk::Label group_display_button_label
;
96 Gtk::Button group_display_button
;
97 Gtk::ScrolledWindow track_display_scroller
;
98 Gtk::ScrolledWindow group_display_scroller
;
99 Gtk::VBox group_display_vbox
;
100 Gtk::Frame track_display_frame
;
101 Gtk::Frame group_display_frame
;
102 Gtk::VPaned rhs_pane1
;
103 Gtk::HBox strip_packer
;
104 Gtk::HBox out_packer
;
105 Gtk::HPaned list_hpane
;
107 MixerGroupTabs
* _group_tabs
;
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
*);
116 bool on_key_release_event (GdkEventKey
*);
118 void pane_allocation_handler (Gtk::Allocation
&, Gtk::Paned
*);
120 std::list
<MixerStrip
*> strips
;
122 bool strip_scroller_button_release (GdkEventButton
*);
124 void add_strip (ARDOUR::RouteList
&);
125 void remove_strip (MixerStrip
*);
127 void hide_all_strips (bool with_select
);
128 void unselect_all_strips();
129 void select_all_strips ();
130 void unselect_all_audiotrack_strips ();
131 void select_all_audiotrack_strips ();
132 void unselect_all_audiobus_strips ();
133 void select_all_audiobus_strips ();
135 void auto_rebind_midi_controls ();
138 void strip_select_op (bool audiotrack
, bool select
);
139 void select_strip_op (MixerStrip
*, bool select
);
141 void follow_strip_selection ();
143 gint
start_updating ();
144 gint
stop_updating ();
146 void disconnect_from_session ();
148 sigc::connection fast_screen_update_connection
;
149 void fast_update_strips ();
151 void track_name_changed (MixerStrip
*);
153 void redisplay_track_list ();
154 bool no_track_list_redisplay
;
155 bool track_display_button_press (GdkEventButton
*);
156 void strip_width_changed ();
158 void track_list_change (const Gtk::TreeModel::Path
&,const Gtk::TreeModel::iterator
&);
159 void track_list_delete (const Gtk::TreeModel::Path
&);
160 void track_list_reorder (const Gtk::TreeModel::Path
& path
, const Gtk::TreeModel::iterator
& iter
, int* new_order
);
162 void initial_track_display ();
163 void show_track_list_menu ();
165 void set_all_strips_visibility (bool yn
);
166 void set_all_audio_visibility (int tracks
, bool yn
);
168 void hide_all_routes ();
169 void show_all_routes ();
170 void show_all_audiobus ();
171 void hide_all_audiobus ();
172 void show_all_audiotracks();
173 void hide_all_audiotracks ();
175 Gtk::Menu
* route_group_context_menu
;
176 bool in_group_row_change
;
178 void group_selected (gint row
, gint col
, GdkEvent
*ev
);
179 void group_unselected (gint row
, gint col
, GdkEvent
*ev
);
180 void group_display_active_clicked();
181 void new_route_group ();
182 void remove_selected_route_group ();
183 void build_route_group_context_menu ();
184 void activate_all_route_groups ();
185 void disable_all_route_groups ();
186 void add_route_group (ARDOUR::RouteGroup
*);
187 void route_groups_changed ();
188 void route_group_name_edit (const Glib::ustring
&, const Glib::ustring
&);
189 void route_group_row_change (const Gtk::TreeModel::Path
& path
,const Gtk::TreeModel::iterator
& iter
);
191 Gtk::Menu
*track_menu
;
192 void track_column_click (gint
);
193 void build_track_menu ();
195 PluginSelector
*_plugin_selector
;
197 void strip_name_changed (MixerStrip
*);
199 void group_flags_changed (void *src
, ARDOUR::RouteGroup
*);
201 /* various treeviews */
203 struct TrackDisplayModelColumns
: public Gtk::TreeModel::ColumnRecord
{
204 TrackDisplayModelColumns () {
210 Gtk::TreeModelColumn
<bool> visible
;
211 Gtk::TreeModelColumn
<Glib::ustring
> text
;
212 Gtk::TreeModelColumn
<boost::shared_ptr
<ARDOUR::Route
> > route
;
213 Gtk::TreeModelColumn
<MixerStrip
*> strip
;
216 struct GroupDisplayModelColumns
: public Gtk::TreeModel::ColumnRecord
{
217 GroupDisplayModelColumns() {
222 Gtk::TreeModelColumn
<bool> visible
;
223 Gtk::TreeModelColumn
<Glib::ustring
> text
;
224 Gtk::TreeModelColumn
<ARDOUR::RouteGroup
*> group
;
227 TrackDisplayModelColumns track_columns
;
228 GroupDisplayModelColumns group_columns
;
230 Gtk::TreeView track_display
;
231 Gtk::TreeView group_display
;
233 Glib::RefPtr
<Gtk::ListStore
> track_model
;
234 Glib::RefPtr
<Gtk::ListStore
> group_model
;
236 bool group_display_button_press (GdkEventButton
*);
237 void group_display_selection_changed ();
239 bool strip_button_release_event (GdkEventButton
*, MixerStrip
*);
241 RouteRedirectSelection _selection
;
245 void sync_order_keys (std::string
const &);
246 bool strip_redisplay_does_not_reset_order_keys
;
247 bool strip_redisplay_does_not_sync_order_keys
;
250 void parameter_changed (std::string
const &);
251 void set_route_group_activation (ARDOUR::RouteGroup
*, bool);
253 static const int32_t default_width
= 478;
254 static const int32_t default_height
= 765;
256 friend class MixerGroupTabs
;
259 #endif /* __ardour_mixer_ui_h__ */