changeset 1282:5b4f4de87892 piper

Merge
author Chris Cannam
date Tue, 25 Oct 2016 11:02:03 +0100
parents e9197aa8ea24 (diff) eb60f984c66c (current diff)
children ca5dcee081ef 6e47bd2263e2
files
diffstat 5 files changed, 55 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/.hgsubstate	Mon Oct 24 10:52:51 2016 +0100
+++ b/.hgsubstate	Tue Oct 25 11:02:03 2016 +0100
@@ -7,7 +7,7 @@
 2ca3f7587550c7d80d0ca7b6ae1c266ca93859cd piper
 98be18165618992ccedc845ab021182dfd165aa7 piper-cpp
 d93140aac40bbc35361c32ddc9cae42038e9c05f sv-dependency-builds
-4826330c4f9715dedd797385d55f95c1bb929b87 svapp
-ab050519c4ba70fbac5a1cb0b9a71029a97ec538 svcore
-c5a82068bd6083596328bf0694928247ec6ec258 svgui
+7a3fa603190e50a8da656cfa1aeb109375085548 svapp
+e699bdeef63c387d8466b909ff414d925778d88a svcore
+07e8ac88bccefdf1a6d55e9c6ebb3fb8efb318ce svgui
 af4a1522ef1585686d3d2d9bc9433588f88f4ccc vamp-plugin-sdk
--- a/main/MainWindow.cpp	Mon Oct 24 10:52:51 2016 +0100
+++ b/main/MainWindow.cpp	Tue Oct 25 11:02:03 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 10:52:51 2016 +0100
+++ b/main/PreferencesDialog.cpp	Tue Oct 25 11:02:03 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 10:52:51 2016 +0100
+++ b/main/PreferencesDialog.h	Tue Oct 25 11:02:03 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 10:52:51 2016 +0100
+++ b/main/main.cpp	Tue Oct 25 11:02:03 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