diff --git a/libs/ardour/filter.cc b/libs/ardour/filter.cc index bc597fb87d..4b1dd78052 100644 --- a/libs/ardour/filter.cc +++ b/libs/ardour/filter.cc @@ -135,11 +135,13 @@ Filter::finish (boost::shared_ptr region, SourceList& nsrcs, string regi PropertyList plist (region->properties ()); - plist.add (Properties::start, std::numeric_limits::min()); + plist.add (Properties::start, std::numeric_limits::min()); plist.add (Properties::name, region_name); plist.add (Properties::whole_file, true); boost::shared_ptr r = RegionFactory::create (nsrcs, plist); + r->set_start (timepos_t(0)); + r->set_whole_file (true); results.push_back (r); return 0; diff --git a/libs/ardour/lua_api.cc b/libs/ardour/lua_api.cc index d46d6dc0c8..d53e59ce46 100644 --- a/libs/ardour/lua_api.cc +++ b/libs/ardour/lua_api.cc @@ -1227,16 +1227,22 @@ LuaAPI::Rubberband::finalize () std::string region_name = RegionFactory::new_region_name (_region->name ()); PropertyList plist (_region->properties ()); - plist.add (Properties::start, 0); - plist.add (Properties::length, _region->length_samples ()); + plist.add (Properties::start, std::numeric_limits::min()); plist.add (Properties::name, region_name); plist.add (Properties::whole_file, true); boost::shared_ptr r = RegionFactory::create (sl, plist); boost::shared_ptr ar = boost::dynamic_pointer_cast (r); - ar->set_ancestral_data (timepos_t (_read_start), timecnt_t (_read_len), _stretch_ratio, _pitch_ratio); - ar->set_length (ar->length ().scale (_stretch_ratio)); // XXX + ar->set_ancestral_data (timepos_t (_read_start), timecnt_t (_read_len, timepos_t (_read_start)), _stretch_ratio, _pitch_ratio); + ar->set_master_sources (_region->master_sources ()); + ar->set_start (timepos_t(0)); +#if 0 // TODO construct ratio_t from double + ar->set_length (ar->length ().scale (_stretch_ratio)); +#else + ar->set_length (timecnt_t (_stretch_ratio * ar->length_samples (), ar->position())); +#endif + ar->set_whole_file (true); if (_stretch_ratio != 1.0) { // TODO: apply mapping ar->envelope ()->x_scale (_stretch_ratio); diff --git a/libs/ardour/rb_effect.cc b/libs/ardour/rb_effect.cc index 87ce670bd4..428490b2d1 100644 --- a/libs/ardour/rb_effect.cc +++ b/libs/ardour/rb_effect.cc @@ -360,7 +360,8 @@ RBEffect::run (boost::shared_ptr r, Progress* progress) /* multiply the old (possibly previously stretched) region length by the extra * stretch this time around to get its new length. this is a non-music based edit atm. */ - (*x)->set_length (timecnt_t (tsr.time_fraction.to_double() * (*x)->length_samples (), (*x)->position())); + (*x)->set_length ((*x)->length ().scale (tsr.time_fraction)); + (*x)->set_whole_file (true); } /* stretch region gain envelope */ diff --git a/libs/ardour/st_stretch.cc b/libs/ardour/st_stretch.cc index 09c11bc80d..6e703a5b46 100644 --- a/libs/ardour/st_stretch.cc +++ b/libs/ardour/st_stretch.cc @@ -304,7 +304,8 @@ STStretch::run (boost::shared_ptr r, Progress* progress) /* multiply the old (possibly previously stretched) region length by the extra * stretch this time around to get its new length. this is a non-music based edit atm. */ - (*x)->set_length ((*x)->length () * tsr.time_fraction, 0); + (*x)->set_length ((*x)->length ().scale (tsr.time_fraction)); + (*x)->set_whole_file (true); } /* stretch region gain envelope */