2 * Copyright (C) 2017 Robin Gareus <robin@gareus.org>
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 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.
19 #ifndef __ardour_stripable_time_axis_h__
20 #define __ardour_stripable_time_axis_h__
22 #include "automation_time_axis.h"
23 #include "time_axis_view.h"
25 class StripableTimeAxisView : public TimeAxisView
28 StripableTimeAxisView (PublicEditor&, ARDOUR::Session*, ArdourCanvas::Canvas& canvas);
29 virtual ~StripableTimeAxisView ();
31 void set_stripable (boost::shared_ptr<ARDOUR::Stripable>);
32 boost::shared_ptr<ARDOUR::Stripable> stripable() const { return _stripable; }
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);
38 virtual void create_automation_child (const Evoral::Parameter& param, bool show) = 0;
39 boost::shared_ptr<AutomationTimeAxisView> automation_child(Evoral::Parameter param);
41 void request_redraw ();
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);
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;
52 void automation_track_hidden (Evoral::Parameter param);
54 void update_gain_track_visibility ();
55 void update_trim_track_visibility ();
56 void update_mute_track_visibility ();
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);
62 boost::shared_ptr<ARDOUR::Stripable> _stripable;
64 boost::shared_ptr<AutomationTimeAxisView> gain_track;
65 boost::shared_ptr<AutomationTimeAxisView> trim_track;
66 boost::shared_ptr<AutomationTimeAxisView> mute_track;
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;
72 Gtk::CheckMenuItem* gain_automation_item;
73 Gtk::CheckMenuItem* trim_automation_item;
74 Gtk::CheckMenuItem* mute_automation_item;
76 AutomationTracks _automation_tracks;
78 ArdourCanvas::Canvas& parent_canvas;
82 #endif /* __ardour_stripable_time_axis_h__ */