2 Copyright (C) 2000-2006 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.
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/sizegroup.h>
34 #include <gtkmm/textview.h>
35 #include <gtkmm/togglebutton.h>
37 #include "pbd/stateful.h"
39 #include "ardour/types.h"
40 #include "ardour/ardour.h"
41 #include "ardour/processor.h"
43 #include "pbd/fastlog.h"
45 #include "widgets/ardour_button.h"
46 #include "widgets/ardour_knob.h"
48 #include "axis_view.h"
50 #include "panner_ui.h"
52 #include "processor_box.h"
53 //#include "visibility_group.h"
54 #include "processor_selection.h"
71 class MotionController;
75 class FoldbackStrip : public AxisView, public RouteUI, public Gtk::EventBox
78 FoldbackStrip (Mixer_UI&, ARDOUR::Session*, boost::shared_ptr<ARDOUR::Route>);
81 std::string name() const;
82 Gdk::Color color () const;
84 boost::shared_ptr<ARDOUR::Stripable> stripable() const { return RouteUI::stripable(); }
86 // Width get_width_enum () const { return _width; }
87 void* width_owner () const { return _width_owner; }
89 PannerUI& panner_ui() { return panners; }
90 PluginSelector* plugin_selector();
93 void set_embedded (bool);
95 void set_route (boost::shared_ptr<ARDOUR::Route>);
96 void set_button_names ();
97 // void show_send (boost::shared_ptr<ARDOUR::Send>);
98 void revert_to_default_display ();
100 /** @return the delivery that is being edited using our fader; it will be the
101 * last send passed to ::show_send, or our route's main out delivery.
103 boost::shared_ptr<ARDOUR::Delivery> current_delivery () const {
104 return _current_delivery;
107 bool mixer_owned () const {
111 /** The delivery that we are handling the level for with our fader has changed */
112 PBD::Signal1<void, boost::weak_ptr<ARDOUR::Delivery> > DeliveryChanged;
114 static PBD::Signal1<void,FoldbackStrip*> CatchDeletion;
116 std::string state_id() const;
118 // void parameter_changed (std::string);
119 void route_active_changed ();
121 void copy_processors ();
122 void cut_processors ();
123 void paste_processors ();
124 void select_all_processors ();
125 void deselect_all_processors ();
126 bool delete_processors (); //note: returns false if nothing was deleted
127 void toggle_processors ();
130 void set_selected (bool yn);
132 static FoldbackStrip* entered_foldback_strip() { return _entered_foldback_strip; }
135 friend class Mixer_UI;
136 void set_packed (bool yn);
137 bool packed () { return _packed; }
139 void set_stuff_from_route ();
151 ARDOUR::Session* _session;
153 Gtk::EventBox spacer;
154 Gtk::VBox send_display;
156 Gtk::Frame global_frame;
157 Gtk::VBox global_vpacker;
159 ProcessorBox* insert_box;
160 ProcessorSelection _pr_selection;
163 Glib::RefPtr<Gtk::SizeGroup> button_size_group;
165 Gtk::Table mute_solo_table;
166 Gtk::Table bottom_button_table;
168 ArdourWidgets::ArdourButton output_button;
170 Gtk::HBox show_sends_box;
172 std::string longest_label;
174 void help_count_plugins (boost::weak_ptr<ARDOUR::Processor>);
175 uint32_t _plugin_insert_cnt;
177 gint mark_update_safe ();
178 guint32 mode_switch_in_progress;
180 ArdourWidgets::ArdourButton name_button;
181 ArdourWidgets::ArdourButton _select_button;
182 ArdourWidgets::ArdourButton _comment_button;
183 ArdourWidgets::ArdourKnob* fb_level_control;
185 void setup_comment_button ();
187 gint output_press (GdkEventButton *);
188 gint output_release (GdkEventButton *);
190 Gtk::Menu output_menu;
191 std::list<boost::shared_ptr<ARDOUR::Bundle> > output_menu_bundles;
192 void maybe_add_bundle_to_output_menu (boost::shared_ptr<ARDOUR::Bundle>, ARDOUR::BundleList const &,
193 ARDOUR::DataType type = ARDOUR::DataType::NIL);
195 void bundle_output_chosen (boost::shared_ptr<ARDOUR::Bundle>);
197 void io_changed_proxy ();
199 Gtk::Menu *send_action_menu;
200 void build_send_action_menu ();
202 PBD::ScopedConnection panstate_connection;
203 PBD::ScopedConnection panstyle_connection;
204 void connect_to_pan ();
205 void update_panner_choices ();
206 void update_fb_level_control ();
208 void update_output_display ();
210 void set_automated_controls_sensitivity (bool yn);
212 Gtk::Menu* route_ops_menu;
213 void build_route_ops_menu ();
214 gboolean name_button_button_press (GdkEventButton*);
215 void list_route_operations ();
217 Gtk::Menu* route_select_menu;
218 void build_route_select_menu ();
219 gboolean select_button_button_press (GdkEventButton*);
220 void list_fb_routes ();
222 void build_sends_menu ();
223 void remove_current_fb ();
225 Gtk::Style *passthru_style;
227 void show_passthru_color ();
229 void route_property_changed (const PBD::PropertyChange&);
230 void name_changed ();
231 void update_speed_display ();
233 void hide_processor_editor (boost::weak_ptr<ARDOUR::Processor> processor);
234 void hide_redirect_editors ();
236 bool ignore_speed_adjustment;
238 static FoldbackStrip* _entered_foldback_strip;
240 void engine_running();
241 void engine_stopped();
243 // virtual void bus_send_display_changed (boost::shared_ptr<ARDOUR::Route>);
245 void set_current_delivery (boost::shared_ptr<ARDOUR::Delivery>);
248 PBD::ScopedConnection send_gone_connection;
250 void reset_strip_style ();
252 ARDOUR::DataType guess_main_type(bool for_input, bool favor_connected = true) const;
254 void update_io_button ();
255 void port_connected_or_disconnected (boost::weak_ptr<ARDOUR::Port>, boost::weak_ptr<ARDOUR::Port>);
257 bool mixer_strip_enter_event ( GdkEventCrossing * );
258 bool mixer_strip_leave_event ( GdkEventCrossing * );
260 void add_output_port (ARDOUR::DataType);
262 bool _suspend_menu_callbacks;
265 #endif /* __ardour_foldback_strip__ */