From 1f3e5a89602124b5e977eef4647160f503c4ae4d Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 26 Sep 2006 00:44:08 +0000 Subject: [PATCH] version of a patch from Ben Loftis to correct how offset destructive tracks are drawn. audio playback is not correct in myt tests git-svn-id: svn://localhost/ardour2/trunk@929 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/audioregion.cc | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc index f5272821d1..9a5f5892e0 100644 --- a/libs/ardour/audioregion.cc +++ b/libs/ardour/audioregion.cc @@ -39,6 +39,7 @@ #include #include #include +#include #include "i18n.h" #include @@ -412,6 +413,10 @@ AudioRegion::get_memento() const bool AudioRegion::verify_length (jack_nframes_t len) { + if (boost::dynamic_pointer_cast(source())) { + return true; + } + for (uint32_t n=0; n < sources.size(); ++n) { if (_start > sources[n]->length() - len) { return false; @@ -423,6 +428,10 @@ AudioRegion::verify_length (jack_nframes_t len) bool AudioRegion::verify_start_and_length (jack_nframes_t new_start, jack_nframes_t new_length) { + if (boost::dynamic_pointer_cast(source())) { + return true; + } + for (uint32_t n=0; n < sources.size(); ++n) { if (new_length > sources[n]->length() - new_start) { return false; @@ -433,6 +442,10 @@ AudioRegion::verify_start_and_length (jack_nframes_t new_start, jack_nframes_t n bool AudioRegion::verify_start (jack_nframes_t pos) { + if (boost::dynamic_pointer_cast(source())) { + return true; + } + for (uint32_t n=0; n < sources.size(); ++n) { if (pos > sources[n]->length() - _length) { return false; @@ -444,6 +457,10 @@ AudioRegion::verify_start (jack_nframes_t pos) bool AudioRegion::verify_start_mutable (jack_nframes_t& new_start) { + if (boost::dynamic_pointer_cast(source())) { + return true; + } + for (uint32_t n=0; n < sources.size(); ++n) { if (new_start > sources[n]->length() - _length) { new_start = sources[n]->length() - _length; @@ -1375,7 +1392,12 @@ AudioRegion::speed_mismatch (float sr) const void AudioRegion::source_offset_changed () { - set_position (source()->natural_position() + start(), this); + if (boost::dynamic_pointer_cast (source())) { + set_start (source()->natural_position(), this); + set_position (source()->natural_position(), this); + } else { + set_position (source()->natural_position() + start(), this); + } } extern "C" {