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
This commit is contained in:
parent
ed9d42c55d
commit
a4917c9831
@ -138,6 +138,7 @@ Filter::finish (boost::shared_ptr<Region> region, SourceList& nsrcs, string regi
|
||||
audio_r->set_fade_in (audio_region->fade_in ());
|
||||
audio_r->set_fade_out_active (audio_region->fade_out_active ());
|
||||
audio_r->set_fade_out (audio_region->fade_out ());
|
||||
*(audio_r->envelope()) = *(audio_region->envelope ());
|
||||
}
|
||||
results.push_back (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;
|
||||
|
Loading…
Reference in New Issue
Block a user