Fix confusion about the 'done' variable in InterThreadInfo during import. 'done' now means that a given run of the import thread has completed; 'all_done' means that the whole import operation has completed. Fixes #3396.

git-svn-id: svn://localhost/ardour2/branches/3.0@7862 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2010-09-29 22:59:39 +00:00
parent ee54123470
commit 74c69114bc
3 changed files with 10 additions and 5 deletions

View File

@ -335,6 +335,7 @@ Editor::do_import (vector<string> paths, ImportDisposition chns, ImportMode mode
current_interthread_info = &import_status;
import_status.current = 1;
import_status.total = paths.size ();
import_status.all_done = false;
ImportProgressWindow ipw (&import_status, _("Import"), _("Cancel Import"));
@ -423,6 +424,8 @@ Editor::do_import (vector<string> paths, ImportDisposition chns, ImportMode mode
}
}
}
import_status.all_done = true;
}
void
@ -499,7 +502,6 @@ Editor::import_sndfiles (vector<string> paths, ImportMode mode, SrcQuality quali
import_status.done = false;
import_status.cancel = false;
import_status.freeze = false;
import_status.done = 0.0;
import_status.quality = quality;
import_status.replace_existing_source = replace;
@ -816,8 +818,6 @@ Editor::add_sources (vector<string> paths, SourceList& sources, framepos_t& pos,
if (use_timestamp && ar) {
cerr << "Using timestamp to place region " << (*r)->name() << endl;
/* get timestamp for this region */
const boost::shared_ptr<Source> s (ar->sources().front());

View File

@ -100,6 +100,6 @@ ImportProgressWindow::update ()
}
_bar.set_text (string_compose (_("Importing file: %1 of %2"), c, _import_status->total));
return !(_import_status->done || _import_status->cancel);
return !(_import_status->all_done || _import_status->cancel);
}

View File

@ -40,6 +40,11 @@ struct ImportStatus : public InterThreadInfo {
std::vector<std::string> paths;
bool replace_existing_source;
/** set to true when all files have been imported, as distinct from the done in ARDOUR::InterThreadInfo,
* which indicates that one run of the import thread has been completed.
*/
bool all_done;
/* result */
SourceList sources;
};