Replace use of PBD::sys::path in AudioRegionImporter

git-svn-id: svn://localhost/ardour2/branches/3.0@12830 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Tim Mayberry 2012-06-23 05:06:57 +00:00
parent 105caf23da
commit 33f63bd09c
2 changed files with 4 additions and 9 deletions

View file

@ -29,7 +29,6 @@
#include "pbd/xml++.h" #include "pbd/xml++.h"
#include "pbd/id.h" #include "pbd/id.h"
#include "pbd/filesystem.h"
#include "ardour/element_importer.h" #include "ardour/element_importer.h"
#include "ardour/element_import_handler.h" #include "ardour/element_import_handler.h"
#include "ardour/import_status.h" #include "ardour/import_status.h"
@ -100,7 +99,7 @@ class AudioRegionImporter : public ElementImporter
bool parse_xml_region (); bool parse_xml_region ();
bool parse_source_xml (); bool parse_source_xml ();
PBD::sys::path get_sound_dir (XMLTree const & tree); std::string get_sound_dir (XMLTree const & tree);
void prepare_region (); void prepare_region ();
void prepare_sources (); void prepare_sources ();

View file

@ -234,8 +234,7 @@ AudioRegionImporter::parse_source_xml ()
{ {
uint32_t channels; uint32_t channels;
char buf[128]; char buf[128];
PBD::sys::path source_dir = get_sound_dir (source); std::string source_dir(get_sound_dir (source));
PBD::sys::path source_path;
XMLNode * source_node; XMLNode * source_node;
XMLProperty *prop; XMLProperty *prop;
@ -268,15 +267,12 @@ AudioRegionImporter::parse_source_xml ()
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"); prop = (*it)->property ("id");
if (prop && !source_id.compare (prop->value())) { if (prop && !source_id.compare (prop->value())) {
source_path = source_dir;
prop = (*it)->property ("name"); prop = (*it)->property ("name");
if (!prop) { if (!prop) {
error << string_compose (X_("AudioRegionImporter (%1): source %2 has no \"name\" property"), name, source_id) << endmsg; error << string_compose (X_("AudioRegionImporter (%1): source %2 has no \"name\" property"), name, source_id) << endmsg;
return false; return false;
} }
source_path /= prop->value(); filenames.push_back (Glib::build_filename (source_dir, prop->value()));
filenames.push_back (source_path.to_string());
source_found = true; source_found = true;
break; break;
} }
@ -291,7 +287,7 @@ AudioRegionImporter::parse_source_xml ()
return true; return true;
} }
PBD::sys::path std::string
AudioRegionImporter::get_sound_dir (XMLTree const & tree) AudioRegionImporter::get_sound_dir (XMLTree const & tree)
{ {
SessionDirectory session_dir(Glib::path_get_dirname (tree.filename())); SessionDirectory session_dir(Glib::path_get_dirname (tree.filename()));