remove all traces of "prolooks" and related classes
[ardour.git] / gtk2_ardour / monitor_section.h
1 /*
2     Copyright (C) 2010 Paul Davis
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
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 */
19
20 #include <gtkmm/box.h>
21 #include <gtkmm/table.h>
22
23 #include "gtkmm2ext/bindable_button.h"
24
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"
30 #include "route_ui.h"
31 #include "monitor_selector.h"
32
33 #include "plugin_selector.h"
34 #include "route_processor_selection.h"
35 #include "processor_box.h"
36
37 namespace Gtkmm2ext {
38         class TearOff;
39 }
40
41 class MonitorSection : public RouteUI
42 {
43         public:
44         MonitorSection (ARDOUR::Session*);
45         ~MonitorSection ();
46
47         void set_session (ARDOUR::Session*);
48
49         Gtkmm2ext::TearOff& tearoff() const { return *_tearoff; }
50
51         std::string state_id() const;
52
53         PluginSelector* plugin_selector() { return _plugin_selector; }
54
55         private:
56         Gtk::HBox hpacker;
57         Gtk::VBox vpacker;
58         Gtkmm2ext::TearOff* _tearoff;
59
60         Gtk::HBox  channel_table_packer;
61         Gtk::HBox  table_hpacker;
62         Gtk::HBox  master_packer;
63         Gtk::Table channel_table;
64         Gtk::Table channel_table_header;
65         Gtk::ScrolledWindow channel_table_scroller;
66         Gtk::Viewport channel_table_viewport;
67         Glib::RefPtr<Gtk::SizeGroup> channel_size_group;
68
69         struct ChannelButtonSet {
70                 ArdourButton cut;
71                 ArdourButton dim;
72                 ArdourButton solo;
73                 ArdourButton invert;
74
75                 ChannelButtonSet ();
76         };
77
78         typedef std::vector<ChannelButtonSet*> ChannelButtons;
79         ChannelButtons _channel_buttons;
80
81         ArdourKnob* gain_control;
82         ArdourKnob* dim_control;
83         ArdourKnob* solo_boost_control;
84         ArdourKnob* solo_cut_control;
85
86         ArdourDisplay*  gain_display;
87         ArdourDisplay*  dim_display;
88         ArdourDisplay*  solo_boost_display;
89         ArdourDisplay*  solo_cut_display;
90
91         std::list<boost::shared_ptr<ARDOUR::Bundle> > output_menu_bundles;
92         Gtk::Menu output_menu;
93         MonitorSelectorWindow *_output_selector;
94         ArdourButton* output_button;
95
96         void maybe_add_bundle_to_output_menu (boost::shared_ptr<ARDOUR::Bundle>, ARDOUR::BundleList const &);
97         void bundle_output_chosen (boost::shared_ptr<ARDOUR::Bundle>);
98         void update_output_display ();
99         void disconnect_output ();
100         void edit_output_configuration ();
101
102         void populate_buttons ();
103         void map_state ();
104
105         boost::shared_ptr<ARDOUR::MonitorProcessor> _monitor;
106         boost::shared_ptr<ARDOUR::Route> _route;
107
108         static Glib::RefPtr<Gtk::ActionGroup> monitor_actions;
109         void register_actions ();
110         void connect_actions ();
111
112         void cut_channel (uint32_t);
113         void dim_channel (uint32_t);
114         void solo_channel (uint32_t);
115         void invert_channel (uint32_t);
116         void dim_all ();
117         void cut_all ();
118         void mono ();
119         void toggle_exclusive_solo ();
120         void set_button_names () {}
121         void toggle_mute_overrides_solo ();
122         void dim_level_changed ();
123         void solo_boost_changed ();
124         void gain_value_changed ();
125         gint output_press (GdkEventButton *);
126         gint output_release (GdkEventButton *);
127
128         ArdourButton solo_in_place_button;
129         ArdourButton afl_button;
130         ArdourButton pfl_button;
131         Gtk::VBox    solo_model_box;
132
133         void solo_use_in_place ();
134         void solo_use_afl ();
135         void solo_use_pfl ();
136
137         ArdourButton cut_all_button;
138         ArdourButton dim_all_button;
139         ArdourButton mono_button;
140         ArdourButton rude_solo_button;
141         ArdourButton rude_iso_button;
142         ArdourButton rude_audition_button;
143         ArdourButton exclusive_solo_button;
144         ArdourButton solo_mute_override_button;
145         ArdourButton toggle_processorbox_button;
146
147         void do_blink (bool);
148         void solo_blink (bool);
149         void audition_blink (bool);
150         bool cancel_solo (GdkEventButton*);
151         bool cancel_isolate (GdkEventButton*);
152         bool cancel_audition (GdkEventButton*);
153         void update_solo_model ();
154         void parameter_changed (std::string);
155         void isolated_changed ();
156
157         PBD::ScopedConnection config_connection;
158         PBD::ScopedConnectionList control_connections;
159         PBD::ScopedConnection _output_changed_connection;
160
161         bool _inhibit_solo_model_update;
162
163         void assign_controllables ();
164
165         void port_connected_or_disconnected (boost::weak_ptr<ARDOUR::Port>, boost::weak_ptr<ARDOUR::Port>);
166
167         void update_processor_box ();
168
169         ProcessorBox* insert_box;
170         PluginSelector* _plugin_selector;
171         RouteProcessorSelection _rr_selection;
172         void help_count_processors (boost::weak_ptr<ARDOUR::Processor> p, uint32_t* cnt) const;
173         uint32_t count_processors ();
174
175         void processors_changed (ARDOUR::RouteProcessorChange);
176         Glib::RefPtr<Gtk::ToggleAction> proctoggle;
177         bool _ui_initialized;
178 };