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>
23 #include "gtkmm2ext/bindable_button.h"
25 #include "ardour_button.h"
26 #include "ardour_knob.h"
27 #include "ardour_display.h"
28 #include "axis_view.h"
29 #include "level_meter.h"
31 #include "monitor_selector.h"
33 #include "plugin_selector.h"
34 #include "route_processor_selection.h"
35 #include "processor_box.h"
42 class VolumeController;
44 class MonitorSection : public RouteUI
47 MonitorSection (ARDOUR::Session*);
50 void set_session (ARDOUR::Session*);
52 Gtkmm2ext::TearOff& tearoff() const { return *_tearoff; }
54 std::string state_id() const;
56 PluginSelector* plugin_selector() { return _plugin_selector; }
61 Gtkmm2ext::TearOff* _tearoff;
63 Gtk::HBox channel_table_packer;
64 Gtk::HBox table_hpacker;
65 Gtk::HBox master_packer;
66 Gtk::Table channel_table;
67 Gtk::Table channel_table_header;
68 Gtk::ScrolledWindow channel_table_scroller;
69 Gtk::Viewport channel_table_viewport;
70 Glib::RefPtr<Gtk::SizeGroup> channel_size_group;
72 struct ChannelButtonSet {
81 typedef std::vector<ChannelButtonSet*> ChannelButtons;
82 ChannelButtons _channel_buttons;
84 ArdourKnob* gain_control;
85 ArdourKnob* dim_control;
86 ArdourKnob* solo_boost_control;
87 ArdourKnob* solo_cut_control;
89 ArdourDisplay* gain_display;
90 ArdourDisplay* dim_display;
91 ArdourDisplay* solo_boost_display;
92 ArdourDisplay* solo_cut_display;
94 std::list<boost::shared_ptr<ARDOUR::Bundle> > output_menu_bundles;
95 Gtk::Menu output_menu;
96 MonitorSelectorWindow *_output_selector;
97 ArdourButton* output_button;
99 void maybe_add_bundle_to_output_menu (boost::shared_ptr<ARDOUR::Bundle>, ARDOUR::BundleList const &);
100 void bundle_output_chosen (boost::shared_ptr<ARDOUR::Bundle>);
101 void update_output_display ();
102 void disconnect_output ();
103 void edit_output_configuration ();
105 void populate_buttons ();
108 boost::shared_ptr<ARDOUR::MonitorProcessor> _monitor;
109 boost::shared_ptr<ARDOUR::Route> _route;
111 static Glib::RefPtr<Gtk::ActionGroup> monitor_actions;
112 void register_actions ();
113 void connect_actions ();
115 void cut_channel (uint32_t);
116 void dim_channel (uint32_t);
117 void solo_channel (uint32_t);
118 void invert_channel (uint32_t);
122 void toggle_exclusive_solo ();
123 void set_button_names () {}
124 void toggle_mute_overrides_solo ();
125 void dim_level_changed ();
126 void solo_boost_changed ();
127 void gain_value_changed ();
128 gint output_press (GdkEventButton *);
129 gint output_release (GdkEventButton *);
131 ArdourButton solo_in_place_button;
132 ArdourButton afl_button;
133 ArdourButton pfl_button;
134 Gtk::VBox solo_model_box;
136 void solo_use_in_place ();
137 void solo_use_afl ();
138 void solo_use_pfl ();
140 ArdourButton cut_all_button;
141 ArdourButton dim_all_button;
142 ArdourButton mono_button;
143 ArdourButton rude_solo_button;
144 ArdourButton rude_iso_button;
145 ArdourButton rude_audition_button;
146 ArdourButton exclusive_solo_button;
147 ArdourButton solo_mute_override_button;
148 ArdourButton toggle_processorbox_button;
150 void do_blink (bool);
151 void solo_blink (bool);
152 void audition_blink (bool);
153 bool cancel_solo (GdkEventButton*);
154 bool cancel_isolate (GdkEventButton*);
155 bool cancel_audition (GdkEventButton*);
156 void update_solo_model ();
157 void parameter_changed (std::string);
158 void isolated_changed ();
160 PBD::ScopedConnection config_connection;
161 PBD::ScopedConnectionList control_connections;
162 PBD::ScopedConnection _output_changed_connection;
164 bool _inhibit_solo_model_update;
166 void assign_controllables ();
168 void port_connected_or_disconnected (boost::weak_ptr<ARDOUR::Port>, boost::weak_ptr<ARDOUR::Port>);
170 void update_processor_box ();
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::ToggleAction> proctoggle;
180 bool _ui_initialized;