Chris@4: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@5: /* Chris@5: Copyright (c) 2016 Queen Mary, University of London Chris@5: Chris@5: Permission is hereby granted, free of charge, to any person Chris@5: obtaining a copy of this software and associated documentation Chris@5: files (the "Software"), to deal in the Software without Chris@5: restriction, including without limitation the rights to use, copy, Chris@5: modify, merge, publish, distribute, sublicense, and/or sell copies Chris@5: of the Software, and to permit persons to whom the Software is Chris@5: furnished to do so, subject to the following conditions: Chris@5: Chris@5: The above copyright notice and this permission notice shall be Chris@5: included in all copies or substantial portions of the Software. Chris@5: Chris@5: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, Chris@5: EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF Chris@5: MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND Chris@5: NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY Chris@5: CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF Chris@5: CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION Chris@5: WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Chris@5: Chris@5: Except as contained in this notice, the names of the Centre for Chris@5: Digital Music and Queen Mary, University of London shall not be Chris@5: used in advertising or otherwise to promote the sale, use or other Chris@5: dealings in this Software without prior written authorization. Chris@5: */ Chris@4: Chris@4: #ifndef KNOWN_PLUGINS_H Chris@4: #define KNOWN_PLUGINS_H Chris@4: Chris@4: #include "plugincandidates.h" Chris@4: Chris@4: #include Chris@4: #include Chris@4: #include Chris@4: Chris@4: class KnownPlugins Chris@4: { Chris@4: typedef std::vector stringlist; Chris@4: Chris@4: public: Chris@4: enum PluginType { Chris@4: VampPlugin, Chris@4: LADSPAPlugin, Chris@4: DSSIPlugin Chris@4: }; Chris@4: Chris@6: KnownPlugins(std::string helperExecutableName, Chris@6: PluginCandidates::LogCallback *cb = 0); Chris@4: Chris@4: std::vector getKnownPluginTypes() const { Chris@4: return { VampPlugin, LADSPAPlugin, DSSIPlugin }; Chris@4: }; Chris@4: Chris@4: std::string getTagFor(PluginType type) const { Chris@4: return m_known.at(type).tag; Chris@4: } Chris@4: Chris@4: stringlist getCandidateLibrariesFor(PluginType type) const { Chris@4: return m_candidates.getCandidateLibrariesFor(getTagFor(type)); Chris@4: } Chris@4: Chris@4: std::string getFailureReport() const; Chris@4: Chris@4: private: Chris@4: struct TypeRec { Chris@4: std::string tag; Chris@4: stringlist path; Chris@4: std::string descriptor; Chris@4: }; Chris@4: std::map m_known; Chris@4: Chris@4: stringlist expandConventionalPath(PluginType type, std::string var); Chris@4: std::string getDefaultPath(PluginType type); Chris@4: Chris@4: PluginCandidates m_candidates; Chris@4: }; Chris@4: Chris@4: #endif