diff options
author | David Robillard <d@drobilla.net> | 2014-11-20 17:36:09 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-11-22 00:46:15 -0500 |
commit | 41a9060df9a5261ea7c9ca848ebdd5854d40fd86 (patch) | |
tree | ad55a29d3868368033048effd02a5e9c68e89b26 /gtk2_ardour/automation_region_view.cc | |
parent | 2966dd4a9fa7c293f9a2dade9d0b7899ef10a68d (diff) |
Move time converters only to the region views that actually need them.
A step towards sorting out time issues more solidly, the time situation of MIDI
region views and automation region views is slightly different.
Diffstat (limited to 'gtk2_ardour/automation_region_view.cc')
-rw-r--r-- | gtk2_ardour/automation_region_view.cc | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/gtk2_ardour/automation_region_view.cc b/gtk2_ardour/automation_region_view.cc index ab13a99c16..f7c2b6b642 100644 --- a/gtk2_ardour/automation_region_view.cc +++ b/gtk2_ardour/automation_region_view.cc @@ -39,14 +39,16 @@ #include "i18n.h" -AutomationRegionView::AutomationRegionView (ArdourCanvas::Container* parent, - AutomationTimeAxisView& time_axis, - boost::shared_ptr<ARDOUR::Region> region, - const Evoral::Parameter& param, - boost::shared_ptr<ARDOUR::AutomationList> list, - double spu, - uint32_t basic_color) +AutomationRegionView::AutomationRegionView (ArdourCanvas::Container* parent, + AutomationTimeAxisView& time_axis, + boost::shared_ptr<ARDOUR::Region> region, + const Evoral::Parameter& param, + boost::shared_ptr<ARDOUR::AutomationList> list, + double spu, + uint32_t basic_color) : RegionView(parent, time_axis, region, spu, basic_color, true) + , _region_relative_time_converter(region->session().tempo_map(), region->position()) + , _source_relative_time_converter(region->session().tempo_map(), region->position() - region->start()) , _parameter(param) { if (list) { @@ -251,6 +253,15 @@ AutomationRegionView::region_resized (const PBD::PropertyChange& what_changed) { RegionView::region_resized (what_changed); + if (what_changed.contains (ARDOUR::Properties::position)) { + _region_relative_time_converter.set_origin_b(_region->position()); + } + + if (what_changed.contains (ARDOUR::Properties::start) || + what_changed.contains (ARDOUR::Properties::position)) { + _source_relative_time_converter.set_origin_b (_region->position() - _region->start()); + } + if (!_line) { return; } |