Merging from trunk
[ardour.git] / gtk2_ardour / editor_audio_import.cc
index 184c1757f2c03dbc83253d8d50e54f1ab0c068c0..f3e2ee1cb29046bcff46ba32984ba668af326fe2 100644 (file)
 #include <ardour/session.h>
 #include <ardour/audioplaylist.h>
 #include <ardour/audioregion.h>
-#include <ardour/diskstream.h>
-#include <ardour/filesource.h>
-#include <ardour/externalsource.h>
+#include <ardour/audio_diskstream.h>
 #include <ardour/utils.h>
 #include <ardour/audio_track.h>
 #include <ardour/audioplaylist.h>
+#include <ardour/audiofilesource.h>
 
 #include "ardour_ui.h"
 #include "editor.h"
@@ -43,6 +42,7 @@
 
 using namespace std;
 using namespace ARDOUR;
+using namespace PBD;
 using namespace sigc;
 using namespace Gtk;
 using namespace Editing;
@@ -187,7 +187,7 @@ int
 Editor::embed_sndfile (Glib::ustring path, bool split, bool multiple_files, bool& check_sample_rate, ImportMode mode, 
                       AudioTrack* track, jack_nframes_t& pos, bool prompt)
 {
-       ExternalSource *source = 0; /* keep g++ quiet */
+       AudioFileSource *source = 0; /* keep g++ quiet */
        AudioRegion::SourceList sources;
        AudioRegion* region;
        string idspec;
@@ -203,7 +203,7 @@ Editor::embed_sndfile (Glib::ustring path, bool split, bool multiple_files, bool
        /* lets see if we can link it into the session */
        
        linked_path = session->sound_dir();
-       linked_path += PBD::basename (path);
+       linked_path += Glib::path_get_basename (path);
 
        if (link (path.c_str(), linked_path.c_str()) == 0) {
 
@@ -220,7 +220,7 @@ Editor::embed_sndfile (Glib::ustring path, bool split, bool multiple_files, bool
 
        string error_msg;
 
-       if (!ExternalSource::get_soundfile_info (path, finfo, error_msg)) {
+       if (!AudioFileSource::get_soundfile_info (path, finfo, error_msg)) {
                error << string_compose(_("Editor: cannot open file \"%1\", (%2)"), selection, error_msg ) << endmsg;
                return 0;
        }
@@ -267,7 +267,7 @@ Editor::embed_sndfile (Glib::ustring path, bool split, bool multiple_files, bool
                idspec += string_compose(":%1", n);
                
                try {
-                       source = ExternalSource::create (idspec.c_str());
+                       source = AudioFileSource::create (idspec.c_str());
                        sources.push_back(source);
                }