initial check in of VBAP implementation (not coupled to any existing ardour objects...
[ardour.git] / libs / ardour / rb_effect.cc
index 99c60d224eab96a4ecd4baf0c6230e76cd61c059..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()
@@ -354,6 +355,16 @@ RBEffect::run (boost::shared_ptr<Region> r)
                                          stretch,
                                          shift);
                (*x)->set_master_sources (region->master_sources());
+               (*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: