Vkeybd: add a mod-wheel
[ardour.git] / gtk2_ardour / stripable_time_axis.h
1 /*
2  * Copyright (C) 2017 Robin Gareus <robin@gareus.org>
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 along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18
19 #ifndef __ardour_stripable_time_axis_h__
20 #define __ardour_stripable_time_axis_h__
21
22 #include "automation_time_axis.h"
23 #include "time_axis_view.h"
24
25 class StripableTimeAxisView : public TimeAxisView
26 {
27 public:
28         StripableTimeAxisView (PublicEditor&, ARDOUR::Session*, ArdourCanvas::Canvas& canvas);
29         virtual ~StripableTimeAxisView ();
30
31         void set_stripable (boost::shared_ptr<ARDOUR::Stripable>);
32         boost::shared_ptr<ARDOUR::Stripable> stripable() const { return _stripable; }
33
34         typedef std::map<Evoral::Parameter, boost::shared_ptr<AutomationTimeAxisView> > AutomationTracks;
35         const AutomationTracks& automation_tracks() const { return _automation_tracks; }
36         virtual Gtk::CheckMenuItem* automation_child_menu_item (Evoral::Parameter);
37
38         virtual void create_automation_child (const Evoral::Parameter& param, bool show) = 0;
39         boost::shared_ptr<AutomationTimeAxisView> automation_child(Evoral::Parameter param);
40
41         void request_redraw ();
42
43 protected:
44         void reset_samples_per_pixel ();
45         virtual void set_samples_per_pixel (double);
46         void add_automation_child(Evoral::Parameter param, boost::shared_ptr<AutomationTimeAxisView> track, bool show=true);
47
48         virtual void create_gain_automation_child (const Evoral::Parameter &, bool) = 0;
49         virtual void create_trim_automation_child (const Evoral::Parameter &, bool) = 0;
50         virtual void create_mute_automation_child (const Evoral::Parameter &, bool) = 0;
51
52         void automation_track_hidden (Evoral::Parameter param);
53
54         void update_gain_track_visibility ();
55         void update_trim_track_visibility ();
56         void update_mute_track_visibility ();
57
58         virtual void show_all_automation (bool apply_to_selection = false);
59         virtual void show_existing_automation (bool apply_to_selection = false);
60         virtual void hide_all_automation (bool apply_to_selection = false);
61
62         boost::shared_ptr<ARDOUR::Stripable> _stripable;
63
64         boost::shared_ptr<AutomationTimeAxisView> gain_track;
65         boost::shared_ptr<AutomationTimeAxisView> trim_track;
66         boost::shared_ptr<AutomationTimeAxisView> mute_track;
67
68         typedef std::map<Evoral::Parameter, Gtk::CheckMenuItem*> ParameterMenuMap;
69         /** parameter -> menu item map for the main automation menu */
70         ParameterMenuMap _main_automation_menu_map;
71
72         Gtk::CheckMenuItem* gain_automation_item;
73         Gtk::CheckMenuItem* trim_automation_item;
74         Gtk::CheckMenuItem* mute_automation_item;
75
76         AutomationTracks _automation_tracks;
77
78         ArdourCanvas::Canvas& parent_canvas;
79         bool                  no_redraw;
80 };
81
82 #endif /* __ardour_stripable_time_axis_h__ */