a-fluidsynth: implement LV2_BANKPATCH__notify
[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                   top_padding;
69         Gtk::HBox                   bottom_padding;
70         Gtk::HBox                   solo_mute_box;
71         ArdourWidgets::ArdourButton width_button;
72         ArdourWidgets::ArdourButton color_button;
73         ArdourWidgets::ArdourButton hide_button;
74         ArdourWidgets::ArdourButton number_label;
75         ArdourWidgets::ArdourButton solo_button;
76         ArdourWidgets::ArdourButton mute_button;
77         Gtk::Menu*                  context_menu;
78         Gtk::MessageDialog*         delete_dialog;
79         ArdourWidgets::ArdourButton vertical_button;
80         ControlSlaveUI              control_slave_ui;
81         PBD::ScopedConnectionList   vca_connections;
82
83         void spill ();
84         void spill_change (boost::shared_ptr<ARDOUR::Stripable>);
85         void hide_clicked();
86         bool width_button_pressed (GdkEventButton *);
87         void set_selected (bool);
88         bool solo_release (GdkEventButton*);
89         bool mute_release (GdkEventButton*);
90         void set_width (bool wide);
91         void set_solo_text ();
92         void solo_changed ();
93         void mute_changed ();
94         void unassign ();
95         void start_name_edit ();
96         void finish_name_edit (std::string, int);
97         bool vertical_button_press (GdkEventButton*);
98         bool number_button_press (GdkEventButton*);
99         void vca_property_changed (PBD::PropertyChange const & what_changed);
100         void update_vca_name ();
101         void build_context_menu ();
102         void hide_confirmation (int);
103         void self_delete ();
104         void remove ();
105         void drop_all_slaves ();
106         void assign_all_selected ();
107         void unassign_all_selected ();
108
109         void parameter_changed (std::string const& p);
110         void set_button_names ();
111         void update_bottom_padding ();
112
113         void start_color_edit ();
114         StripableColorDialog _color_picker;
115 };
116
117
118 #endif /* __ardour_vca_master_strip__ */