summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2012-01-24 17:04:15 +0000
committerCarl Hetherington <carl@carlh.net>2012-01-24 17:04:15 +0000
commitddd162bdb050558f93222800ebd57d737f2c9e0d (patch)
tree6b2f9e0f9a5f7f9c4aa9f9d44163e8aabe59980a /libs
parentf3624c18748f2a07d6be16558ce069e6f1366569 (diff)
Make time stretch respect edit groups (#4615).
git-svn-id: svn://localhost/ardour2/branches/3.0@11334 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/ardour/pitch.h2
-rw-r--r--libs/ardour/rb_effect.cc11
-rw-r--r--libs/ardour/st_pitch.cc3
-rw-r--r--libs/ardour/st_stretch.cc7
4 files changed, 11 insertions, 12 deletions
diff --git a/libs/ardour/ardour/pitch.h b/libs/ardour/ardour/pitch.h
index 8c7718f685..3bb179127e 100644
--- a/libs/ardour/ardour/pitch.h
+++ b/libs/ardour/ardour/pitch.h
@@ -53,7 +53,7 @@ class Pitch : public Filter {
Pitch (ARDOUR::Session&, TimeFXRequest&);
~Pitch () {}
- int run (boost::shared_ptr<ARDOUR::Region>);
+ int run (boost::shared_ptr<ARDOUR::Region>, Progress *);
private:
TimeFXRequest& tsr;
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<Region> r, Progress*)
+RBEffect::run (boost::shared_ptr<Region> r, Progress* progress)
{
boost::shared_ptr<AudioRegion> region = boost::dynamic_pointer_cast<AudioRegion> (r);
@@ -160,7 +161,7 @@ RBEffect::run (boost::shared_ptr<Region> 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<Region> 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<Region> 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);
diff --git a/libs/ardour/st_pitch.cc b/libs/ardour/st_pitch.cc
index 307a41cbf7..8e65ea2b56 100644
--- a/libs/ardour/st_pitch.cc
+++ b/libs/ardour/st_pitch.cc
@@ -39,13 +39,12 @@ Pitch::Pitch (Session& s, TimeFXRequest& req)
, tsr (req)
{
- tsr.progress = 0.0f;
+
}
int
Pitch::run (boost::shared_ptr<Region> region)
{
- tsr.progress = 1.0f;
tsr.done = true;
return 1;
diff --git a/libs/ardour/st_stretch.cc b/libs/ardour/st_stretch.cc
index 3660ff34d3..d8009c1218 100644
--- a/libs/ardour/st_stretch.cc
+++ b/libs/ardour/st_stretch.cc
@@ -56,7 +56,6 @@ STStretch::STStretch (Session& s, TimeFXRequest& req)
st.setSetting(SETTING_USE_QUICKSEEK, tsr.quick_seek);
st.setSetting(SETTING_USE_AA_FILTER, tsr.antialias);
- tsr.progress = 0.0f;
}
STStretch::~STStretch ()
@@ -64,7 +63,7 @@ STStretch::~STStretch ()
}
int
-STStretch::run (boost::shared_ptr<Region> a_region)
+STStretch::run (boost::shared_ptr<Region> a_region, Progress* progress)
{
SourceList nsrcs;
framecnt_t total_frames;
@@ -77,7 +76,7 @@ STStretch::run (boost::shared_ptr<Region> a_region)
string new_name;
string::size_type at;
- tsr.progress = 0.0f;
+ progress->set_progress (0);
tsr.done = false;
boost::shared_ptr<AudioRegion> region = boost::dynamic_pointer_cast<AudioRegion>(a_region);
@@ -131,7 +130,7 @@ STStretch::run (boost::shared_ptr<Region> a_region)
pos += this_read;
done += this_read;
- tsr.progress = (float) done / total_frames;
+ progress->set_progress ((float) done / total_frames);
st.putSamples (buffer, this_read);