2 Copyright (C) 2010 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.
20 #include <gtkmm/box.h>
21 #include <gtkmm/table.h>
22 #include <gtkmm/eventbox.h>
24 #include "gtkmm2ext/bindable_button.h"
25 #include "gtkmm2ext/bindings.h"
27 #include "ardour_button.h"
28 #include "ardour_knob.h"
29 #include "ardour_display.h"
30 #include "level_meter.h"
32 #include "monitor_selector.h"
34 #include "plugin_selector.h"
35 #include "processor_box.h"
36 #include "processor_selection.h"
42 class MonitorSection : public RouteUI, public Gtk::EventBox
45 MonitorSection (ARDOUR::Session*);
48 void set_session (ARDOUR::Session*);
50 Gtkmm2ext::TearOff& tearoff() const { return *_tearoff; }
52 std::string state_id() const;
54 PluginSelector* plugin_selector() { return _plugin_selector; }
59 Gtkmm2ext::TearOff* _tearoff;
61 Gtk::HBox channel_table_packer;
62 Gtk::HBox table_hpacker;
63 Gtk::HBox master_packer;
64 Gtk::Table channel_table_header;
65 Gtk::Table *channel_table;
66 Gtk::ScrolledWindow channel_table_scroller;
67 Gtk::Viewport channel_table_viewport;
68 Glib::RefPtr<Gtk::SizeGroup> channel_size_group;
70 struct ChannelButtonSet {
79 typedef std::vector<ChannelButtonSet*> ChannelButtons;
80 ChannelButtons _channel_buttons;
82 ArdourKnob* gain_control;
83 ArdourKnob* dim_control;
84 ArdourKnob* solo_boost_control;
85 ArdourKnob* solo_cut_control;
87 ArdourDisplay* gain_display;
88 ArdourDisplay* dim_display;
89 ArdourDisplay* solo_boost_display;
90 ArdourDisplay* solo_cut_display;
92 std::list<boost::shared_ptr<ARDOUR::Bundle> > output_menu_bundles;
93 Gtk::Menu output_menu;
94 MonitorSelectorWindow *_output_selector;
95 ArdourButton* output_button;
97 void maybe_add_bundle_to_output_menu (boost::shared_ptr<ARDOUR::Bundle>, ARDOUR::BundleList const &);
98 void bundle_output_chosen (boost::shared_ptr<ARDOUR::Bundle>);
99 void update_output_display ();
100 void disconnect_output ();
101 void edit_output_configuration ();
103 void populate_buttons ();
106 boost::shared_ptr<ARDOUR::MonitorProcessor> _monitor;
107 boost::shared_ptr<ARDOUR::Route> _route;
109 enum MonitorActions {
114 ToggleMuteOverridesSolo,
118 ToggleMonitorProcessorBox
121 enum ChannelActions {
128 static Glib::RefPtr<Gtk::ActionGroup> monitor_actions;
129 static void register_actions ();
131 static void action_proxy0 (enum MonitorActions);
132 static void action_proxy1 (enum ChannelActions, uint32_t);
134 void cut_channel (uint32_t);
135 void dim_channel (uint32_t);
136 void solo_channel (uint32_t);
137 void invert_channel (uint32_t);
141 void toggle_exclusive_solo ();
142 void set_button_names () {}
143 void toggle_mute_overrides_solo ();
144 void dim_level_changed ();
145 void solo_boost_changed ();
146 void gain_value_changed ();
147 gint output_press (GdkEventButton *);
148 gint output_release (GdkEventButton *);
150 ArdourButton solo_in_place_button;
151 ArdourButton afl_button;
152 ArdourButton pfl_button;
153 Gtk::VBox solo_model_box;
155 void solo_use_in_place ();
156 void solo_use_afl ();
157 void solo_use_pfl ();
159 ArdourButton cut_all_button;
160 ArdourButton dim_all_button;
161 ArdourButton mono_button;
162 ArdourButton rude_solo_button;
163 ArdourButton rude_iso_button;
164 ArdourButton rude_audition_button;
165 ArdourButton exclusive_solo_button;
166 ArdourButton solo_mute_override_button;
167 ArdourButton toggle_processorbox_button;
169 void do_blink (bool);
170 void solo_blink (bool);
171 void audition_blink (bool);
172 bool cancel_solo (GdkEventButton*);
173 bool cancel_isolate (GdkEventButton*);
174 bool cancel_audition (GdkEventButton*);
175 void update_solo_model ();
176 void parameter_changed (std::string);
177 void isolated_changed ();
179 PBD::ScopedConnection config_connection;
180 PBD::ScopedConnectionList control_connections;
181 PBD::ScopedConnectionList output_changed_connections;
183 bool _inhibit_solo_model_update;
185 void assign_controllables ();
187 void port_connected_or_disconnected (boost::weak_ptr<ARDOUR::Port>, boost::weak_ptr<ARDOUR::Port>);
189 void update_processor_box ();
191 void route_property_changed (const PBD::PropertyChange&) {}
193 ProcessorBox* insert_box;
194 PluginSelector* _plugin_selector;
195 ProcessorSelection _rr_selection;
196 void help_count_processors (boost::weak_ptr<ARDOUR::Processor> p, uint32_t* cnt) const;
197 uint32_t count_processors ();
199 void processors_changed (ARDOUR::RouteProcessorChange);
200 Glib::RefPtr<Gtk::Action> proctoggle;
201 bool _ui_initialized;
203 static Gtkmm2ext::ActionMap myactions;
204 static Gtkmm2ext::Bindings* bindings;
206 static void load_bindings ();
207 bool enter_handler (GdkEventCrossing*);
208 bool leave_handler (GdkEventCrossing*);