From 2645ab2e73f8b8866588ceda2dc83a8047b3ea45 Mon Sep 17 00:00:00 2001 From: Damien Zammit Date: Sat, 9 Jan 2021 17:17:17 +1100 Subject: [PATCH] pt import: Fix import -> cancel -> import by clearing status --- gtk2_ardour/editor_pt_import.cc | 1 + libs/ardour/import_pt.cc | 10 +--------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/gtk2_ardour/editor_pt_import.cc b/gtk2_ardour/editor_pt_import.cc index 90bb87bb96..0b551931ad 100644 --- a/gtk2_ardour/editor_pt_import.cc +++ b/gtk2_ardour/editor_pt_import.cc @@ -90,6 +90,7 @@ Editor::external_pt_dialog () } import_pt_status.all_done = false; + import_pt_status.clear(); ImportProgressWindow ipw (&import_pt_status, _("PT Import"), _("Cancel Import")); pthread_create_and_store ("import_pt", &import_pt_status.thread, _import_pt_thread, this); diff --git a/libs/ardour/import_pt.cc b/libs/ardour/import_pt.cc index b3ac08f2d7..edd09665db 100644 --- a/libs/ardour/import_pt.cc +++ b/libs/ardour/import_pt.cc @@ -177,27 +177,19 @@ Session::import_sndfile_as_region (string path, SrcQuality quality, samplepos_t& void Session::import_pt_sources (PTFFormat& ptf, ImportStatus& status) { - vector > regions; - boost::shared_ptr track; - ARDOUR::PluginInfoPtr instrument; - vector to_import; string fullpath; bool ok = false; bool onefailed = false; samplepos_t pos = -1; - vector ptfregpair; vector::const_iterator w; uint32_t wth = 0; SourceList just_one_src; - boost::shared_ptr existing_track; - vector usedtracks; - struct ptflookup utr; - ptfwavpair.clear(); pt_imported_sources.clear(); + status.clear(); for (w = ptf.audiofiles ().begin (); w != ptf.audiofiles ().end () && !status.cancel; ++w) { struct ptflookup p;