OSC: Fix to make sure buses created with Ardour 4.7 sessions show up
[ardour.git] / gtk2_ardour / vca_time_axis.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
20 #ifndef __ardour_vca_time_axis_h__
21 #define __ardour_vca_time_axis_h__
22
23 #include "widgets/ardour_button.h"
24
25 #include "stripable_time_axis.h"
26 #include "gain_meter.h"
27
28 namespace ArdourCanvas {
29         class Canvas;
30 }
31
32 namespace ARDOUR {
33         class Session;
34         class VCA;
35 }
36
37 class VCATimeAxisView : public StripableTimeAxisView
38 {
39 public:
40         VCATimeAxisView (PublicEditor&, ARDOUR::Session*, ArdourCanvas::Canvas& canvas);
41         virtual ~VCATimeAxisView ();
42
43         boost::shared_ptr<ARDOUR::Stripable> stripable() const;
44         ARDOUR::PresentationInfo const & presentation_info () const;
45
46         void set_vca (boost::shared_ptr<ARDOUR::VCA>);
47         boost::shared_ptr<ARDOUR::VCA> vca() const { return _vca; }
48
49         std::string name() const;
50         Gdk::Color color () const;
51         std::string state_id() const;
52
53         void set_height (uint32_t h, TrackHeightMode m = OnlySelf);
54
55         bool selectable() const { return false; }
56         bool marked_for_display () const;
57         bool set_marked_for_display (bool);
58
59 protected:
60         boost::shared_ptr<ARDOUR::VCA> _vca;
61         ArdourWidgets::ArdourButton    solo_button;
62         ArdourWidgets::ArdourButton    mute_button;
63         ArdourWidgets::ArdourButton    automation_button;
64         ArdourWidgets::ArdourButton    drop_button;
65         ArdourWidgets::ArdourButton    number_label;
66         GainMeterBase                  gain_meter;
67         PBD::ScopedConnectionList      vca_connections;
68
69         void create_gain_automation_child (const Evoral::Parameter &, bool);
70         void create_trim_automation_child (const Evoral::Parameter &, bool) {}
71         void create_mute_automation_child (const Evoral::Parameter &, bool);
72
73         virtual void show_all_automation (bool apply_to_selection = false);
74         virtual void show_existing_automation (bool apply_to_selection = false);
75         virtual void hide_all_automation (bool apply_to_selection = false);
76
77         void create_automation_child (const Evoral::Parameter& param, bool show);
78         virtual void build_automation_action_menu (bool);
79         Gtk::Menu* automation_action_menu;
80
81         bool name_entry_changed (std::string const&);
82
83         void parameter_changed (std::string const& p);
84         void vca_property_changed (PBD::PropertyChange const&);
85         void update_vca_name ();
86         void set_button_names ();
87         void update_solo_display ();
88         void update_mute_display ();
89         void update_track_number_visibility ();
90         bool solo_release (GdkEventButton*);
91         bool mute_release (GdkEventButton*);
92         bool automation_click (GdkEventButton*);
93         bool drop_release (GdkEventButton*);
94         void self_delete ();
95 };
96
97 #endif /* __ardour_vca_time_axis_h__ */