summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_pt_import.cc
diff options
context:
space:
mode:
authorDamien Zammit <damien@zamaudio.com>2016-04-16 16:31:44 +1000
committerRobin Gareus <robin@gareus.org>2016-04-16 12:21:12 +0200
commit277893b130f5ec1efa4aba44d92f038dad2793ef (patch)
tree7af786a3eb95a2a67ef1a80d5adbb2bbfa5f5253 /gtk2_ardour/editor_pt_import.cc
parent241f734af475cec96dcb6f9d1aad77a6e2ec2a8d (diff)
ptformat: Make PT import more resilient to bad user choices and display messages
Previously, libptformat would attempt to parse all kinds of files, now the library stops parsing when the version number and session rate is outside valid ranges, returning an error code to the caller. If there is a valid PT file detected, but some audio files are missing, Ardour now pops up an error message to inform the user that some files may be missing from the import. A success message is displayed otherwise. Signed-off-by: Damien Zammit <damien@zamaudio.com>
Diffstat (limited to 'gtk2_ardour/editor_pt_import.cc')
-rw-r--r--gtk2_ardour/editor_pt_import.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/gtk2_ardour/editor_pt_import.cc b/gtk2_ardour/editor_pt_import.cc
index 15723c3b27..3639fcf877 100644
--- a/gtk2_ardour/editor_pt_import.cc
+++ b/gtk2_ardour/editor_pt_import.cc
@@ -121,6 +121,7 @@ Editor::do_ptimport (std::string ptpath,
vector<string> to_import;
string fullpath;
bool ok = false;
+ bool onefailed = false;
PTFFormat ptf;
framepos_t pos = -1;
@@ -165,9 +166,19 @@ Editor::do_ptimport (std::string ptpath,
ptfwavpair.push_back(p);
imported.push_back(import_status.sources.back());
+ } else {
+ onefailed = true;
}
}
+ if (onefailed) {
+ MessageDialog msg (_("Failed to load one or more of the audio files, but continuing to attempt import."));
+ msg.run ();
+ } else {
+ MessageDialog msg (_("Success! Import should complete soon."));
+ msg.run ();
+ }
+
for (vector<PTFFormat::region_t>::iterator a = ptf.regions.begin();
a != ptf.regions.end(); ++a) {
for (vector<ptflookup_t>::iterator p = ptfwavpair.begin();