summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2006-09-26 00:44:08 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2006-09-26 00:44:08 +0000
commit1f3e5a89602124b5e977eef4647160f503c4ae4d (patch)
tree36f82bbf38674f81acab39e4e27f49e6fac1a931
parentd8d238a6ecd242efe701b726f9aa887fe6079210 (diff)
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
-rw-r--r--libs/ardour/audioregion.cc24
1 files changed, 23 insertions, 1 deletions
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 <ardour/playlist.h>
#include <ardour/audiofilter.h>
#include <ardour/audiofilesource.h>
+#include <ardour/destructive_filesource.h>
#include "i18n.h"
#include <locale.h>
@@ -412,6 +413,10 @@ AudioRegion::get_memento() const
bool
AudioRegion::verify_length (jack_nframes_t len)
{
+ if (boost::dynamic_pointer_cast<DestructiveFileSource>(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<DestructiveFileSource>(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<DestructiveFileSource>(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<DestructiveFileSource>(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<DestructiveFileSource> (source())) {
+ set_start (source()->natural_position(), this);
+ set_position (source()->natural_position(), this);
+ } else {
+ set_position (source()->natural_position() + start(), this);
+ }
}
extern "C" {