#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"
using namespace std;
using namespace ARDOUR;
+using namespace PBD;
using namespace sigc;
using namespace Gtk;
using namespace Editing;
return;
}
- SoundFileOmega sfdb (_("Add existing audio to session"));
+ SoundFileOmega sfdb (_("Add existing audio to session"), session);
sfdb.set_mode (mode);
switch (sfdb.run()) {
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;
string linked_path;
SoundFileInfo finfo;
/* 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) {
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;
}
if (check_sample_rate && (finfo.samplerate != (int) session->frame_rate())) {
vector<string> choices;
- choices.push_back (_("Embed it anyway"));
-
if (multiple_files) {
+ choices.push_back (_("Cancel entire import"));
choices.push_back (_("Don't embed it"));
choices.push_back (_("Embed all without questions"));
- choices.push_back (_("Cancel entire import"));
} else {
choices.push_back (_("Cancel"));
}
+
+ choices.push_back (_("Embed it anyway"));
Gtkmm2ext::Choice rate_choice (
string_compose (_("%1\nThis audiofile's sample rate doesn't match the session sample rate!"), path),
choices, false);
switch (rate_choice.run()) {
- case 0: /* do it */
- break;
+ case 0: /* stop a multi-file import */
case 1: /* don't import this one */
return -1;
case 2: /* do it, and the rest without asking */
check_sample_rate = false;
break;
- case 3: /* stop a multi-file import */
+ case 3: /* do it */
+ break;
default:
return -2;
}
idspec += string_compose(":%1", n);
try {
- source = ExternalSource::create (idspec.c_str());
+ source = AudioFileSource::create (idspec.c_str());
sources.push_back(source);
}
region_name = PBD::basename_nosuffix (path);
region_name += "-0";
- AudioRegion* region = new AudioRegion (sources, 0, sources[0]->length(), region_name, 0,
- Region::Flag (Region::DefaultFlags|Region::WholeFile|Region::External));
+ region = new AudioRegion (sources, 0, sources[0]->length(), region_name, 0,
+ Region::Flag (Region::DefaultFlags|Region::WholeFile|Region::External));
input_chan = finfo.channels;