From 59daffea1d78cb55b35fe19c135cc4ab472bd01d Mon Sep 17 00:00:00 2001 From: nick_m Date: Fri, 27 Jan 2017 00:41:17 +1100 Subject: rework snap snap now fills in a struct (MusicFrame) which contins a snapped frame along with a music divisor. this gives useful information wrt magnetic snap which may or may not have rounded to an exact musical position. region position may now be set musically (using quarter notes for now). this patch fixes several problems in the current code: - dragging a list of music-locked regions now maintains correct musical offsets within the list. - splitting regions using magnetic snap works correctly (#7192) - cut drag should now work correctly with magnetic snap. - musical length of split midi regions is no longer frame based. --- libs/ardour/audioregion.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libs/ardour/audioregion.cc') diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc index bf4c5c6910..7d8c003791 100644 --- a/libs/ardour/audioregion.cc +++ b/libs/ardour/audioregion.cc @@ -279,13 +279,13 @@ AudioRegion::AudioRegion (boost::shared_ptr other) assert (_sources.size() == _master_sources.size()); } -AudioRegion::AudioRegion (boost::shared_ptr other, framecnt_t offset, const int32_t sub_num) - : Region (other, offset, sub_num) +AudioRegion::AudioRegion (boost::shared_ptr other, MusicFrame offset) + : Region (other, offset) , AUDIOREGION_COPY_STATE (other) /* As far as I can see, the _envelope's times are relative to region position, and have nothing to do with sources (and hence _start). So when we copy the envelope, we just use the supplied offset. */ - , _envelope (Properties::envelope, boost::shared_ptr (new AutomationList (*other->_envelope.val(), offset, other->_length))) + , _envelope (Properties::envelope, boost::shared_ptr (new AutomationList (*other->_envelope.val(), offset.frame, other->_length))) , _automatable (other->session()) , _fade_in_suspended (0) , _fade_out_suspended (0) -- cgit v1.2.3