diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2008-01-18 19:58:34 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2008-01-18 19:58:34 +0000 |
commit | df1da084eddfb2f9b2016595649b435be43c15d3 (patch) | |
tree | c28f5b9bf75fb803a722a72949f3b68172dc5a0f /libs/ardour/rb_effect.cc | |
parent | 7356c65a2a35c8059d5132df7e9f149617952232 (diff) |
permit OSX native package without JACK; prevent excessive track name lengths from messing up JACK port names; splash screen tweaks for OS X; new region gain control operations ; work on AU plugin GUIs (totally incomplete); don't needlessly create prompters in a barcontroller (create on demand)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2938 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/rb_effect.cc')
-rw-r--r-- | libs/ardour/rb_effect.cc | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/libs/ardour/rb_effect.cc b/libs/ardour/rb_effect.cc index a8d22c13b3..f86248d44d 100644 --- a/libs/ardour/rb_effect.cc +++ b/libs/ardour/rb_effect.cc @@ -74,9 +74,12 @@ RBEffect::run (boost::shared_ptr<AudioRegion> region) nframes_t pos = 0; int avail = 0; + double this_time_fraction = tsr.time_fraction * region->stretch (); + double this_pitch_fraction = tsr.pitch_fraction * region->shift (); + RubberBandStretcher stretcher (session.frame_rate(), region->n_channels(), (RubberBandStretcher::Options) tsr.opts, - tsr.time_fraction, tsr.pitch_fraction); + this_time_fraction, this_pitch_fraction); stretcher.setExpectedInputDuration(region->length()); stretcher.setDebugLevel(1); @@ -91,14 +94,14 @@ RBEffect::run (boost::shared_ptr<AudioRegion> region) digits just to disambiguate close but not identical FX */ - if (tsr.time_fraction == 1.0) { - snprintf (suffix, sizeof (suffix), "@%d", (int) floor (tsr.pitch_fraction * 100.0f)); - } else if (tsr.pitch_fraction == 1.0) { - snprintf (suffix, sizeof (suffix), "@%d", (int) floor (tsr.time_fraction * 100.0f)); + if (this_time_fraction == 1.0) { + snprintf (suffix, sizeof (suffix), "@%d", (int) floor (this_pitch_fraction * 100.0f)); + } else if (this_pitch_fraction == 1.0) { + snprintf (suffix, sizeof (suffix), "@%d", (int) floor (this_time_fraction * 100.0f)); } else { snprintf (suffix, sizeof (suffix), "@%d-%d", - (int) floor (tsr.time_fraction * 100.0f), - (int) floor (tsr.pitch_fraction * 100.0f)); + (int) floor (this_time_fraction * 100.0f), + (int) floor (this_pitch_fraction * 100.0f)); } /* create new sources */ @@ -259,9 +262,8 @@ RBEffect::run (boost::shared_ptr<AudioRegion> region) nframes_t start; nframes_t length; - // note: tsr.time_fraction is a percentage of original length. 100 = no change, - // 50 is half as long, 200 is twice as long, etc. - + // note: this_time_fraction is a ratio of original length. 1.0 = no change, + // 0.5 is half as long, 2.0 is twice as long, etc. float stretch = (*x)->stretch() * (tsr.time_fraction/100.0); float shift = (*x)->shift() * tsr.pitch_fraction; |