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/scrolledwindow.h> // test
34 #include <gtkmm/sizegroup.h>
35 #include <gtkmm/table.h>
36 #include <gtkmm/textview.h>
37 #include <gtkmm/togglebutton.h>
39 #include "pbd/stateful.h"
41 #include "ardour/types.h"
42 #include "ardour/ardour.h"
43 #include "ardour/processor.h"
45 #include "pbd/fastlog.h"
47 #include "widgets/ardour_button.h"
48 #include "widgets/ardour_knob.h"
50 #include "axis_view.h"
52 #include "panner_ui.h"
69 class MotionController;
73 class FoldbackStrip : public AxisView, public RouteUI, public Gtk::EventBox
76 FoldbackStrip (Mixer_UI&, ARDOUR::Session*, boost::shared_ptr<ARDOUR::Route>);
79 std::string name() const;
80 Gdk::Color color () const;
82 boost::shared_ptr<ARDOUR::Stripable> stripable() const { return RouteUI::stripable(); }
84 void* width_owner () const { return _width_owner; }
86 PannerUI& panner_ui() { return panners; }
89 void set_embedded (bool);
91 void set_route (boost::shared_ptr<ARDOUR::Route>);
92 void set_button_names ();
93 void revert_to_default_display ();
95 /** @return the delivery that is being edited using our fader; it will be the
96 * last send passed to ::show_send, or our route's main out delivery.
98 boost::shared_ptr<ARDOUR::Delivery> current_delivery () const {
99 return _current_delivery;
102 bool mixer_owned () const {
106 /** The delivery that we are handling the level for with our fader has changed */
107 PBD::Signal1<void, boost::weak_ptr<ARDOUR::Delivery> > DeliveryChanged;
109 static PBD::Signal1<void,FoldbackStrip*> CatchDeletion;
111 std::string state_id() const;
113 void route_active_changed ();
115 static FoldbackStrip* entered_foldback_strip() { return _entered_foldback_strip; }
118 friend class Mixer_UI;
119 void set_packed (bool yn);
120 bool packed () { return _packed; }
122 void set_stuff_from_route ();
135 Gtk::EventBox spacer;
136 Gtk::VBox send_display;
138 Gtk::Frame global_frame;
139 Gtk::VBox global_vpacker;
143 Glib::RefPtr<Gtk::SizeGroup> button_size_group;
145 Gtk::Table mute_solo_table;
146 Gtk::Table bottom_button_table;
148 ArdourWidgets::ArdourButton output_button;
150 void output_button_resized (Gtk::Allocation&);
151 void comment_button_resized (Gtk::Allocation&);
153 Gtk::HBox show_sends_box;
155 std::string longest_label;
157 gint mark_update_safe ();
158 guint32 mode_switch_in_progress;
160 ArdourWidgets::ArdourButton name_button;
161 ArdourWidgets::ArdourButton _select_button;
162 ArdourWidgets::ArdourButton _comment_button;
163 ArdourWidgets::ArdourKnob* fb_level_control;
165 void setup_comment_button ();
167 gint output_press (GdkEventButton *);
168 gint output_release (GdkEventButton *);
170 Gtk::Menu output_menu;
171 std::list<boost::shared_ptr<ARDOUR::Bundle> > output_menu_bundles;
172 void maybe_add_bundle_to_output_menu (boost::shared_ptr<ARDOUR::Bundle>, ARDOUR::BundleList const &,
173 ARDOUR::DataType type = ARDOUR::DataType::NIL);
175 void bundle_output_chosen (boost::shared_ptr<ARDOUR::Bundle>);
177 void io_changed_proxy ();
179 Gtk::Menu *send_action_menu;
180 void build_send_action_menu ();
182 PBD::ScopedConnection panstate_connection;
183 PBD::ScopedConnection panstyle_connection;
184 void connect_to_pan ();
185 void update_panner_choices ();
186 void update_fb_level_control ();
188 void update_output_display ();
190 void set_automated_controls_sensitivity (bool yn);
192 Gtk::Menu* route_ops_menu;
193 void build_route_ops_menu ();
194 gboolean name_button_button_press (GdkEventButton*);
195 void list_route_operations ();
197 Gtk::Menu* route_select_menu;
198 void build_route_select_menu ();
199 gboolean select_button_button_press (GdkEventButton*);
200 void list_fb_routes ();
202 void build_sends_menu ();
203 void remove_current_fb ();
205 Gtk::Style *passthru_style;
207 void show_passthru_color ();
209 void route_property_changed (const PBD::PropertyChange&);
210 void name_button_resized (Gtk::Allocation&);
211 void name_changed ();
212 void update_speed_display ();
214 void hide_redirect_editors ();
216 bool ignore_speed_adjustment;
218 static FoldbackStrip* _entered_foldback_strip;
220 void engine_running();
221 void engine_stopped();
223 void set_current_delivery (boost::shared_ptr<ARDOUR::Delivery>);
226 PBD::ScopedConnection send_gone_connection;
228 void reset_strip_style ();
230 ARDOUR::DataType guess_main_type(bool for_input, bool favor_connected = true) const;
232 void update_io_button ();
233 void port_connected_or_disconnected (boost::weak_ptr<ARDOUR::Port>, boost::weak_ptr<ARDOUR::Port>);
235 bool mixer_strip_enter_event ( GdkEventCrossing * );
236 bool mixer_strip_leave_event ( GdkEventCrossing * );
238 void add_output_port (ARDOUR::DataType);
240 bool _suspend_menu_callbacks;
243 #endif /* __ardour_foldback_strip__ */