changeset 1283:ca5dcee081ef project-file-rework

Merge from branch piper
author Chris Cannam
date Tue, 25 Oct 2016 11:06:00 +0100
parents 2f3dc5f839d2 (current diff) 5b4f4de87892 (diff)
children 5c39d179b9a1
files .hgsubstate
diffstat 5 files changed, 55 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/.hgsubstate	Mon Oct 24 17:54:50 2016 +0100
+++ b/.hgsubstate	Tue Oct 25 11:06:00 2016 +0100
@@ -6,7 +6,7 @@
 68ae618c6b0e442d08a71d39217784a08f2a8de3 icons/scalable
 9598a8db655b1d575b625f0d519a4f0d8b457672 piper-cpp
 d93140aac40bbc35361c32ddc9cae42038e9c05f sv-dependency-builds
-066d8c5f3b2127d6b97434d3d5e03a495abdcaa4 svapp
-a2091d148d7fd9e32dcb6b2aac0cc5725d12497d svcore
-d1bab6a991005216aaf3e863908d7c9f82e9eeab svgui
+d5e339613174be7acfe20906a347b35c396883b4 svapp
+9ae2ce9190e6dab707da8d610e77ead5a8b1e68c svcore
+2ab1cf27a766221d5870dfd0e936bf17c0c8876c svgui
 af4a1522ef1585686d3d2d9bc9433588f88f4ccc vamp-plugin-sdk
--- a/main/MainWindow.cpp	Mon Oct 24 17:54:50 2016 +0100
+++ b/main/MainWindow.cpp	Tue Oct 25 11:06:00 2016 +0100
@@ -1496,6 +1496,11 @@
     TransformFactory *factory = TransformFactory::getInstance();
 
     TransformList transforms = factory->getAllTransformDescriptions();
+
+    if (factory->getStartupFailureReport() != "") {
+        pluginPopulationWarning();
+    }
+    
     vector<TransformDescription::Type> types = factory->getAllTransformTypes();
 
     map<TransformDescription::Type, map<QString, SubdividingMenu *> > categoryMenus;
@@ -4156,8 +4161,21 @@
 void
 MainWindow::pluginPopulationWarning()
 {
-    QString warning = PluginScan::getInstance()->getStartupFailureReport();
-    QMessageBox::warning(this, tr("Problems loading plugins"), warning);
+    QString scanWarning = PluginScan::getInstance()->getStartupFailureReport();
+    QString factWarning = TransformFactory::getInstance()->getStartupFailureReport();
+    QString warning;
+    if (factWarning != "") {
+        // The order of events on startup implies that, if scanWarning
+        // and factWarning are both present, then we have already been
+        // called once for scanWarning so don't want to report it again
+        warning = factWarning;
+    } else if (scanWarning != "") {
+        warning = scanWarning;
+    }
+    if (warning != "") {
+        emit hideSplash();
+        QMessageBox::warning(this, tr("Problems loading plugins"), warning);
+    }
 }
 
 void
--- a/main/PreferencesDialog.cpp	Mon Oct 24 17:54:50 2016 +0100
+++ b/main/PreferencesDialog.cpp	Tue Oct 25 11:06:00 2016 +0100
@@ -80,6 +80,13 @@
     connect(m_windowTypeSelector, SIGNAL(windowTypeChanged(WindowType)),
             this, SLOT(windowTypeChanged(WindowType)));
 
+    QCheckBox *vampProcessSeparation = new QCheckBox;
+    m_runPluginsInProcess = prefs->getRunPluginsInProcess();
+    vampProcessSeparation->setCheckState(m_runPluginsInProcess ? Qt::Unchecked :
+                                         Qt::Checked);
+    connect(vampProcessSeparation, SIGNAL(stateChanged(int)),
+            this, SLOT(vampProcessSeparationChanged(int)));
+    
     QComboBox *smoothing = new QComboBox;
     
     int sm = prefs->getPropertyRangeAndValue("Spectrogram Y Smoothing", &min, &max,
@@ -472,8 +479,13 @@
                                                 ("Window Type"))),
                        row, 0);
     subgrid->addWidget(m_windowTypeSelector, row++, 1, 2, 2);
+
     subgrid->setRowStretch(row, 10);
     row++;
+
+    subgrid->addWidget(new QLabel(tr("Run Vamp plugins in separate process:")),
+                       row, 0);
+    subgrid->addWidget(vampProcessSeparation, row++, 1, 1, 1);
     
     subgrid->setRowStretch(row, 10);
     
@@ -633,6 +645,14 @@
 }
 
 void
+PreferencesDialog::vampProcessSeparationChanged(int state)
+{
+    m_runPluginsInProcess = (state == Qt::Unchecked);
+    m_applyButton->setEnabled(true);
+    m_changesOnRestart = true;
+}
+
+void
 PreferencesDialog::networkPermissionChanged(int state)
 {
     m_networkPermission = (state == Qt::Checked);
@@ -747,6 +767,7 @@
     prefs->setTuningFrequency(m_tuningFrequency);
     prefs->setResampleQuality(m_resampleQuality);
     prefs->setResampleOnLoad(m_resampleOnLoad);
+    prefs->setRunPluginsInProcess(m_runPluginsInProcess);
     prefs->setShowSplash(m_showSplash);
     prefs->setTemporaryDirectoryRoot(m_tempDirRoot);
     prefs->setBackgroundMode(Preferences::BackgroundMode(m_backgroundMode));
--- a/main/PreferencesDialog.h	Mon Oct 24 17:54:50 2016 +0100
+++ b/main/PreferencesDialog.h	Tue Oct 25 11:06:00 2016 +0100
@@ -57,6 +57,7 @@
     void audioDeviceChanged(int device);
     void resampleQualityChanged(int quality);
     void resampleOnLoadChanged(int state);
+    void vampProcessSeparationChanged(int state);
     void tempDirRootChanged(QString root);
     void backgroundModeChanged(int mode);
     void timeToTextModeChanged(int mode);
@@ -101,6 +102,7 @@
     int m_audioDevice;
     int m_resampleQuality;
     bool m_resampleOnLoad;
+    bool m_runPluginsInProcess;
     bool m_networkPermission;
     bool m_retina;
     QString m_tempDirRoot;
--- a/main/main.cpp	Mon Oct 24 17:54:50 2016 +0100
+++ b/main/main.cpp	Tue Oct 25 11:06:00 2016 +0100
@@ -277,6 +277,14 @@
     QSettings settings;
 
     settings.beginGroup("Preferences");
+    // Default to using Piper server; can change in preferences
+    if (!settings.contains("run-vamp-plugins-in-process")) {
+        cerr << "setting does not exist yet" << endl;
+        settings.setValue("run-vamp-plugins-in-process", false);
+    }
+    settings.endGroup();
+
+    settings.beginGroup("Preferences");
     if (settings.value("show-splash", true).toBool()) {
         splash = new SVSplash();
         splash->show();
@@ -348,11 +356,11 @@
              << ", trying in my own directory" << endl;
         helperPath = myDir + "/plugin-checker-helper";
     }
-    helperPath += helperSuffix;
     if (!QFile(helperPath + helperSuffix).exists()) {
         cerr << "NOTE: helper not found at " << (helperPath + helperSuffix)
              << endl;
     }
+    helperPath += helperSuffix;
     PluginScan::getInstance()->scan(helperPath);
     
     // Permit size_t and PropertyName to be used as args in queued signal calls