#include "ardour/region_factory.h"
#include "ardour/session.h"
-#include "i18n.h"
+#include "pbd/i18n.h"
using namespace ARDOUR;
using namespace PBD;
RegionFactory::CompoundAssociations RegionFactory::_compound_associations;
boost::shared_ptr<Region>
-RegionFactory::create (boost::shared_ptr<const Region> region, bool announce, const int32_t& sub_num)
+RegionFactory::create (boost::shared_ptr<const Region> region, bool announce, const int32_t sub_num)
{
boost::shared_ptr<Region> ret;
boost::shared_ptr<const AudioRegion> ar;
if (ret) {
ret->set_name (new_region_name(ret->name()));
- if (ret->session().config.get_glue_new_regions_to_bars_and_beats ()) {
+ if (ret->session().config.get_glue_new_regions_to_bars_and_beats() && ret->position_lock_style() != MusicTime) {
ret->set_position_lock_style (MusicTime);
}
- ret->set_position (region->position());
+ ret->set_position (region->position(), sub_num);
/* pure copy constructor - no property list */
if (announce) {
if (ret) {
ret->apply_changes (plist);
- if (ret->session().config.get_glue_new_regions_to_bars_and_beats ()) {
+ if (ret->session().config.get_glue_new_regions_to_bars_and_beats() && ret->position_lock_style() != MusicTime) {
ret->set_position_lock_style (MusicTime);
}
}
boost::shared_ptr<Region>
-RegionFactory::create (boost::shared_ptr<Region> region, frameoffset_t offset, const PropertyList& plist, bool announce, const int32_t& sub_num)
+RegionFactory::create (boost::shared_ptr<Region> region, frameoffset_t offset, const PropertyList& plist, bool announce, const int32_t sub_num)
{
boost::shared_ptr<Region> ret;
boost::shared_ptr<const AudioRegion> other_a;
if (ret) {
ret->apply_changes (plist);
- if (ret->session().config.get_glue_new_regions_to_bars_and_beats ()) {
+ if (ret->session().config.get_glue_new_regions_to_bars_and_beats() && ret->position_lock_style() != MusicTime) {
ret->set_position_lock_style (MusicTime);
}
if (ret) {
ret->apply_changes (plist);
- if (ret->session().config.get_glue_new_regions_to_bars_and_beats ()) {
+ if (ret->session().config.get_glue_new_regions_to_bars_and_beats() && ret->position_lock_style() != MusicTime) {
ret->set_position_lock_style (MusicTime);
}
if (ret) {
ret->apply_changes (plist);
- if (ret->session().config.get_glue_new_regions_to_bars_and_beats ()) {
+ if (ret->session().config.get_glue_new_regions_to_bars_and_beats() && ret->position_lock_style() != MusicTime) {
ret->set_position_lock_style (MusicTime);
}