try not thinning when loading old-school automation lists
[ardour.git] / libs / ardour / audio_region_importer.cc
index adfe9076672a8f70f41a7cfcdb901ad63b299649..91c362d042e8602fba3bda807aa4c799c604fad1 100644 (file)
@@ -28,7 +28,6 @@
 
 #include "ardour/session.h"
 #include "ardour/region.h"
-#include "ardour/source_factory.h"
 #include "ardour/region_factory.h"
 #include "ardour/session_directory.h"
 
@@ -126,7 +125,7 @@ AudioRegionImporter::~AudioRegionImporter ()
 string
 AudioRegionImporter::get_info () const
 {
-       nframes_t length, position;
+       framecnt_t length, position;
        Timecode::Time length_time, position_time;
        std::ostringstream oss;
 
@@ -137,8 +136,8 @@ AudioRegionImporter::get_info () const
        iss_position >> position;
 
        // Convert to timecode
-       session.sample_to_timecode(length, length_time, false);
-       session.sample_to_timecode(position, position_time, false);
+       session.sample_to_timecode(length, length_time, true, false);
+       session.sample_to_timecode(position, position_time, true, false);
 
        // return info
        oss << _("Length: ") <<
@@ -317,7 +316,11 @@ AudioRegionImporter::prepare_region ()
        }
 
        // create region and update XML
-       region.push_back (RegionFactory::create (source_list, xml_region));
+       boost::shared_ptr<Region> r = RegionFactory::create (source_list, xml_region);
+       if (session.config.get_glue_new_regions_to_bars_and_beats ()) {
+               r->set_position_lock_style (MusicTime);
+       }
+       region.push_back (r);
        if (*region.begin()) {
                xml_region = (*region.begin())->get_state();
        } else {