Ardour  9.0-pre0-582-g084a23a80d
foldback_strip.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018-2020 Len Ovens
3  *
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.
8  *
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.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef _gtkardour_foldback_strip_
20 #define _gtkardour_foldback_strip_
21 
22 #include <cmath>
23 #include <vector>
24 
25 #include <gtkmm/adjustment.h>
26 #include <gtkmm/box.h>
27 #include <gtkmm/button.h>
28 #include <gtkmm/eventbox.h>
29 #include <gtkmm/frame.h>
30 #include <gtkmm/label.h>
31 #include <gtkmm/menu.h>
32 #include <gtkmm/scrolledwindow.h>
33 #include <gtkmm/sizegroup.h>
34 #include <gtkmm/textview.h>
35 #include <gtkmm/togglebutton.h>
36 
37 #include "pbd/stateful.h"
38 
39 #include "ardour/ardour.h"
40 #include "ardour/meter.h"
41 #include "ardour/processor.h"
42 #include "ardour/types.h"
43 
44 #include "pbd/fastlog.h"
45 
46 #include "widgets/ardour_button.h"
47 #include "widgets/ardour_knob.h"
48 #include "widgets/fastmeter.h"
49 
50 #include "enums.h"
51 #include "io_button.h"
52 #include "panner_ui.h"
53 #include "processor_box.h"
54 #include "processor_selection.h"
55 #include "route_ui.h"
56 
57 namespace ARDOUR {
58  class Route;
59  class Send;
60  class Processor;
61  class Session;
62  class PortInsert;
63  class Bundle;
64  class Plugin;
65  class PeakMeter;
66 }
67 
68 namespace Gtk {
69  class Window;
70  class Style;
71 }
72 
73 class Mixer_UI;
74 class MotionController;
75 class RouteGroupMenu;
76 class ArdourWindow;
77 
78 class FoldbackSend : public Gtk::VBox
79 {
80 public:
81  FoldbackSend (std::shared_ptr<ARDOUR::Send>, std::shared_ptr<ARDOUR::Route> sr, std::shared_ptr<ARDOUR::Route> fr, uint32_t wd);
83 
84 private:
89  void set_gain (float new_gain);
90  void set_send_position (bool post);
91  void remove_me ();
93  void name_changed ();
96  void level_adjusted ();
97  void level_changed ();
98  void set_tooltip ();
99 
101 
103  std::shared_ptr<ARDOUR::Send> _send;
104  std::shared_ptr<ARDOUR::Route> _send_route;
105  std::shared_ptr<ARDOUR::Route> _foldback_route;
106  std::shared_ptr<ARDOUR::Processor> _send_proc;
107  std::shared_ptr<ARDOUR::Delivery> _send_del;
108  uint32_t _width;
115 };
116 
117 class FoldbackStrip : public RouteUI, public Gtk::EventBox
118 {
119 public:
120  FoldbackStrip (Mixer_UI&, ARDOUR::Session*, std::shared_ptr<ARDOUR::Route>);
122 
123  std::string name () const;
124 
126 
127  void fast_update ();
128  void set_route (std::shared_ptr<ARDOUR::Route>);
130 
132  {
133  return _panners;
134  }
135 
136  std::shared_ptr<ARDOUR::Stripable> stripable () const
137  {
138  return RouteUI::stripable ();
139  }
140 
142  PBD::Signal<void(std::weak_ptr<ARDOUR::Delivery> )> DeliveryChanged;
143 
145 
147 
149 
150 protected:
153 
154 private:
155  void init ();
158 
161 
162  void hide_clicked ();
163  void cycle_foldbacks (bool next);
168 
169  void clear_send_box ();
171  void name_changed ();
173  void connect_to_pan ();
178 
179  void spill_change (std::shared_ptr<ARDOUR::Stripable>);
182 
185 
188  uint32_t _width;
189 
201 
210 
212 };
213 
214 #endif
bool button_press(GdkEventButton *)
void send_state_changed()
void set_send_position(bool post)
bool button_release(GdkEventButton *)
void set_tooltip()
void set_gain(float new_gain)
std::shared_ptr< ARDOUR::Delivery > _send_del
Gtkmm2ext::PersistentTooltip _slider_persistant_tooltip
std::shared_ptr< ARDOUR::Send > _send
FoldbackSend(std::shared_ptr< ARDOUR::Send >, std::shared_ptr< ARDOUR::Route > sr, std::shared_ptr< ARDOUR::Route > fr, uint32_t wd)
bool pan_knob_press(GdkEventButton *)
void level_adjusted()
void level_changed()
std::shared_ptr< ARDOUR::Processor > _send_proc
uint32_t _width
void remove_me()
void route_property_changed(const PBD::PropertyChange &)
ArdourWidgets::HSliderController _slider
ArdourWidgets::ArdourKnob _pan_control
void send_pan_changed()
PBD::ScopedConnectionList _connections
Gtk::Menu * build_send_menu()
Gtk::Adjustment _adjustment
ArdourWidgets::ArdourButton _button
void led_clicked(GdkEventButton *)
std::shared_ptr< ARDOUR::Route > _foldback_route
std::shared_ptr< ARDOUR::Route > _send_route
void name_changed()
bool _ignore_ui_adjustment
void update_panner_choices()
void update_send_box()
ArdourWidgets::FastMeter * _meter
Gtk::VBox _send_display
void name_changed()
void route_property_changed(const PBD::PropertyChange &)
Gtk::Menu * build_route_ops_menu()
void remove_current_fb()
bool name_button_button_press(GdkEventButton *)
void update_output_display()
Gtk::VBox _global_vpacker
void deselect_all_processors()
Gtk::Menu * build_route_select_menu()
IOButton _output_button
void set_button_names()
void create_sends(ARDOUR::Placement, bool)
std::shared_ptr< ARDOUR::Stripable > stripable() const
ArdourWidgets::ArdourButton _previous_button
void clear_send_box()
void hide_clicked()
void route_color_changed()
Gtk::EventBox _spacer
bool number_button_press(GdkEventButton *)
ArdourWidgets::ArdourButton _hide_button
ArdourWidgets::ArdourButton _number_label
bool send_scroller_press(GdkEventButton *)
void duplicate_current_fb()
Gtk::HBox _prev_next_box
static PBD::Signal< void(FoldbackStrip *)> CatchDeletion
ArdourWidgets::ArdourKnob _level_control
PBD::Signal< void(std::weak_ptr< ARDOUR::Delivery >)> DeliveryChanged
ProcessorSelection _pr_selection
PannerUI _panners
void cycle_foldbacks(bool next)
PluginSelector * plugin_selector()
bool fb_strip_enter_event(GdkEventCrossing *)
void io_changed_proxy()
Gtk::Frame _global_frame
void fast_update()
std::string name() const
ProcessorBox * _insert_box
PannerUI & panner_ui()
void create_selected_sends(ARDOUR::Placement, bool)
Gtk::ScrolledWindow _send_scroller
Gtk::HBox _level_box
void connect_to_pan()
void update_sensitivity()
ArdourWidgets::ArdourButton _next_button
void set_route(std::shared_ptr< ARDOUR::Route >)
void reset_strip_style()
ArdourWidgets::ArdourButton _comment_button
void route_active_changed()
Mixer_UI & _mixer
PBD::ScopedConnectionList _send_connections
void presentation_info_changed(PBD::PropertyChange const &)
ArdourWidgets::ArdourButton _name_button
FoldbackStrip(Mixer_UI &, ARDOUR::Session *, std::shared_ptr< ARDOUR::Route >)
void setup_comment_button()
void spill_change(std::shared_ptr< ARDOUR::Stripable >)
std::shared_ptr< ARDOUR::Stripable > stripable() const
Definition: Window.h:41
Definition: ardour_ui.h:188