Chris@1178: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@1178: Chris@1178: /* Chris@1178: Sonic Visualiser Chris@1178: An audio file viewer and annotation editor. Chris@1178: Centre for Digital Music, Queen Mary, University of London. Chris@1178: Chris@1178: This program is free software; you can redistribute it and/or Chris@1178: modify it under the terms of the GNU General Public License as Chris@1178: published by the Free Software Foundation; either version 2 of the Chris@1178: License, or (at your option) any later version. See the file Chris@1178: COPYING included with this distribution for more information. Chris@1178: */ Chris@1178: Chris@1178: #include "PluginScan.h" Chris@1178: Chris@1178: #include "base/Debug.h" Chris@1178: Chris@1178: #include Chris@1178: Chris@1178: using std::string; Chris@1178: Chris@1178: PluginScan *PluginScan::getInstance() { Chris@1178: static QMutex mutex; Chris@1178: static PluginScan *m_instance = 0; Chris@1178: mutex.lock(); Chris@1178: if (!m_instance) m_instance = new PluginScan(); Chris@1178: mutex.unlock(); Chris@1178: return m_instance; Chris@1178: } Chris@1178: Chris@1178: PluginScan::PluginScan() : m_kp(0) { Chris@1178: } Chris@1178: Chris@1178: PluginScan::~PluginScan() { Chris@1178: delete m_kp; Chris@1178: } Chris@1178: Chris@1178: void Chris@1178: PluginScan::log(string message) Chris@1178: { Chris@1178: SVDEBUG << "PluginScan: " << message; Chris@1178: } Chris@1178: Chris@1178: void Chris@1178: PluginScan::scan() Chris@1178: { Chris@1178: delete m_kp; Chris@1178: m_kp = new KnownPlugins("./helper", this); //!!! Chris@1178: } Chris@1178: Chris@1178: QStringList Chris@1178: PluginScan::getCandidateVampLibraries() const Chris@1178: { Chris@1178: QStringList candidates; Chris@1178: if (!m_kp) return candidates; Chris@1178: auto c = m_kp->getCandidateLibrariesFor(KnownPlugins::VampPlugin); Chris@1178: for (auto s: c) candidates.push_back(s.c_str()); Chris@1178: return candidates; Chris@1178: } Chris@1178: Chris@1178: QStringList Chris@1178: PluginScan::getCandidateLADSPALibraries() const Chris@1178: { Chris@1178: QStringList candidates; Chris@1178: if (!m_kp) return candidates; Chris@1178: auto c = m_kp->getCandidateLibrariesFor(KnownPlugins::LADSPAPlugin); Chris@1178: for (auto s: c) candidates.push_back(s.c_str()); Chris@1178: return candidates; Chris@1178: } Chris@1178: Chris@1178: QStringList Chris@1178: PluginScan::getCandidateDSSILibraries() const Chris@1178: { Chris@1178: QStringList candidates; Chris@1178: if (!m_kp) return candidates; Chris@1178: auto c = m_kp->getCandidateLibrariesFor(KnownPlugins::DSSIPlugin); Chris@1178: for (auto s: c) candidates.push_back(s.c_str()); Chris@1178: return candidates; Chris@1178: } Chris@1178: Chris@1178: QString Chris@1178: PluginScan::getStartupFailureReport() const Chris@1178: { Chris@1178: if (!m_kp) return ""; //!!!??? Chris@1178: string report = m_kp->getFailureReport(); Chris@1178: return report.c_str(); //!!! wrap? Chris@1178: } Chris@1178: