Don't strip suffixes twice from peakfile names, otherwise source names like fred...
[ardour.git] / libs / ardour / audio_region_importer.cc
index 19653f55c0a16a72a900c8a60b03b14dcfbf6746..2cade745f2d055f81df0a4e3d3d1dc7399d12e75 100644 (file)
@@ -127,7 +127,7 @@ string
 AudioRegionImporter::get_info () const
 {
        nframes_t length, position;
-       SMPTE::Time length_time, position_time;
+       Timecode::Time length_time, position_time;
        std::ostringstream oss;
 
        // Get sample positions
@@ -136,15 +136,15 @@ AudioRegionImporter::get_info () const
        std::istringstream iss_position(xml_region.property ("position")->value());
        iss_position >> position;
 
-       // Convert to smpte
-       session.sample_to_smpte(length, length_time, true, false);
-       session.sample_to_smpte(position, position_time, true, false);
+       // Convert to timecode
+       session.sample_to_timecode(length, length_time, true, false);
+       session.sample_to_timecode(position, position_time, true, false);
 
        // return info
        oss << _("Length: ") <<
-         smpte_to_string(length_time) <<
+         timecode_to_string(length_time) <<
          _("\nPosition: ") <<
-         smpte_to_string(position_time) <<
+         timecode_to_string(position_time) <<
          _("\nChannels: ") <<
          xml_region.property ("channels")->value();
 
@@ -176,8 +176,6 @@ AudioRegionImporter::_move ()
        if (broken()) {
                return;
        }
-
-       session.add_regions (region);
 }
 
 bool
@@ -209,7 +207,7 @@ AudioRegionImporter::parse_xml_region ()
                } else if (!prop.compare("name")) {
                        // rename region if necessary
                        name = (*it)->value();
-                       name = session.new_region_name (name);
+                       name = RegionFactory::new_region_name (name);
                        (*it)->set_value (name);
                        name_ok = true;
                } else {
@@ -252,7 +250,7 @@ AudioRegionImporter::parse_source_xml ()
                return false;
        }
 
-       channels = atoi (prop->value());
+       channels = atoi (prop->value().c_str());
        for (uint32_t i = 0; i < channels; ++i) {
                bool source_found = false;
 
@@ -266,7 +264,7 @@ AudioRegionImporter::parse_source_xml ()
                string source_id = prop->value();
 
                // Get source
-               for (XMLNodeList::const_iterator it = sources.begin(); it != sources.end(); it++) {
+               for (XMLNodeList::const_iterator it = sources.begin(); it != sources.end(); ++it) {
                        prop = (*it)->property ("id");
                        if (prop && !source_id.compare (prop->value())) {
                                source_path = source_dir;
@@ -358,7 +356,7 @@ AudioRegionImporter::prepare_sources ()
        session.import_audiofiles (status);
 
        // Add imported sources to handlers map
-       std::vector<Glib::ustring>::iterator file_it = status.paths.begin();
+       std::vector<string>::iterator file_it = status.paths.begin();
        for (SourceList::iterator source_it = status.sources.begin(); source_it != status.sources.end(); ++source_it) {
                if (*source_it) {
                        handler.add_source(*file_it, *source_it);