*/
+
+#ifdef WAF_BUILD
+#include "libardour-config.h"
+#endif
+
#include <cstdio>
#include <cstdlib>
#include <string>
#include <unistd.h>
#include <sys/stat.h>
#include <time.h>
+#include <stdint.h>
#include <sndfile.h>
#include <samplerate.h>
#include <boost/scoped_array.hpp>
#include <boost/shared_array.hpp>
-#include <pbd/basename.h>
-#include <pbd/convert.h>
-
-#include <evoral/SMF.hpp>
-
-#include <ardour/ardour.h>
-#include <ardour/session.h>
-#include <ardour/session_directory.h>
-#include <ardour/audio_diskstream.h>
-#include <ardour/audioengine.h>
-#include <ardour/sndfilesource.h>
-#include <ardour/sndfile_helpers.h>
-#include <ardour/audioregion.h>
-#include <ardour/region_factory.h>
-#include <ardour/source_factory.h>
-#include <ardour/resampled_source.h>
-#include <ardour/sndfileimportable.h>
-#include <ardour/analyser.h>
-#include <ardour/smf_source.h>
-#include <ardour/tempo.h>
+#include "pbd/basename.h"
+#include "pbd/convert.h"
+
+#include "evoral/SMF.hpp"
+
+#include "ardour/ardour.h"
+#include "ardour/session.h"
+#include "ardour/session_directory.h"
+#include "ardour/audio_diskstream.h"
+#include "ardour/audioengine.h"
+#include "ardour/sndfilesource.h"
+#include "ardour/sndfile_helpers.h"
+#include "ardour/audioregion.h"
+#include "ardour/region_factory.h"
+#include "ardour/source_factory.h"
+#include "ardour/resampled_source.h"
+#include "ardour/sndfileimportable.h"
+#include "ardour/analyser.h"
+#include "ardour/smf_source.h"
+#include "ardour/tempo.h"
#ifdef HAVE_COREAUDIO
#ifdef USE_COREAUDIO_FOR_FILE_IO
-#include <ardour/caimportable.h>
+#include "ardour/caimportable.h"
#endif
#endif
#include "i18n.h"
+using namespace std;
using namespace ARDOUR;
using namespace PBD;
-
static boost::shared_ptr<ImportableSource>
open_importable_source (const string& path, nframes_t samplerate, ARDOUR::SrcQuality quality)
{
status.progress += 0.01;
}
+ const nframes64_t pos = 0;
const double length_beats = ceil(t / (double)source->ppqn());
- smfs->update_length(0, smfs->time_converter().to(length_beats));
+ BeatsFramesConverter converter(smfs->session(), pos);
+ smfs->update_length(pos, converter.to(length_beats));
smfs->end_write();
if (status.cancel) {
frame_rate(), cnt, status.total);
write_audio_data_to_new_files (source.get(), status, newfiles);
} else if (smf_reader.get()) { // midi
- status.doing_what = string_compose(_("loading MIDI file %1"), *p);
+ status.doing_what = string_compose(_("Loading MIDI file %1"), *p);
write_midi_data_to_new_files (smf_reader.get(), status, newfiles);
}
}