# HG changeset patch # User matthiasm # Date 1427821241 -3600 # Node ID ea8743f3b549ddab5c489adb3c773a64cd5ebae6 # Parent 9b816a3dbacba4aa00a2d93cb61644264d71cbc5# Parent abd0dea165843a280e49ab6a4ac27a30a2246ad5 merge diff -r 9b816a3dbacb -r ea8743f3b549 .hgsubstate --- a/.hgsubstate Tue Mar 31 18:00:18 2015 +0100 +++ b/.hgsubstate Tue Mar 31 18:00:41 2015 +0100 @@ -2,6 +2,6 @@ d16f0fd6db6104d87882bc43788a3bb1b0f8c528 dataquay 1629209f5bf21fc926bb6abd5ab786e78c5d7677 pyin 55ece8862b6d3a54aad271a53f9c1615e5d3bcf8 sv-dependency-builds -c48bc6ddfe1762b63f1ea29475d59518fc13b281 svapp +da520a68595a983bd206c01463549858e3389286 svapp 24c48323c662a3631ba004f4701a328cbf753893 svcore fcbfc7fad1f2bb3af17de67d546ecff16dbdeef4 svgui diff -r 9b816a3dbacb -r ea8743f3b549 deploy/win32/tony.wxs --- a/deploy/win32/tony.wxs Tue Mar 31 18:00:18 2015 +0100 +++ b/deploy/win32/tony.wxs Tue Mar 31 18:00:41 2015 +0100 @@ -28,7 +28,61 @@ - + + + + + + + + + + + + + + + + + + @@ -57,137 +111,86 @@ DiskId="1" Source="chp\win32-build\release\chp.dll"/> + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff -r 9b816a3dbacb -r ea8743f3b549 src/Analyser.cpp --- a/src/Analyser.cpp Tue Mar 31 18:00:18 2015 +0100 +++ b/src/Analyser.cpp Tue Mar 31 18:00:41 2015 +0100 @@ -77,6 +77,8 @@ m_paneStack = paneStack; m_pane = pane; + if (!m_fileModel) return "Internal error: Analyser::newFileLoaded() called with no model present"; + connect(doc, SIGNAL(layerAboutToBeDeleted(Layer *)), this, SLOT(layerAboutToBeDeleted(Layer *))); @@ -95,6 +97,8 @@ if (!m_pane) return "Internal error: Analyser::analyseExistingFile() called with no pane present"; + if (!m_fileModel) return "Internal error: Analyser::analyseExistingFile() called with no model present"; + if (m_layers[PitchTrack]) { m_document->removeLayerFromView(m_pane, m_layers[PitchTrack]); m_layers[PitchTrack] = 0; @@ -225,6 +229,8 @@ QString Analyser::addVisualisations() { + if (!m_fileModel) return "Internal error: Analyser::addVisualisations() called with no model present"; + // A spectrogram, off by default. Must go at the back because it's // opaque diff -r 9b816a3dbacb -r ea8743f3b549 src/main.cpp --- a/src/main.cpp Tue Mar 31 18:00:18 2015 +0100 +++ b/src/main.cpp Tue Mar 31 18:00:41 2015 +0100 @@ -40,6 +40,8 @@ #include #include +#include + static QMutex cleanupMutex; static bool cleanedUp = false; @@ -114,6 +116,46 @@ } } }; + +static void +setupTonyVampPath() +{ +#ifdef Q_OS_WIN32 + QChar sep(';'); + QString programFiles = getenv("ProgramFiles"); + if (programFiles == "") programFiles = "C:\\Program Files"; + QString defaultTonyPath(programFiles + "\\Tony"); +#else + QChar sep(':'); +#ifdef Q_OS_MAC + QString defaultTonyPath; +#else + QString defaultTonyPath("/usr/local/lib/tony:/usr/lib/tony"); +#endif +#endif + + QString tonyVampPath = getenv("TONY_VAMP_PATH"); + if (tonyVampPath == "") { + tonyVampPath = defaultTonyPath; + } + if (tonyVampPath == "") { + // just use the default Vamp path or VAMP_PATH environment + // variable -- leave it up to the Vamp SDK + return; + } + + std::vector vampPathList = + Vamp::PluginHostAdapter::getPluginPath(); + + QStringList qVampPathList; + for (auto p: vampPathList) qVampPathList.push_back(p.c_str()); + QString vampPath = qVampPathList.join(sep); + QString newPath = tonyVampPath + sep + vampPath; + + cerr << "Setting VAMP_PATH to " << newPath << " for Tony plugins" << endl; + + setenv("VAMP_PATH", newPath.toLocal8Bit().data(), 1); +} int main(int argc, char **argv) @@ -127,6 +169,8 @@ } #endif + setupTonyVampPath(); + TonyApplication application(argc, argv); QStringList args = application.arguments();