Chris@35: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@35: /* Chris@35: Copyright (c) 2016-2018 Queen Mary, University of London Chris@35: Chris@35: Permission is hereby granted, free of charge, to any person Chris@35: obtaining a copy of this software and associated documentation Chris@35: files (the "Software"), to deal in the Software without Chris@35: restriction, including without limitation the rights to use, copy, Chris@35: modify, merge, publish, distribute, sublicense, and/or sell copies Chris@35: of the Software, and to permit persons to whom the Software is Chris@35: furnished to do so, subject to the following conditions: Chris@35: Chris@35: The above copyright notice and this permission notice shall be Chris@35: included in all copies or substantial portions of the Software. Chris@35: Chris@35: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, Chris@35: EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF Chris@35: MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND Chris@35: NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY Chris@35: CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF Chris@35: CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION Chris@35: WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Chris@35: Chris@35: Except as contained in this notice, the names of the Centre for Chris@35: Digital Music and Queen Mary, University of London shall not be Chris@35: used in advertising or otherwise to promote the sale, use or other Chris@35: dealings in this Software without prior written authorization. Chris@35: */ Chris@35: Chris@35: #ifndef KNOWN_PLUGIN_CANDIDATES_H Chris@35: #define KNOWN_PLUGIN_CANDIDATES_H Chris@35: Chris@35: #include "plugincandidates.h" Chris@35: #include "knownplugins.h" Chris@35: Chris@35: #include Chris@35: #include Chris@35: #include Chris@35: Chris@35: /** Chris@35: * Class to identify and list candidate shared-library files possibly Chris@35: * containing plugins in a hardcoded set of known formats. Uses a Chris@35: * separate process (the "helper", whose executable name must be Chris@35: * provided at construction) to test-load each library in order to Chris@35: * winnow out any that fail to load or crash on load. Chris@35: * Chris@35: * In v1 of the checker library this was the role of the KnownPlugins Chris@35: * class, but that has been changed so that it only provides static Chris@35: * known information about plugin formats and paths, and this class Chris@35: * has been introduced instead (tying that static information together Chris@35: * with a PluginCandidates object that handles the run-time query). Chris@35: * Chris@35: * Requires C++11 and the Qt5 QtCore library. Chris@35: */ Chris@35: class KnownPluginCandidates Chris@35: { Chris@35: typedef std::vector stringlist; Chris@35: Chris@35: public: Chris@35: KnownPluginCandidates(std::string helperExecutableName, Chris@35: PluginCandidates::LogCallback *cb = 0); Chris@35: Chris@35: std::vector getKnownPluginTypes() const { Chris@35: return m_known.getKnownPluginTypes(); Chris@35: } Chris@35: Chris@35: std::string getTagFor(KnownPlugins::PluginType type) const { Chris@35: return m_known.getTagFor(type); Chris@35: } Chris@35: Chris@35: stringlist getCandidateLibrariesFor(KnownPlugins::PluginType type) const { Chris@35: return m_candidates.getCandidateLibrariesFor(m_known.getTagFor(type)); Chris@35: } Chris@35: Chris@35: std::string getHelperExecutableName() const { Chris@35: return m_helperExecutableName; Chris@35: } Chris@35: Chris@40: std::vector getFailures() const; Chris@40: Chris@40: /** Return a non-localised HTML failure report */ Chris@35: std::string getFailureReport() const; Chris@35: Chris@35: private: Chris@35: KnownPlugins m_known; Chris@35: PluginCandidates m_candidates; Chris@35: std::string m_helperExecutableName; Chris@35: }; Chris@35: Chris@35: #endif Chris@35: