initial check in of VBAP implementation (not coupled to any existing ardour objects...
[ardour.git] / libs / ardour / rb_effect.cc
index 4cb77d1c5822862e2ca95ea8d712075c02f8d5ba..e31cebe6021f3bbda6625a7151331956aca6ef6d 100644 (file)
@@ -60,7 +60,7 @@ RBEffect::~RBEffect ()
 }
 
 int
-RBEffect::run (boost::shared_ptr<Region> r)
+RBEffect::run (boost::shared_ptr<Region> r, Progress*)
 {
        boost::shared_ptr<AudioRegion> region = boost::dynamic_pointer_cast<AudioRegion> (r);
 
@@ -80,7 +80,8 @@ RBEffect::run (boost::shared_ptr<Region> r)
        string::size_type at;
        nframes_t pos = 0;
        int avail = 0;
-
+       boost::shared_ptr<AudioRegion> result;
+       
        cerr << "RBEffect: source region: position = " << region->position()
             << ", start = " << region->start()
             << ", length = " << region->length()
@@ -357,6 +358,15 @@ RBEffect::run (boost::shared_ptr<Region> r)
                (*x)->set_length( (*x)->length() * stretch, this);
        }
 
+       /* stretch region gain envelope */
+       /* XXX: assuming we've only processed one input region into one result here */
+
+       if (tsr.time_fraction != 1) {
+               result = boost::dynamic_pointer_cast<AudioRegion> (results.front());
+               assert (result);
+               result->envelope()->x_scale (tsr.time_fraction);
+       }
+
   out:
 
        delete [] gain_buffer;