# HG changeset patch # User Chris Cannam # Date 1477566284 -3600 # Node ID 5876f3e9c6779c2ffcf2311fcf41def0be983203 # Parent ff3fd8d1b2dc0f64d471b413c4991e2c2c21aaa1 Fix server invocations from client code diff -r ff3fd8d1b2dc -r 5876f3e9c677 vamp-client/AutoPlugin.h --- a/vamp-client/AutoPlugin.h Thu Oct 27 12:01:37 2016 +0100 +++ b/vamp-client/AutoPlugin.h Thu Oct 27 12:04:44 2016 +0100 @@ -52,7 +52,7 @@ float inputSampleRate, int adapterFlags) : Vamp::Plugin(inputSampleRate), - m_transport(serverName), + m_transport(serverName, "capnp"), m_client(&m_transport) { LoadRequest req; diff -r ff3fd8d1b2dc -r 5876f3e9c677 vamp-client/ProcessQtTransport.h --- a/vamp-client/ProcessQtTransport.h Thu Oct 27 12:01:37 2016 +0100 +++ b/vamp-client/ProcessQtTransport.h Thu Oct 27 12:04:44 2016 +0100 @@ -58,21 +58,15 @@ class ProcessQtTransport : public SynchronousTransport { public: - ProcessQtTransport(std::string processName) : + ProcessQtTransport(std::string processName, std::string formatArg) : m_completenessChecker(0) { + m_process = new QProcess(); m_process->setReadChannel(QProcess::StandardOutput); m_process->setProcessChannelMode(QProcess::ForwardedErrorChannel); - QString name(QString::fromStdString(processName)); - // The second argument here is vital, otherwise we get a - // different start() overload which parses all command args - // out of its first argument only and therefore fails when - // name has a space in it. This is such a gotcha that Qt5.6 - // even introduced a QT_NO_PROCESS_COMBINED_ARGUMENT_START - // build flag to disable that overload. Unfortunately I only - // discovered that after wasting almost a day on it. - m_process->start(name, QStringList()); + m_process->start(QString::fromStdString(processName), + { QString::fromStdString(formatArg) }); if (!m_process->waitForStarted()) { if (m_process->state() == QProcess::NotRunning) { diff -r ff3fd8d1b2dc -r 5876f3e9c677 vamp-client/client.cpp --- a/vamp-client/client.cpp Thu Oct 27 12:01:37 2016 +0100 +++ b/vamp-client/client.cpp Thu Oct 27 12:04:44 2016 +0100 @@ -44,7 +44,8 @@ int main(int, char **) { - piper_vamp::client::ProcessQtTransport transport("../bin/piper-vamp-server"); + piper_vamp::client::ProcessQtTransport transport("../bin/piper-vamp-server", + "capnp"); piper_vamp::client::CapnpRRClient client(&transport); piper_vamp::ListResponse lr = client.listPluginData();