diff options
author | Carl Hetherington <carl@carlh.net> | 2010-12-12 22:25:27 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-12-12 22:25:27 +0000 |
commit | a97d522a4fa5ea96a638a9ce54a056d77fbd0128 (patch) | |
tree | b8cd13b9ae2407bcd0aa863742ad04bf343d75db /gtk2_ardour/automation_region_view.cc | |
parent | 9a1f83923d637d4bc88c7ed2af09a89d4ae58050 (diff) |
Fix display of MIDI automation on regions with non-zero _start. Should fix #3504.
git-svn-id: svn://localhost/ardour2/branches/3.0@8257 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/automation_region_view.cc')
-rw-r--r-- | gtk2_ardour/automation_region_view.cc | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/gtk2_ardour/automation_region_view.cc b/gtk2_ardour/automation_region_view.cc index c556d01848..6f6f3e29dc 100644 --- a/gtk2_ardour/automation_region_view.cc +++ b/gtk2_ardour/automation_region_view.cc @@ -67,8 +67,6 @@ AutomationRegionView::init (Gdk::Color const & basic_color, bool /*wfd*/) set_height (trackview.current_height()); - _region->PropertyChanged.connect (*this, invalidator (*this), ui_bind (&RegionView::region_changed, this, _1), gui_context()); - set_colors (); _enable_display = true; @@ -88,6 +86,7 @@ AutomationRegionView::create_line (boost::shared_ptr<ARDOUR::AutomationList> lis _line->show(); _line->show_all_control_points(); _line->set_maximum_time (_region->length()); + _line->set_offset (_region->start ()); } bool @@ -203,10 +202,17 @@ AutomationRegionView::reset_width_dependent_items (double pixel_width) void AutomationRegionView::region_resized (const PBD::PropertyChange& what_changed) { - RegionView::region_resized(what_changed); + RegionView::region_resized (what_changed); - if (_line) { - _line->reset(); + if (!_line) { + return; + } + + if (what_changed.contains (ARDOUR::Properties::start)) { + _line->set_offset (_region->start ()); + } + + if (what_changed.contains (ARDOUR::Properties::length)) { _line->set_maximum_time (_region->length()); } } @@ -226,4 +232,3 @@ AutomationRegionView::exited() if (_line) _line->track_exited(); } - |