2 * Copyright (C) 2010-2018 Paul Davis <paul@linuxaudiosystems.com>
3 * Copyright (C) 2011 Carl Hetherington <carl@carlh.net>
4 * Copyright (C) 2014-2015 Ben Loftis <ben@harrisonconsoles.com>
5 * Copyright (C) 2014-2019 Robin Gareus <robin@gareus.org>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #ifndef __gtk2_ardour_monitor_section_h__
23 #define __gtk2_ardour_monitor_section_h__
25 #include <gtkmm/box.h>
26 #include <gtkmm/eventbox.h>
27 #include <gtkmm/sizegroup.h>
28 #include <gtkmm/table.h>
29 #include <gtkmm/viewport.h>
31 #include "gtkmm2ext/bindings.h"
33 #include "widgets/ardour_button.h"
34 #include "widgets/ardour_knob.h"
35 #include "widgets/ardour_display.h"
37 #include "level_meter.h"
39 #include "monitor_selector.h"
41 #include "processor_box.h"
42 #include "processor_selection.h"
44 namespace ArdourWidgets {
50 class MonitorSection : public RouteUI, public Gtk::EventBox
56 void set_session (ARDOUR::Session*);
58 ArdourWidgets::TearOff& tearoff() const { return *_tearoff; }
60 std::string state_id() const;
62 PluginSelector* plugin_selector();
64 void use_others_actions ();
69 ArdourWidgets::TearOff* _tearoff;
71 Gtk::HBox channel_table_packer;
72 Gtk::HBox table_hpacker;
73 Gtk::HBox master_packer;
74 Gtk::Table channel_table_header;
75 Gtk::Table *channel_table;
76 Gtk::ScrolledWindow channel_table_scroller;
77 Gtk::Viewport channel_table_viewport;
78 Glib::RefPtr<Gtk::SizeGroup> channel_size_group;
80 struct ChannelButtonSet {
81 ArdourWidgets::ArdourButton cut;
82 ArdourWidgets::ArdourButton dim;
83 ArdourWidgets::ArdourButton solo;
84 ArdourWidgets::ArdourButton invert;
89 typedef std::vector<ChannelButtonSet*> ChannelButtons;
90 ChannelButtons _channel_buttons;
92 ArdourWidgets::ArdourKnob* gain_control;
93 ArdourWidgets::ArdourKnob* dim_control;
94 ArdourWidgets::ArdourKnob* solo_boost_control;
95 ArdourWidgets::ArdourKnob* solo_cut_control;
97 ArdourWidgets::ArdourDisplay* gain_display;
98 ArdourWidgets::ArdourDisplay* dim_display;
99 ArdourWidgets::ArdourDisplay* solo_boost_display;
100 ArdourWidgets::ArdourDisplay* solo_cut_display;
102 std::list<boost::shared_ptr<ARDOUR::Bundle> > output_menu_bundles;
103 Gtk::Menu output_menu;
104 MonitorSelectorWindow *_output_selector;
105 ArdourWidgets::ArdourButton* output_button;
107 void maybe_add_bundle_to_output_menu (boost::shared_ptr<ARDOUR::Bundle>, ARDOUR::BundleList const &);
108 void bundle_output_chosen (boost::shared_ptr<ARDOUR::Bundle>);
109 void update_output_display ();
110 void disconnect_output ();
111 void edit_output_configuration ();
113 void populate_buttons ();
116 boost::shared_ptr<ARDOUR::MonitorProcessor> _monitor;
118 Glib::RefPtr<Gtk::ActionGroup> monitor_actions;
119 Glib::RefPtr<Gtk::ActionGroup> solo_actions;
120 void register_actions ();
122 void cut_channel (uint32_t);
123 void dim_channel (uint32_t);
124 void solo_channel (uint32_t);
125 void invert_channel (uint32_t);
129 void toggle_exclusive_solo ();
130 void set_button_names () {}
131 void toggle_mute_overrides_solo ();
132 void dim_level_changed ();
133 void solo_boost_changed ();
134 void gain_value_changed ();
135 gint output_press (GdkEventButton *);
136 gint output_release (GdkEventButton *);
138 ArdourWidgets::ArdourButton solo_in_place_button;
139 ArdourWidgets::ArdourButton afl_button;
140 ArdourWidgets::ArdourButton pfl_button;
141 Gtk::VBox solo_model_box;
143 void solo_use_in_place ();
144 void solo_use_afl ();
145 void solo_use_pfl ();
147 ArdourWidgets::ArdourButton cut_all_button;
148 ArdourWidgets::ArdourButton dim_all_button;
149 ArdourWidgets::ArdourButton mono_button;
150 ArdourWidgets::ArdourButton rude_solo_button;
151 ArdourWidgets::ArdourButton rude_iso_button;
152 ArdourWidgets::ArdourButton rude_audition_button;
153 ArdourWidgets::ArdourButton exclusive_solo_button;
154 ArdourWidgets::ArdourButton solo_mute_override_button;
155 ArdourWidgets::ArdourButton toggle_processorbox_button;
157 void do_blink (bool);
158 void solo_blink (bool);
159 void audition_blink (bool);
160 bool cancel_solo (GdkEventButton*);
161 bool cancel_isolate (GdkEventButton*);
162 bool cancel_audition (GdkEventButton*);
163 void update_solo_model ();
164 void parameter_changed (std::string);
165 void isolated_changed ();
167 PBD::ScopedConnection config_connection;
168 PBD::ScopedConnectionList connections;
169 PBD::ScopedConnectionList route_connections;
171 bool _inhibit_solo_model_update;
173 void assign_controllables ();
174 void unassign_controllables ();
176 void port_connected_or_disconnected (boost::weak_ptr<ARDOUR::Port>, boost::weak_ptr<ARDOUR::Port>);
178 void update_processor_box ();
180 void route_property_changed (const PBD::PropertyChange&) {}
182 ProcessorBox* insert_box;
183 ProcessorSelection _rr_selection;
184 void help_count_processors (boost::weak_ptr<ARDOUR::Processor> p, uint32_t* cnt) const;
185 uint32_t count_processors ();
187 void processors_changed (ARDOUR::RouteProcessorChange);
188 Glib::RefPtr<Gtk::ToggleAction> proctoggle;
189 bool _ui_initialized;
191 Gtkmm2ext::Bindings* bindings;
193 void load_bindings ();
194 bool enter_handler (GdkEventCrossing*);
195 bool leave_handler (GdkEventCrossing*);
197 void toggle_use_monitor_section ();
201 #endif /* __gtk2_ardour_monitor_section_h__ */