1 /* 2 * Copyright (C) 2007-2014 David Robillard <d@drobilla.net> 3 * Copyright (C) 2008-2017 Paul Davis <paul@linuxaudiosystems.com> 4 * Copyright (C) 2009-2011 Carl Hetherington <carl@carlh.net> 5 * Copyright (C) 2017-2019 Robin Gareus <robin@gareus.org> 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation; either version 2 of the License, or 10 * (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License along 18 * with this program; if not, write to the Free Software Foundation, Inc., 19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 20 */ 21 22 #ifndef __ardour_automation_streamview_h__ 23 #define __ardour_automation_streamview_h__ 24 25 #include <list> 26 #include <cmath> 27 28 #include "ardour/location.h" 29 #include "enums.h" 30 #include "streamview.h" 31 #include "time_axis_view_item.h" 32 #include "route_time_axis.h" 33 #include "automation_controller.h" 34 35 namespace Gdk { 36 class Color; 37 } 38 39 class PublicEditor; 40 class Selectable; 41 class Selection; 42 class AutomationRegionView; 43 44 class AutomationStreamView : public StreamView 45 { 46 public: 47 AutomationStreamView (AutomationTimeAxisView& tv); 48 ~AutomationStreamView (); 49 50 void set_automation_state (ARDOUR::AutoState state); 51 ARDOUR::AutoState automation_state () const; 52 53 void redisplay_track (); 54 contents_height()55 inline double contents_height() const { 56 return (_trackview.current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 2); 57 } 58 59 bool has_automation () const; 60 61 void set_interpolation (ARDOUR::AutomationList::InterpolationStyle); 62 ARDOUR::AutomationList::InterpolationStyle interpolation () const; 63 64 void clear (); 65 66 void get_selectables (ARDOUR::samplepos_t, ARDOUR::samplepos_t, double, double, std::list<Selectable*> &, bool within = false); 67 void set_selected_points (PointSelection &); 68 69 std::list<boost::shared_ptr<AutomationLine> > get_lines () const; 70 71 bool paste (samplepos_t pos, 72 unsigned paste_count, 73 float times, 74 boost::shared_ptr<ARDOUR::AutomationList> list); 75 76 private: 77 void setup_rec_box (); 78 79 RegionView* add_region_view_internal (boost::shared_ptr<ARDOUR::Region>, bool wait_for_data, bool recording = false); 80 void display_region(AutomationRegionView* region_view); 81 82 void color_handler (); 83 84 AutomationTimeAxisView& _automation_view; 85 /** automation state that should be applied when this view gets its first RegionView */ 86 ARDOUR::AutoState _pending_automation_state; 87 }; 88 89 #endif /* __ardour_automation_streamview_h__ */ 90