diff framework/MainWindowBase.cpp @ 604:6cdf2afebfd7 import-audio-data

Toward importing audio from CSVs
author Chris Cannam
date Thu, 28 Jun 2018 15:29:26 +0100
parents d4c16eed673d
children 636a5908cf81
line wrap: on
line diff
--- a/framework/MainWindowBase.cpp	Thu Jun 21 15:37:36 2018 +0100
+++ b/framework/MainWindowBase.cpp	Thu Jun 28 15:29:26 2018 +0100
@@ -1498,8 +1498,16 @@
         }
     }
 
-//    cerr << "mode = " << mode << endl;
-
+    return addOpenedAudioModel(source, newModel, mode, templateName, true);
+}
+
+MainWindowBase::FileOpenStatus
+MainWindowBase::addOpenedAudioModel(FileSource source,
+                                    WaveFileModel *newModel,
+                                    AudioFileOpenMode mode,
+                                    QString templateName,
+                                    bool registerSource)
+{
     if (mode == AskUser) {
         if (getMainModel()) {
 
@@ -1635,7 +1643,9 @@
             }
         }
 
-        if (!source.isRemote()) m_audioFile = source.getLocalFilename();
+        if (!source.isRemote() && registerSource) {
+            m_audioFile = source.getLocalFilename();
+        }
 
     } else if (mode == CreateAdditionalModel) {
 
@@ -1705,7 +1715,7 @@
 
     updateMenuStates();
     m_recentFiles.addFile(source.getLocation());
-    if (!source.isRemote()) {
+    if (!source.isRemote() && registerSource) {
         // for file dialog
         registerLastOpenedFilePath(FileFinder::AudioFile,
                                    source.getLocalFilename());