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 "route_processor_selection.h"
36 #include "processor_box.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;
65 Gtk::Table channel_table_header;
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 static Glib::RefPtr<Gtk::ActionGroup> monitor_actions;
110 void register_actions ();
111 void connect_actions ();
113 void cut_channel (uint32_t);
114 void dim_channel (uint32_t);
115 void solo_channel (uint32_t);
116 void invert_channel (uint32_t);
120 void toggle_exclusive_solo ();
121 void set_button_names () {}
122 void toggle_mute_overrides_solo ();
123 void dim_level_changed ();
124 void solo_boost_changed ();
125 void gain_value_changed ();
126 gint output_press (GdkEventButton *);
127 gint output_release (GdkEventButton *);
129 ArdourButton solo_in_place_button;
130 ArdourButton afl_button;
131 ArdourButton pfl_button;
132 Gtk::VBox solo_model_box;
134 void solo_use_in_place ();
135 void solo_use_afl ();
136 void solo_use_pfl ();
138 ArdourButton cut_all_button;
139 ArdourButton dim_all_button;
140 ArdourButton mono_button;
141 ArdourButton rude_solo_button;
142 ArdourButton rude_iso_button;
143 ArdourButton rude_audition_button;
144 ArdourButton exclusive_solo_button;
145 ArdourButton solo_mute_override_button;
146 ArdourButton toggle_processorbox_button;
148 void do_blink (bool);
149 void solo_blink (bool);
150 void audition_blink (bool);
151 bool cancel_solo (GdkEventButton*);
152 bool cancel_isolate (GdkEventButton*);
153 bool cancel_audition (GdkEventButton*);
154 void update_solo_model ();
155 void parameter_changed (std::string);
156 void isolated_changed ();
158 PBD::ScopedConnection config_connection;
159 PBD::ScopedConnectionList control_connections;
160 PBD::ScopedConnection _output_changed_connection;
162 bool _inhibit_solo_model_update;
164 void assign_controllables ();
166 void port_connected_or_disconnected (boost::weak_ptr<ARDOUR::Port>, boost::weak_ptr<ARDOUR::Port>);
168 void update_processor_box ();
170 void route_property_changed (const PBD::PropertyChange&) {}
172 ProcessorBox* insert_box;
173 PluginSelector* _plugin_selector;
174 RouteProcessorSelection _rr_selection;
175 void help_count_processors (boost::weak_ptr<ARDOUR::Processor> p, uint32_t* cnt) const;
176 uint32_t count_processors ();
178 void processors_changed (ARDOUR::RouteProcessorChange);
179 Glib::RefPtr<Gtk::Action> proctoggle;
180 bool _ui_initialized;
183 Gtkmm2ext::ActionMap myactions;
184 Gtkmm2ext::Bindings* bindings;
186 void load_bindings ();
187 bool enter_handler (GdkEventCrossing*);
188 bool leave_handler (GdkEventCrossing*);