Allow strips to add or remove personal sends
[ardour.git] / gtk2_ardour / vca_master_strip.h
1 /*
2     Copyright (C) 2016 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 #ifndef __ardour_vca_master_strip__
20 #define __ardour_vca_master_strip__
21
22 #include <boost/shared_ptr.hpp>
23
24 #include <gtkmm/box.h>
25 #include <gtkmm/colorselection.h>
26 #include <gtkmm/menuitem.h>
27 #include <gtkmm/messagedialog.h>
28
29 #include "widgets/ardour_button.h"
30
31 #include "axis_view.h"
32 #include "control_slave_ui.h"
33 #include "gain_meter.h"
34 #include "stripable_colorpicker.h"
35
36 namespace ARDOUR {
37         class GainControl;
38         class VCA;
39 }
40
41 class FloatingTextEntry;
42
43 class VCAMasterStrip : public AxisView, public Gtk::EventBox
44 {
45 public:
46         VCAMasterStrip (ARDOUR::Session*, boost::shared_ptr<ARDOUR::VCA>);
47         ~VCAMasterStrip ();
48
49         boost::shared_ptr<ARDOUR::Stripable> stripable() const;
50         ARDOUR::PresentationInfo const & presentation_info () const;
51
52         std::string name() const;
53         Gdk::Color color () const;
54         std::string state_id() const;
55         boost::shared_ptr<ARDOUR::VCA> vca() const { return _vca; }
56
57         static PBD::Signal1<void,VCAMasterStrip*> CatchDeletion;
58
59         bool marked_for_display () const;
60         bool set_marked_for_display (bool);
61
62 private:
63         boost::shared_ptr<ARDOUR::VCA> _vca;
64         GainMeter    gain_meter;
65
66         Gtk::Frame                  global_frame;
67         Gtk::VBox                   global_vpacker;
68         Gtk::HBox                   bottom_padding;
69         Gtk::HBox                   solo_mute_box;
70         ArdourWidgets::ArdourButton width_button;
71         ArdourWidgets::ArdourButton color_button;
72         ArdourWidgets::ArdourButton hide_button;
73         ArdourWidgets::ArdourButton number_label;
74         ArdourWidgets::ArdourButton solo_button;
75         ArdourWidgets::ArdourButton mute_button;
76         Gtk::Menu*                  context_menu;
77         Gtk::MessageDialog*         delete_dialog;
78         ArdourWidgets::ArdourButton vertical_button;
79         ControlSlaveUI              control_slave_ui;
80         PBD::ScopedConnectionList   vca_connections;
81
82         void spill ();
83         void spill_change (boost::shared_ptr<ARDOUR::Stripable>);
84         void hide_clicked();
85         bool width_button_pressed (GdkEventButton *);
86         void set_selected (bool);
87         bool solo_release (GdkEventButton*);
88         bool mute_release (GdkEventButton*);
89         void set_width (bool wide);
90         void set_solo_text ();
91         void solo_changed ();
92         void mute_changed ();
93         void unassign ();
94         void start_name_edit ();
95         void finish_name_edit (std::string, int);
96         bool vertical_button_press (GdkEventButton*);
97         bool number_button_press (GdkEventButton*);
98         void vca_property_changed (PBD::PropertyChange const & what_changed);
99         void update_vca_name ();
100         void build_context_menu ();
101         void hide_confirmation (int);
102         void self_delete ();
103         void remove ();
104         void drop_all_slaves ();
105         void assign_all_selected ();
106         void unassign_all_selected ();
107
108         void parameter_changed (std::string const& p);
109         void set_button_names ();
110         void update_bottom_padding ();
111
112         void start_color_edit ();
113         StripableColorDialog _color_picker;
114 };
115
116
117 #endif /* __ardour_vca_master_strip__ */