13
0

Re-import exported files at the export-range's start time.

This commit is contained in:
Robin Gareus 2022-03-15 21:59:44 +01:00
parent 3ae73eb242
commit 22b81901b0
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 8 additions and 5 deletions

View File

@ -370,7 +370,7 @@ ExportDialog::do_export ()
_files_to_reimport.clear ();
Session::Exported.connect_same_thread (*this, sigc::bind (
[] (std::string, std::string fn, bool re, std::vector<std::string>* v) { if (re) { (*v).push_back (fn); } },
[] (std::string, std::string fn, bool re, samplepos_t pos, ReImportMap* v) { if (re) { (*v)[pos].push_back (fn); } },
&_files_to_reimport));
handler->do_export ();
@ -408,9 +408,11 @@ ExportDialog::show_progress ()
status->finish (TRS_UI);
if (!status->aborted() && !_files_to_reimport.empty ()) {
timepos_t pos (0);
for (auto const& x : _files_to_reimport) {
timepos_t pos (x.first);
Editing::ImportDisposition disposition = Editing::ImportDistinctFiles;
editor.do_import (_files_to_reimport, disposition, Editing::ImportAsTrack, SrcBest, SMFTrackNumber, SMFTempoIgnore, pos);
editor.do_import (x.second, disposition, Editing::ImportAsTrack, SrcBest, SMFTrackNumber, SMFTempoIgnore, pos);
}
}
if (!status->aborted() && UIConfiguration::instance().get_save_export_mixer_screenshot ()) {

View File

@ -127,7 +127,8 @@ private:
PublicEditor & editor;
StatusPtr status;
std::vector<std::string> _files_to_reimport;
typedef std::map<samplepos_t, std::vector<std::string>> ReImportMap;
ReImportMap _files_to_reimport;
/* Warning area */