diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-08-16 14:24:41 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-08-16 14:24:41 +0000 |
commit | f6951c92f04ed17ec98a2d1cd9bcf535ce6f037c (patch) | |
tree | 135769f8d8d18e6004fffd37671cc678f7ab3e2e /gtk2_ardour/region_view.cc | |
parent | 6a3ce666c6716ceb9378e508d6116f83c32957c7 (diff) |
attempt to fix deep confusion in GUI code about converting between musical and audio time (should have beneficial effects on #4257); change ghost note drawing when in MIDI note draw/add mode so that its start is aligned with the mouse cursor
git-svn-id: svn://localhost/ardour2/branches/3.0@9998 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/region_view.cc')
-rw-r--r-- | gtk2_ardour/region_view.cc | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/gtk2_ardour/region_view.cc b/gtk2_ardour/region_view.cc index 0302e8f345..df26452934 100644 --- a/gtk2_ardour/region_view.cc +++ b/gtk2_ardour/region_view.cc @@ -83,7 +83,8 @@ RegionView::RegionView (ArdourCanvas::Group* parent, , in_destructor(false) , wait_for_data(false) , _silence_text (0) - , _time_converter(r->session().tempo_map(), r->position()) + , _region_relative_time_converter(r->session().tempo_map(), r->position()) + , _source_relative_time_converter(r->session().tempo_map(), r->position() - r->start()) { GhostRegion::CatchDeletion.connect (*this, invalidator (*this), ui_bind (&RegionView::remove_ghost, this, _1), gui_context()); } @@ -92,7 +93,8 @@ RegionView::RegionView (const RegionView& other) : sigc::trackable(other) , TimeAxisViewItem (other) , _silence_text (0) - , _time_converter(other._time_converter) + , _region_relative_time_converter(other.region_relative_time_converter()) + , _source_relative_time_converter(other.source_relative_time_converter()) { /* derived concrete type will call init () */ @@ -108,7 +110,8 @@ RegionView::RegionView (const RegionView& other, boost::shared_ptr<Region> other : sigc::trackable(other) , TimeAxisViewItem (other) , _silence_text (0) - , _time_converter(other._time_converter) + , _region_relative_time_converter(other_region->session().tempo_map(), other_region->position()) + , _source_relative_time_converter(other_region->session().tempo_map(), other_region->position() - other_region->start()) { /* this is a pseudo-copy constructor used when dragging regions around on the canvas. @@ -143,7 +146,8 @@ RegionView::RegionView (ArdourCanvas::Group* parent, , in_destructor(false) , wait_for_data(false) , _silence_text (0) - , _time_converter(r->session().tempo_map(), r->position()) + , _region_relative_time_converter(r->session().tempo_map(), r->position()) + , _source_relative_time_converter(r->session().tempo_map(), r->position() - r->start()) { } @@ -400,7 +404,11 @@ RegionView::region_resized (const PropertyChange& what_changed) if (what_changed.contains (ARDOUR::Properties::position)) { set_position (_region->position(), 0); - _time_converter.set_origin_b (_region->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()); } PropertyChange s_and_l; |