13
0

pt import: Fix import -> cancel -> import by clearing status

This commit is contained in:
Damien Zammit 2021-01-09 17:17:17 +11:00
parent 5d0de7e037
commit 2645ab2e73
2 changed files with 2 additions and 9 deletions

View File

@ -90,6 +90,7 @@ Editor::external_pt_dialog ()
} }
import_pt_status.all_done = false; import_pt_status.all_done = false;
import_pt_status.clear();
ImportProgressWindow ipw (&import_pt_status, _("PT Import"), _("Cancel Import")); ImportProgressWindow ipw (&import_pt_status, _("PT Import"), _("Cancel Import"));
pthread_create_and_store ("import_pt", &import_pt_status.thread, _import_pt_thread, this); pthread_create_and_store ("import_pt", &import_pt_status.thread, _import_pt_thread, this);

View File

@ -177,27 +177,19 @@ Session::import_sndfile_as_region (string path, SrcQuality quality, samplepos_t&
void void
Session::import_pt_sources (PTFFormat& ptf, ImportStatus& status) Session::import_pt_sources (PTFFormat& ptf, ImportStatus& status)
{ {
vector<boost::shared_ptr<Region> > regions;
boost::shared_ptr<ARDOUR::Track> track;
ARDOUR::PluginInfoPtr instrument;
vector<string> to_import;
string fullpath; string fullpath;
bool ok = false; bool ok = false;
bool onefailed = false; bool onefailed = false;
samplepos_t pos = -1; samplepos_t pos = -1;
vector<struct ptflookup> ptfregpair;
vector<PTFFormat::wav_t>::const_iterator w; vector<PTFFormat::wav_t>::const_iterator w;
uint32_t wth = 0; uint32_t wth = 0;
SourceList just_one_src; SourceList just_one_src;
boost::shared_ptr<AudioTrack> existing_track;
vector<struct ptflookup> usedtracks;
struct ptflookup utr;
ptfwavpair.clear(); ptfwavpair.clear();
pt_imported_sources.clear(); pt_imported_sources.clear();
status.clear();
for (w = ptf.audiofiles ().begin (); w != ptf.audiofiles ().end () && !status.cancel; ++w) { for (w = ptf.audiofiles ().begin (); w != ptf.audiofiles ().end () && !status.cancel; ++w) {
struct ptflookup p; struct ptflookup p;