diff options
author | Carl Hetherington <carl@carlh.net> | 2010-04-26 00:23:40 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-04-26 00:23:40 +0000 |
commit | a4917c9831f42b68bce3414244c14300b92bbb76 (patch) | |
tree | ee1e913f19e0cbb6ee494e4ecea914d16693a36d /libs/ardour/rb_effect.cc | |
parent | ed9d42c55d4d8b40ed82470ddfe110355a9eca61 (diff) |
Preserve gain envelopes across filtering operations and stretch them across time stretches. Fixes #902.
git-svn-id: svn://localhost/ardour2/branches/3.0@6989 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/rb_effect.cc')
-rw-r--r-- | libs/ardour/rb_effect.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libs/ardour/rb_effect.cc b/libs/ardour/rb_effect.cc index 4cb77d1c58..60764c1220 100644 --- a/libs/ardour/rb_effect.cc +++ b/libs/ardour/rb_effect.cc @@ -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; |