2 Copyright (C) 2016 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.
19 #include "pbd/convert.h"
21 #include "ardour/vca.h"
24 #include "vca_master_strip.h"
28 using namespace ARDOUR;
29 using namespace ARDOUR_UI_UTILS;
30 using namespace Gtkmm2ext;
33 VCAMasterStrip::VCAMasterStrip (Session* s, boost::shared_ptr<VCA> v)
38 gain_meter.set_controls (boost::shared_ptr<Route>(),
39 boost::shared_ptr<PeakMeter>(),
40 boost::shared_ptr<Amp>(),
43 hide_button.set_icon (ArdourIcon::CloseCross);
44 set_tooltip (&hide_button, _("Hide this VCA strip"));
46 width_button.set_icon (ArdourIcon::StripWidth);
47 set_tooltip (width_button, _("Click to toggle the width of this VCA strip."));
49 width_button.signal_button_press_event().connect (sigc::mem_fun(*this, &VCAMasterStrip::width_button_pressed), false);
50 hide_button.signal_clicked.connect (sigc::mem_fun(*this, &VCAMasterStrip::hide_clicked));
52 width_hide_box.set_spacing (2);
53 width_hide_box.pack_start (width_button, false, true);
54 width_hide_box.pack_start (number_label, true, true);
55 width_hide_box.pack_end (hide_button, false, true);
57 number_label.set_text (PBD::to_string (v->number(), std::dec));
58 number_label.set_elements((ArdourButton::Element)(ArdourButton::Edge|ArdourButton::Body|ArdourButton::Text|ArdourButton::Inactive));
59 number_label.set_no_show_all ();
60 number_label.set_name ("tracknumber label");
61 number_label.set_fixed_colors (0x80808080, 0x80808080);
62 number_label.set_alignment (.5, .5);
63 number_label.set_fallthrough_to_parent (true);
65 name_button.set_text (_vca->name());
66 active_button.set_text ("active");
68 top_padding.set_size_request (-1, 16); /* must match height in GroupTabs::set_size_request() */
69 bottom_padding.set_size_request (-1, 50); /* this one is a hack. there's no trivial way to compute it */
71 global_vpacker.set_border_width (1);
72 global_vpacker.set_spacing (0);
74 global_vpacker.pack_start (top_padding, false, false);
75 global_vpacker.pack_start (width_hide_box, false, false);
76 global_vpacker.pack_start (active_button, false, false);
77 global_vpacker.pack_start (name_button, false, false);
78 global_vpacker.pack_start (vertical_padding, true, true);
79 global_vpacker.pack_start (gain_meter, false, false);
80 global_vpacker.pack_start (bottom_padding, false, false);
82 global_frame.add (global_vpacker);
83 global_frame.set_shadow_type (Gtk::SHADOW_IN);
84 global_frame.set_name ("BaseFrame");
88 global_vpacker.show ();
91 bottom_padding.show ();
92 vertical_padding.show ();
93 width_hide_box.show_all ();
94 active_button.show_all ();
95 name_button.show_all ();
96 gain_meter.show_all ();
98 /* force setting of visible selected status */
101 set_selected (false);
105 VCAMasterStrip::name() const
111 VCAMasterStrip::hide_clicked ()
116 VCAMasterStrip::width_button_pressed (GdkEventButton* ev)
122 VCAMasterStrip::set_selected (bool yn)
124 AxisView::set_selected (yn);
127 global_frame.set_shadow_type (Gtk::SHADOW_ETCHED_OUT);
128 global_frame.set_name ("MixerStripSelectedFrame");
130 global_frame.set_shadow_type (Gtk::SHADOW_IN);
131 global_frame.set_name ("MixerStripFrame");
134 global_frame.queue_draw ();