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>
34 #include <gtkmm/liststore.h>
36 #include "pbd/stateful.h"
37 #include "pbd/signals.h"
39 #include "ardour/ardour.h"
40 #include "ardour/session_handle.h"
42 #include "route_processor_selection.h"
55 class Mixer_UI
: public Gtk::Window
, public PBD::ScopedConnectionList
, public ARDOUR::SessionHandlePtr
61 void set_session (ARDOUR::Session
*);
63 PluginSelector
* plugin_selector();
65 void set_strip_width (Width
);
66 Width
get_strip_width () const { return _strip_width
; }
68 void unselect_strip_in_display (MixerStrip
*);
69 void select_strip_in_display (MixerStrip
*);
71 XMLNode
& get_state (void);
72 int set_state (const XMLNode
& );
75 bool hide_window (GdkEventAny
*ev
);
76 void show_strip (MixerStrip
*);
77 void hide_strip (MixerStrip
*);
79 void ensure_float (Gtk::Window
&);
80 void toggle_auto_rebinding ();
81 void set_auto_rebinding(bool);
83 RouteRedirectSelection
& selection() { return _selection
; }
84 MonitorSection
* monitor_section() const { return _monitor_section
; }
89 Gtk::HBox global_hpacker
;
90 Gtk::VBox global_vpacker
;
91 Gtk::ScrolledWindow scroller
;
92 Gtk::EventBox scroller_base
;
93 Gtk::HBox scroller_hpacker
;
94 Gtk::VBox mixer_scroller_vpacker
;
95 Gtk::VBox list_vpacker
;
96 Gtk::Label group_display_button_label
;
97 Gtk::Button group_display_button
;
98 Gtk::ScrolledWindow track_display_scroller
;
99 Gtk::ScrolledWindow group_display_scroller
;
100 Gtk::VBox group_display_vbox
;
101 Gtk::Frame track_display_frame
;
102 Gtk::Frame group_display_frame
;
103 Gtk::VPaned rhs_pane1
;
104 Gtk::HBox strip_packer
;
105 Gtk::HBox out_packer
;
106 Gtk::HPaned list_hpane
;
108 MixerGroupTabs
* _group_tabs
;
110 // for restoring window geometry.
111 int m_root_x
, m_root_y
, m_width
, m_height
;
113 void set_window_pos_and_size ();
114 void get_window_pos_and_size ();
116 bool on_key_press_event (GdkEventKey
*);
117 bool on_key_release_event (GdkEventKey
*);
118 bool on_scroll_event (GdkEventScroll
*);
120 void pane_allocation_handler (Gtk::Allocation
&, Gtk::Paned
*);
122 std::list
<MixerStrip
*> strips
;
124 bool strip_scroller_button_release (GdkEventButton
*);
126 void scroll_right ();
128 void add_strip (ARDOUR::RouteList
&);
129 void remove_strip (MixerStrip
*);
131 void hide_all_strips (bool with_select
);
132 void unselect_all_strips();
133 void select_all_strips ();
134 void unselect_all_audiotrack_strips ();
135 void select_all_audiotrack_strips ();
136 void unselect_all_audiobus_strips ();
137 void select_all_audiobus_strips ();
139 void auto_rebind_midi_controls ();
142 void strip_select_op (bool audiotrack
, bool select
);
143 void select_strip_op (MixerStrip
*, bool select
);
145 void follow_strip_selection ();
147 gint
start_updating ();
148 gint
stop_updating ();
150 void session_going_away ();
152 sigc::connection fast_screen_update_connection
;
153 void fast_update_strips ();
155 void track_name_changed (MixerStrip
*);
157 void redisplay_track_list ();
158 bool no_track_list_redisplay
;
159 bool track_display_button_press (GdkEventButton
*);
160 void strip_width_changed ();
162 void track_list_change (const Gtk::TreeModel::Path
&,const Gtk::TreeModel::iterator
&);
163 void track_list_delete (const Gtk::TreeModel::Path
&);
164 void track_list_reorder (const Gtk::TreeModel::Path
& path
, const Gtk::TreeModel::iterator
& iter
, int* new_order
);
166 void initial_track_display ();
167 void show_track_list_menu ();
169 void set_all_strips_visibility (bool yn
);
170 void set_all_audio_visibility (int tracks
, bool yn
);
172 void hide_all_routes ();
173 void show_all_routes ();
174 void show_all_audiobus ();
175 void hide_all_audiobus ();
176 void show_all_audiotracks();
177 void hide_all_audiotracks ();
179 bool in_group_row_change
;
181 void group_selected (gint row
, gint col
, GdkEvent
*ev
);
182 void group_unselected (gint row
, gint col
, GdkEvent
*ev
);
183 void group_display_active_clicked();
184 void new_route_group ();
185 void remove_selected_route_group ();
186 void activate_all_route_groups ();
187 void disable_all_route_groups ();
188 void add_route_group (ARDOUR::RouteGroup
*);
189 void route_groups_changed ();
190 void route_group_name_edit (const std::string
&, const std::string
&);
191 void route_group_row_change (const Gtk::TreeModel::Path
& path
,const Gtk::TreeModel::iterator
& iter
);
193 Gtk::Menu
*track_menu
;
194 void track_column_click (gint
);
195 void build_track_menu ();
197 MonitorSection
* _monitor_section
;
198 PluginSelector
*_plugin_selector
;
200 void strip_property_changed (const PBD::PropertyChange
&, MixerStrip
*);
201 void route_group_property_changed (ARDOUR::RouteGroup
*, const PBD::PropertyChange
&);
203 /* various treeviews */
205 struct TrackDisplayModelColumns
: public Gtk::TreeModel::ColumnRecord
{
206 TrackDisplayModelColumns () {
212 Gtk::TreeModelColumn
<bool> visible
;
213 Gtk::TreeModelColumn
<std::string
> text
;
214 Gtk::TreeModelColumn
<boost::shared_ptr
<ARDOUR::Route
> > route
;
215 Gtk::TreeModelColumn
<MixerStrip
*> strip
;
218 struct GroupDisplayModelColumns
: public Gtk::TreeModel::ColumnRecord
{
219 GroupDisplayModelColumns() {
224 Gtk::TreeModelColumn
<bool> visible
;
225 Gtk::TreeModelColumn
<std::string
> text
;
226 Gtk::TreeModelColumn
<ARDOUR::RouteGroup
*> group
;
229 TrackDisplayModelColumns track_columns
;
230 GroupDisplayModelColumns group_columns
;
232 Gtk::TreeView track_display
;
233 Gtk::TreeView group_display
;
235 Glib::RefPtr
<Gtk::ListStore
> track_model
;
236 Glib::RefPtr
<Gtk::ListStore
> group_model
;
238 bool group_display_button_press (GdkEventButton
*);
239 void group_display_selection_changed ();
241 bool strip_button_release_event (GdkEventButton
*, MixerStrip
*);
243 RouteRedirectSelection _selection
;
247 void sync_order_keys (std::string
const &);
248 bool strip_redisplay_does_not_reset_order_keys
;
249 bool strip_redisplay_does_not_sync_order_keys
;
252 void parameter_changed (std::string
const &);
253 void set_route_group_activation (ARDOUR::RouteGroup
*, bool);
255 void setup_track_display ();
256 void new_track_or_bus ();
258 static const int32_t default_width
= 478;
259 static const int32_t default_height
= 765;
261 friend class MixerGroupTabs
;
264 #endif /* __ardour_mixer_ui_h__ */