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.
21 #ifndef __ardour_mixer_strip__
22 #define __ardour_mixer_strip__
28 #include <gtkmm2ext/auto_spin.h>
29 #include <gtkmm2ext/slider_controller.h>
30 #include <gtkmm2ext/click_box.h>
32 #include <ardour/types.h>
33 #include <ardour/ardour.h>
34 #include <ardour/io.h>
35 #include <ardour/insert.h>
36 #include <ardour/stateful.h>
37 #include <ardour/redirect.h>
39 #include <pbd/fastlog.h>
42 #include "io_selector.h"
43 #include "gain_meter.h"
44 #include "panner_ui.h"
46 #include "redirect_box.h"
48 class MotionController;
52 class SliderController;
67 class MixerStrip : public RouteUI, public Gtk::EventBox
70 MixerStrip (Mixer_UI&, ARDOUR::Session&, ARDOUR::Route &, bool in_mixer = true);
73 void set_width (Width);
74 Width get_width() const { return _width; }
78 void set_embedded (bool);
81 friend class Mixer_UI;
82 void set_packed (bool yn);
83 bool packed () { return _packed; }
85 void set_selected(bool yn);
86 void set_stuff_from_route ();
95 Gtk::Button hide_button;
96 Gtk::Button width_button;
97 Gtk::HBox width_hide_box;
100 void width_clicked ();
102 Gtk::Frame global_frame;
103 Gtk::VBox global_vpacker;
105 RedirectBox pre_redirect_box;
106 RedirectBox post_redirect_box;
110 Gtk::Table button_table;
112 Gtk::Button diskstream_button;
113 Gtk::Label diskstream_label;
115 Gtk::Button input_button;
116 Gtk::Label input_label;
117 Gtk::Button output_button;
118 Gtk::Label output_label;
120 Gtk::Button gain_automation_style_button;
121 Gtk::ToggleButton gain_automation_state_button;
123 Gtk::Button pan_automation_style_button;
124 Gtk::ToggleButton pan_automation_state_button;
126 Gtk::Menu gain_astate_menu;
127 Gtk::Menu gain_astyle_menu;
128 Gtk::Menu pan_astate_menu;
129 Gtk::Menu pan_astyle_menu;
131 Gtk::ToggleButton polarity_button;
133 sigc::connection newplug_connection;
135 gint mark_update_safe ();
136 guint32 mode_switch_in_progress;
138 Gtk::Button name_button;
140 Gtk::Window* comment_window;
141 Gtk::Text comment_area;
142 Gtk::Button comment_button;
144 void setup_comment_editor ();
145 void comment_button_clicked ();
147 Gtk::Button group_button;
148 Gtk::Label group_label;
149 Gtk::Menu *group_menu;
151 gint input_press (GdkEventButton *);
152 gint output_press (GdkEventButton *);
154 Gtk::Menu input_menu;
155 void add_connection_to_input_menu (ARDOUR::Connection *);
157 Gtk::Menu output_menu;
158 void add_connection_to_output_menu (ARDOUR::Connection *);
160 void stream_input_chosen (ARDOUR::DiskStream*);
161 void select_stream_input ();
162 void connection_input_chosen (ARDOUR::Connection *);
163 void connection_output_chosen (ARDOUR::Connection *);
165 void edit_input_configuration ();
166 void edit_output_configuration ();
168 void diskstream_changed (void *src);
170 Gtk::Menu *send_action_menu;
171 void build_send_action_menu ();
174 void show_send_controls ();
177 gint gain_automation_style_button_event (GdkEventButton *);
178 gint gain_automation_state_button_event (GdkEventButton *);
179 gint pan_automation_style_button_event (GdkEventButton *);
180 gint pan_automation_state_button_event (GdkEventButton *);
182 void input_changed (ARDOUR::IOChange, void *);
183 void output_changed (ARDOUR::IOChange, void *);
184 void gain_automation_state_changed();
185 void pan_automation_state_changed();
186 void gain_automation_style_changed();
187 void pan_automation_style_changed();
189 sigc::connection panstate_connection;
190 sigc::connection panstyle_connection;
191 void connect_to_pan ();
193 std::string astate_string (ARDOUR::AutoState);
194 std::string short_astate_string (ARDOUR::AutoState);
195 std::string _astate_string (ARDOUR::AutoState, bool);
197 std::string astyle_string (ARDOUR::AutoStyle);
198 std::string short_astyle_string (ARDOUR::AutoStyle);
199 std::string _astyle_string (ARDOUR::AutoStyle, bool);
201 void update_diskstream_display ();
202 void update_input_display ();
203 void update_output_display ();
205 void set_automated_controls_sensitivity (bool yn);
207 Gtk::Menu *route_ops_menu;
208 void build_route_ops_menu ();
209 gint name_button_button_release (GdkEventButton*);
210 void list_route_operations ();
212 gint comment_key_release_handler (GdkEventKey*);
213 void comment_changed (void *src);
214 void comment_edited ();
215 bool ignore_comment_edit;
217 void set_mix_group (ARDOUR::RouteGroup *);
218 void add_mix_group_to_menu (ARDOUR::RouteGroup *);
219 gint select_mix_group (GdkEventButton *);
220 void mix_group_changed (void *);
222 void polarity_toggled ();
224 IOSelectorWindow *input_selector;
225 IOSelectorWindow *output_selector;
227 Gtk::Style *passthru_style;
229 void route_gui_changed (string, void*);
230 void show_route_color ();
231 void show_passthru_color ();
233 void route_active_changed ();
235 /* speed control (for tracks only) */
237 Gtk::Adjustment speed_adjustment;
238 Gtkmm2ext::ClickBox speed_spinner;
239 Gtk::Label speed_label;
240 Gtk::Frame speed_frame;
242 void speed_adjustment_changed ();
243 void speed_changed ();
244 void name_changed (void *src);
245 void update_speed_display ();
247 void hide_redirect_editor (ARDOUR::Redirect* redirect);
249 sigc::connection gain_watching;
250 sigc::connection pan_watching;
251 bool ignore_speed_adjustment;
253 string solo_button_name () const { return "MixerSoloButton"; }
254 string safe_solo_button_name () const { return "MixerSafeSoloButton"; }
257 #endif /* __ardour_mixer_strip__ */