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 "axis_view.h"
26 #include "level_meter.h"
34 class VolumeController
;
36 class MonitorSection
: public RouteUI
39 MonitorSection (ARDOUR::Session
*);
42 void set_session (ARDOUR::Session
*);
43 static void setup_knob_images ();
45 Gtkmm2ext::TearOff
& tearoff() const { return *_tearoff
; }
50 Gtk::Table main_table
;
51 Gtk::VBox upper_packer
;
52 Gtk::VBox lower_packer
;
53 Gtkmm2ext::TearOff
* _tearoff
;
55 struct ChannelButtonSet
{
56 BindableToggleButton cut
;
57 BindableToggleButton dim
;
58 BindableToggleButton solo
;
59 BindableToggleButton invert
;
64 typedef std::vector
<ChannelButtonSet
*> ChannelButtons
;
65 ChannelButtons _channel_buttons
;
67 Gtk::Adjustment gain_adjustment
;
68 VolumeController
* gain_control
;
69 Gtk::Adjustment dim_adjustment
;
70 VolumeController
* dim_control
;
71 Gtk::Adjustment solo_boost_adjustment
;
72 VolumeController
* solo_boost_control
;
73 Gtk::Adjustment solo_cut_adjustment
;
74 VolumeController
* solo_cut_control
;
76 void populate_buttons ();
77 void set_button_names ();
80 boost::shared_ptr
<ARDOUR::MonitorProcessor
> _monitor
;
81 boost::shared_ptr
<ARDOUR::Route
> _route
;
83 static Glib::RefPtr
<Gtk::ActionGroup
> monitor_actions
;
84 void register_actions ();
86 static Glib::RefPtr
<Gdk::Pixbuf
> big_knob_pixbuf
;
87 static Glib::RefPtr
<Gdk::Pixbuf
> little_knob_pixbuf
;
89 void cut_channel (uint32_t);
90 void dim_channel (uint32_t);
91 void solo_channel (uint32_t);
92 void invert_channel (uint32_t);
96 void toggle_exclusive_solo ();
97 void toggle_mute_overrides_solo ();
98 void dim_level_changed ();
99 void solo_boost_changed ();
100 void gain_value_changed ();
102 bool nonlinear_gain_printer (Gtk::SpinButton
*);
103 bool linear_gain_printer (Gtk::SpinButton
*);
105 Gtk::RadioButtonGroup solo_model_group
;
106 Gtk::RadioButton solo_in_place_button
;
107 Gtk::RadioButton afl_button
;
108 Gtk::RadioButton pfl_button
;
109 Gtk::HBox solo_model_box
;
111 void solo_use_in_place ();
112 void solo_use_afl ();
113 void solo_use_pfl ();
115 BindableToggleButton cut_all_button
;
116 BindableToggleButton dim_all_button
;
117 BindableToggleButton mono_button
;
118 BindableToggleButton rude_solo_button
;
119 BindableToggleButton rude_iso_button
;
120 BindableToggleButton rude_audition_button
;
121 BindableToggleButton exclusive_solo_button
;
122 BindableToggleButton solo_mute_override_button
;
124 void do_blink (bool);
125 void solo_blink (bool);
126 void audition_blink (bool);
127 bool cancel_solo (GdkEventButton
*);
128 bool cancel_isolate (GdkEventButton
*);
129 bool cancel_audition (GdkEventButton
*);
130 void update_solo_model ();
131 void parameter_changed (std::string
);
132 void isolated_changed ();
134 PBD::ScopedConnection config_connection
;
135 PBD::ScopedConnectionList control_connections
;
137 void assign_controllables ();