2 Copyright (C) 2018-2019 Len Ovens
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.
19 #ifndef __ardour_foldback_strip__
20 #define __ardour_foldback_strip__
26 #include <gtkmm/adjustment.h>
27 #include <gtkmm/button.h>
28 #include <gtkmm/box.h>
29 #include <gtkmm/eventbox.h>
30 #include <gtkmm/frame.h>
31 #include <gtkmm/label.h>
32 #include <gtkmm/menu.h>
33 #include <gtkmm/scrolledwindow.h>
34 #include <gtkmm/sizegroup.h>
35 #include <gtkmm/textview.h>
36 #include <gtkmm/togglebutton.h>
38 #include "pbd/stateful.h"
40 #include "ardour/types.h"
41 #include "ardour/ardour.h"
42 #include "ardour/processor.h"
44 #include "pbd/fastlog.h"
46 #include "widgets/ardour_button.h"
47 #include "widgets/ardour_knob.h"
50 #include "panner_ui.h"
52 #include "processor_box.h"
53 #include "processor_selection.h"
70 class MotionController;
74 class FoldbackSend : public Gtk::VBox
77 FoldbackSend (boost::shared_ptr<ARDOUR::Send>, \
78 boost::shared_ptr<ARDOUR::Route> sr, boost::shared_ptr<ARDOUR::Route> fr, uint32_t wd);
82 ArdourWidgets::ArdourButton _button;
83 boost::shared_ptr<ARDOUR::Send> _send;
84 boost::shared_ptr<ARDOUR::Route> _send_route;
85 boost::shared_ptr<ARDOUR::Route> _foldback_route;
86 boost::shared_ptr<ARDOUR::Processor> _send_proc;
87 boost::shared_ptr<ARDOUR::Delivery> _send_del;
90 void led_clicked(GdkEventButton *);
91 gboolean button_press (GdkEventButton*);
92 Gtk::Menu* build_send_menu ();
93 void set_gain (float new_gain);
96 void route_property_changed (const PBD::PropertyChange&);
98 void send_state_changed ();
99 void level_adjusted ();
100 void level_changed ();
102 ArdourWidgets::ArdourKnob pan_control;
103 Gtk::Adjustment _adjustment;
104 ArdourWidgets::HSliderController _slider;
105 bool _ignore_ui_adjustment;
106 Gtkmm2ext::PersistentTooltip _slider_persistant_tooltip;
108 PBD::ScopedConnectionList _connections;
114 class FoldbackStrip : public RouteUI, public Gtk::EventBox
117 FoldbackStrip (Mixer_UI&, ARDOUR::Session*, boost::shared_ptr<ARDOUR::Route>);
120 std::string name() const;
122 boost::shared_ptr<ARDOUR::Stripable> stripable() const { return RouteUI::stripable(); }
124 PannerUI& panner_ui() { return panners; }
125 PluginSelector* plugin_selector();
127 void set_embedded (bool);
129 void set_route (boost::shared_ptr<ARDOUR::Route>);
130 void set_button_names ();
131 void revert_to_default_display ();
133 /** @return the delivery that is being edited using our fader; it will be the
134 * last send passed to show_send(), or our route's main out delivery.
136 boost::shared_ptr<ARDOUR::Delivery> current_delivery () const {
137 return _current_delivery;
140 bool mixer_owned () const {
144 /** The delivery that we are handling the level for with our fader has changed */
145 PBD::Signal1<void, boost::weak_ptr<ARDOUR::Delivery> > DeliveryChanged;
147 static PBD::Signal1<void,FoldbackStrip*> CatchDeletion;
149 void route_active_changed ();
151 void copy_processors ();
152 void cut_processors ();
153 void paste_processors ();
154 void select_all_processors ();
155 void deselect_all_processors ();
156 bool delete_processors (); //note: returns false if nothing was deleted
157 void toggle_processors ();
160 void set_selected (bool yn);
162 static FoldbackStrip* entered_foldback_strip() { return _entered_foldback_strip; }
165 friend class Mixer_UI;
166 void set_packed (bool yn);
167 bool packed () { return _packed; }
176 ARDOUR::Session* _session;
180 Gtk::EventBox spacer;
181 Gtk::VBox send_display;
182 Gtk::ScrolledWindow send_scroller;
184 Gtk::Frame global_frame;
185 Gtk::VBox global_vpacker;
187 ProcessorBox* insert_box;
188 ProcessorSelection _pr_selection;
191 Gtk::Table mute_solo_table;
192 Gtk::HBox master_box;
194 ArdourWidgets::ArdourButton output_button;
196 Gtk::HBox prev_next_box;
198 void help_count_plugins (boost::weak_ptr<ARDOUR::Processor>);
199 uint32_t _plugin_insert_cnt;
201 ArdourWidgets::ArdourButton name_button;
202 ArdourWidgets::ArdourButton _show_sends_button;
203 ArdourWidgets::ArdourButton _previous_button;
204 ArdourWidgets::ArdourButton _next_button;
205 ArdourWidgets::ArdourButton _hide_button;
206 ArdourWidgets::ArdourButton _comment_button;
207 ArdourWidgets::ArdourKnob* fb_level_control;
209 void setup_comment_button ();
212 gint output_press (GdkEventButton *);
213 gint output_release (GdkEventButton *);
215 Gtk::Menu output_menu;
216 std::list<boost::shared_ptr<ARDOUR::Bundle> > output_menu_bundles;
217 void maybe_add_bundle_to_output_menu (boost::shared_ptr<ARDOUR::Bundle>, ARDOUR::BundleList const &,
218 ARDOUR::DataType type = ARDOUR::DataType::NIL);
220 void bundle_output_chosen (boost::shared_ptr<ARDOUR::Bundle>);
222 void io_changed_proxy ();
224 PBD::ScopedConnection panstate_connection;
225 PBD::ScopedConnection panstyle_connection;
226 void connect_to_pan ();
227 void update_panner_choices ();
228 void update_fb_level_control ();
230 void update_output_display ();
231 void update_send_box ();
232 void processors_changed (ARDOUR::RouteProcessorChange);
233 void clear_send_box ();
235 gboolean name_button_button_press (GdkEventButton*);
236 Gtk::Menu* build_route_ops_menu ();
237 Gtk::Menu* build_route_select_menu ();
239 void previous_button_clicked ();
240 void next_button_clicked ();
241 void prev_next_changed ();
242 void show_sends_clicked ();
243 void send_blink (bool);
245 bool send_button_press_event (GdkEventButton *ev);
246 Gtk::Menu* build_sends_menu ();
248 void create_selected_sends (bool include_buses);
249 void remove_current_fb ();
251 void route_property_changed (const PBD::PropertyChange&);
252 void name_changed ();
254 void hide_processor_editor (boost::weak_ptr<ARDOUR::Processor> processor);
255 void hide_redirect_editors ();
257 static FoldbackStrip* _entered_foldback_strip;
259 void engine_running();
260 void engine_stopped();
262 void set_current_delivery (boost::shared_ptr<ARDOUR::Delivery>);
265 PBD::ScopedConnection send_gone_connection;
267 void reset_strip_style ();
269 void update_io_button ();
270 void port_connected_or_disconnected (boost::weak_ptr<ARDOUR::Port>, boost::weak_ptr<ARDOUR::Port>);
272 bool mixer_strip_enter_event ( GdkEventCrossing * );
273 bool mixer_strip_leave_event ( GdkEventCrossing * );
275 PBD::ScopedConnectionList _connections;
279 #endif /* __ardour_foldback_strip__ */