Mercurial > hg > tony
comparison main/main.cpp @ 594:b76234d1a217
Be stricter about Vamp path - don't use external location at all unless in Tony path variable explicitly
author | Chris Cannam |
---|---|
date | Tue, 17 Sep 2019 11:40:43 +0100 |
parents | 164fa1ee2642 |
children | e50b2e568679 |
comparison
equal
deleted
inserted
replaced
593:c82326286b02 | 594:b76234d1a217 |
---|---|
149 } | 149 } |
150 | 150 |
151 static void | 151 static void |
152 setupTonyVampPath() | 152 setupTonyVampPath() |
153 { | 153 { |
154 QString tonyVampPath = getEnvQStr("TONY_VAMP_PATH"); | 154 QString myVampPath = getEnvQStr("TONY_VAMP_PATH"); |
155 | 155 |
156 #ifdef Q_OS_WIN32 | 156 #ifdef Q_OS_WIN32 |
157 QChar sep(';'); | 157 QChar sep(';'); |
158 #else | 158 #else |
159 QChar sep(':'); | 159 QChar sep(':'); |
160 #endif | 160 #endif |
161 | 161 |
162 if (tonyVampPath == "") { | 162 if (myVampPath == "") { |
163 | 163 |
164 QString appName = QApplication::applicationName(); | 164 QString appName = QApplication::applicationName(); |
165 QString myDir = QApplication::applicationDirPath(); | 165 QString myDir = QApplication::applicationDirPath(); |
166 QString binaryName = QFileInfo(QCoreApplication::arguments().at(0)) | 166 QString binaryName = QFileInfo(QCoreApplication::arguments().at(0)) |
167 .fileName(); | 167 .fileName(); |
184 myDir; | 184 myDir; |
185 #endif | 185 #endif |
186 #endif | 186 #endif |
187 } | 187 } |
188 | 188 |
189 std::vector<std::string> vampPathList = | 189 SVCERR << "Setting VAMP_PATH to " << myVampPath |
190 Vamp::PluginHostAdapter::getPluginPath(); | |
191 | |
192 for (auto p: vampPathList) { | |
193 tonyVampPath = tonyVampPath + sep + QString::fromUtf8(p.c_str()); | |
194 } | |
195 | |
196 SVCERR << "Setting VAMP_PATH to " << tonyVampPath | |
197 << " for Tony plugins" << endl; | 190 << " for Tony plugins" << endl; |
198 | 191 |
199 QString env = "VAMP_PATH=" + tonyVampPath; | 192 QString env = "VAMP_PATH=" + myVampPath; |
200 | 193 |
201 // Windows lacks setenv, must use putenv (different arg convention) | 194 // Windows lacks setenv, must use putenv (different arg convention) |
202 putEnvQStr(env); | 195 putEnvQStr(env); |
203 } | 196 } |
204 | 197 |