# HG changeset patch # User Lucas Thompson # Date 1486650727 0 # Node ID da5f4d37988d7807d5236745bdd658484c5f9691 # Parent 8db84bd61eaa2732daf3d90b7cbd0e0cc98c7b3d Invert control, injecting a server path on construction. Also add initializer_list constructor for multiple servers. diff -r 8db84bd61eaa -r da5f4d37988d plugin/PiperVampPluginFactory.cpp --- a/plugin/PiperVampPluginFactory.cpp Tue Feb 07 14:55:19 2017 +0000 +++ b/plugin/PiperVampPluginFactory.cpp Thu Feb 09 14:32:07 2017 +0000 @@ -54,28 +54,34 @@ } }; -PiperVampPluginFactory::PiperVampPluginFactory() : +PiperVampPluginFactory::PiperVampPluginFactory(std::initializer_list servers) : m_logger(new Logger) { - QString serverName = "piper-vamp-simple-server"; + HelperExecPath hep(HelperExecPath::AllInstalled); - HelperExecPath hep(HelperExecPath::AllInstalled); - m_servers = hep.getHelperExecutables(serverName); + for (auto server: servers) { + for (auto platformHelper: hep.getHelperExecutables(server)) + m_servers.push_back(platformHelper); + } for (auto n: m_servers) { - SVDEBUG << "NOTE: PiperVampPluginFactory: Found server: " + SVDEBUG << "NOTE: PiperVampPluginFactory: Found server: " << n.executable << endl; } - + if (m_servers.empty()) { - SVDEBUG << "NOTE: No Piper Vamp servers found in installation;" + SVDEBUG << "NOTE: No Piper Vamp servers found in installation;" << " found none of the following:" << endl; - for (auto d: hep.getHelperCandidatePaths(serverName)) { - SVDEBUG << "NOTE: " << d << endl; - } + for (auto serverName: servers) + for (auto d: hep.getHelperCandidatePaths(serverName)) { + SVDEBUG << "NOTE: " << d << endl; + } } } +PiperVampPluginFactory::PiperVampPluginFactory() : + PiperVampPluginFactory({"piper-vamp-simple-server"}) {} + PiperVampPluginFactory::~PiperVampPluginFactory() { delete m_logger; diff -r 8db84bd61eaa -r da5f4d37988d plugin/PiperVampPluginFactory.h --- a/plugin/PiperVampPluginFactory.h Tue Feb 07 14:55:19 2017 +0000 +++ b/plugin/PiperVampPluginFactory.h Thu Feb 09 14:32:07 2017 +0000 @@ -35,6 +35,7 @@ { public: PiperVampPluginFactory(); + PiperVampPluginFactory(std::initializer_list servers); virtual ~PiperVampPluginFactory(); virtual std::vector getPluginIdentifiers(QString &errorMessage)