int n = 0;
int const N = audible.size ();
- for (AudioIntervalResult::const_iterator i = audible.begin(); i != audible.end(); ++i) {
+ for (AudioIntervalResult::const_iterator i = audible.begin(); i != audible.end(); ++i, ++n) {
PBD::PropertyList plist;
boost::shared_ptr<AudioRegion> copy;
copy->set_name (RegionFactory::new_region_name (region->name ()));
- framecnt_t const f = std::min (_fade_length, (i->second - i->first));
+ framecnt_t const f = std::min (_fade_length, (i->second - i->first) / 2);
- copy->set_fade_in_active (true);
- copy->set_fade_in (FadeLinear, f);
- copy->set_fade_out (FadeLinear, f);
+ if (f > 0) {
+ copy->set_fade_in_active (true);
+ copy->set_fade_out_active (true);
+ copy->set_fade_in (FadeLinear, f);
+ copy->set_fade_out (FadeLinear, f);
+ } else {
+ copy->set_fade_in_active (false);
+ copy->set_fade_out_active (false);
+ }
results.push_back (copy);
if (progress && (n <= N)) {