From ddd162bdb050558f93222800ebd57d737f2c9e0d Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 24 Jan 2012 17:04:15 +0000 Subject: Make time stretch respect edit groups (#4615). git-svn-id: svn://localhost/ardour2/branches/3.0@11334 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/rb_effect.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'libs/ardour/rb_effect.cc') diff --git a/libs/ardour/rb_effect.cc b/libs/ardour/rb_effect.cc index e90149926c..d928377e25 100644 --- a/libs/ardour/rb_effect.cc +++ b/libs/ardour/rb_effect.cc @@ -29,6 +29,7 @@ #include "ardour/audiofilesource.h" #include "ardour/session.h" #include "ardour/audioregion.h" +#include "ardour/progress.h" #include "i18n.h" @@ -52,7 +53,7 @@ RBEffect::RBEffect (Session& s, TimeFXRequest& req) , tsr (req) { - tsr.progress = 0.0f; + } RBEffect::~RBEffect () @@ -60,7 +61,7 @@ RBEffect::~RBEffect () } int -RBEffect::run (boost::shared_ptr r, Progress*) +RBEffect::run (boost::shared_ptr r, Progress* progress) { boost::shared_ptr region = boost::dynamic_pointer_cast (r); @@ -160,7 +161,7 @@ RBEffect::run (boost::shared_ptr r, Progress*) (session.frame_rate(), channels, (RubberBandStretcher::Options) tsr.opts, stretch, shift); - tsr.progress = 0.0f; + progress->set_progress (0); tsr.done = false; stretcher.setExpectedInputDuration(read_duration); @@ -238,7 +239,7 @@ RBEffect::run (boost::shared_ptr r, Progress*) pos += this_read; done += this_read; - tsr.progress = ((float) done / read_duration) * 0.25; + progress->set_progress (((float) done / read_duration) * 0.25); stretcher.study(buffers, this_read, pos == read_duration); } @@ -279,7 +280,7 @@ RBEffect::run (boost::shared_ptr r, Progress*) pos += this_read; done += this_read; - tsr.progress = 0.25 + ((float) done / read_duration) * 0.75; + progress->set_progress (0.25 + ((float) done / read_duration) * 0.75); stretcher.process(buffers, this_read, pos == read_duration); -- cgit v1.2.3