Work towards removal of Session's Diskstream list.
[ardour.git] / gtk2_ardour / editor_audio_import.cc
index ddb3bedbb49d370b128041b5ab6b5cbfc876ab7a..1dc3b8b5ef1f4da07700545e53dd25c3f7b898b5 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;
@@ -74,8 +74,7 @@ Editor::bring_in_external_audio (ImportMode mode, AudioTrack* track, jack_nframe
                return;
        }
 
-       SoundFileOmega sfdb (_("Add existing audio to session"));
-       sfdb.set_session (session);
+       SoundFileOmega sfdb (_("Add existing audio to session"), session);
        sfdb.set_mode (mode);
 
        switch (sfdb.run()) {
@@ -188,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;
@@ -204,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) {
 
@@ -221,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;
        }
@@ -268,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);
                } 
                
@@ -315,7 +314,7 @@ int
                
        case ImportToTrack:
                if (track) {
-                       Playlist* playlist  = track->disk_stream().playlist();
+                       Playlist* playlist  = track->diskstream().playlist();
                        
                        AudioRegion* copy = new AudioRegion (region);
                        begin_reversible_command (_("insert sndfile"));
@@ -331,7 +330,7 @@ int
        case ImportAsTrack:
                AudioTrack* at = session->new_audio_track (in_chans, out_chans);
                AudioRegion* copy = new AudioRegion (region);
-               at->disk_stream().playlist()->add_region (*copy, pos);
+               at->diskstream().playlist()->add_region (*copy, pos);
                break;
        }