# HG changeset patch # User Chris Cannam # Date 1476458584 -3600 # Node ID 584b2d7d7cd936fef740fa45be911634e1cade2e # Parent 385deb828b4acf330d57ee237e707cf2e4e3c105 Try AutoPlugin; also not very successful diff -r 385deb828b4a -r 584b2d7d7cd9 plugin/FeatureExtractionPluginFactory.cpp --- a/plugin/FeatureExtractionPluginFactory.cpp Fri Oct 14 14:33:43 2016 +0100 +++ b/plugin/FeatureExtractionPluginFactory.cpp Fri Oct 14 16:23:04 2016 +0100 @@ -23,6 +23,8 @@ #include "PluginScan.h" +#include "vamp-client/AutoPlugin.h" + #include #include #include @@ -61,7 +63,8 @@ } FeatureExtractionPluginFactory::FeatureExtractionPluginFactory() : - m_transport("piper-cpp/bin/piper-vamp-server"), + m_serverName("piper-cpp/bin/piper-vamp-server"), + m_transport(m_serverName), m_client(&m_transport) { } @@ -112,17 +115,20 @@ sv_samplerate_t inputSampleRate) { Profiler profiler("FeatureExtractionPluginFactory::instantiatePlugin"); - + QString type, soname, label; PluginIdentifier::parseIdentifier(identifier, type, soname, label); + std::string pluginKey = (soname + ":" + label).toStdString(); - piper_vamp::LoadRequest request; - request.pluginKey = (soname + ":" + label).toStdString(); - request.inputSampleRate = inputSampleRate; - request.adapterFlags = 0; - piper_vamp::LoadResponse response = m_client.loadPlugin(request); + auto ap = new piper_vamp::client::AutoPlugin + (m_serverName, pluginKey, inputSampleRate, 0); - return response.plugin; + if (!ap->isOK()) { + delete ap; + return 0; + } else { + return ap; + } } QString diff -r 385deb828b4a -r 584b2d7d7cd9 plugin/FeatureExtractionPluginFactory.h --- a/plugin/FeatureExtractionPluginFactory.h Fri Oct 14 14:33:43 2016 +0100 +++ b/plugin/FeatureExtractionPluginFactory.h Fri Oct 14 16:23:04 2016 +0100 @@ -52,6 +52,8 @@ virtual QString getPluginCategory(QString identifier); protected: + std::string m_serverName; + piper_vamp::client::ProcessQtTransport m_transport; piper_vamp::client::CapnpRRClient m_client;