fazekasgy@37: /* fazekasgy@37: fazekasgy@37: * Vampy : This plugin is a wrapper around the Vamp plugin API. fazekasgy@37: * It allows for writing Vamp plugins in Python. fazekasgy@37: fazekasgy@37: * Centre for Digital Music, Queen Mary University of London. fazekasgy@37: * Copyright (C) 2008-2009 Gyorgy Fazekas, QMUL. (See Vamp sources fazekasgy@37: * for licence information.) fazekasgy@37: fazekasgy@37: */ fazekasgy@37: fazekasgy@37: /* fazekasgy@37: Vamp fazekasgy@37: fazekasgy@37: An API for audio analysis and feature extraction plugins. fazekasgy@37: fazekasgy@37: Centre for Digital Music, Queen Mary, University of London. fazekasgy@37: Copyright 2006-2007 Chris Cannam and QMUL. fazekasgy@37: fazekasgy@37: Permission is hereby granted, free of charge, to any person fazekasgy@37: obtaining a copy of this software and associated documentation fazekasgy@37: files (the "Software"), to deal in the Software without fazekasgy@37: restriction, including without limitation the rights to use, copy, fazekasgy@37: modify, merge, publish, distribute, sublicense, and/or sell copies fazekasgy@37: of the Software, and to permit persons to whom the Software is fazekasgy@37: furnished to do so, subject to the following conditions: fazekasgy@37: fazekasgy@37: The above copyright notice and this permission notice shall be fazekasgy@37: included in all copies or substantial portions of the Software. fazekasgy@37: fazekasgy@37: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, fazekasgy@37: EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF fazekasgy@37: MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND fazekasgy@37: NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR fazekasgy@37: ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF fazekasgy@37: CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION fazekasgy@37: WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. fazekasgy@37: fazekasgy@37: Except as contained in this notice, the names of the Centre for fazekasgy@37: Digital Music; Queen Mary, University of London; and Chris Cannam fazekasgy@37: shall not be used in advertising or otherwise to promote the sale, fazekasgy@37: use or other dealings in this Software without prior written fazekasgy@37: authorization. fazekasgy@37: */ fazekasgy@37: fazekasgy@37: #ifndef _VAMP_PYPLUG_SCANNER_H_ fazekasgy@37: #define _VAMP_PYPLUG_SCANNER_H_ fazekasgy@37: fazekasgy@37: #include fazekasgy@37: #include fazekasgy@37: #include fazekasgy@37: #include fazekasgy@37: #include fazekasgy@37: //#include fazekasgy@37: fazekasgy@37: class PyPlugScanner fazekasgy@37: { fazekasgy@37: public: fazekasgy@37: ~PyPlugScanner() { m_hasInstance = false; } fazekasgy@37: static PyPlugScanner *getInstance(); fazekasgy@37: std::vector getPyPlugs(); fazekasgy@37: std::vector getPyClasses(); fazekasgy@37: void setPath(std::vector path); fazekasgy@37: std::vector getAllValidPath(); fazekasgy@37: fazekasgy@37: protected: fazekasgy@37: PyPlugScanner(); fazekasgy@37: PyObject *getScriptClass(std::string path, std::string classname); fazekasgy@37: std::vector listFiles(std::string dir, std::string ext); fazekasgy@37: void mergeFileLists(std::vector &s, std::vector &t); fazekasgy@37: fazekasgy@37: static bool m_hasInstance; fazekasgy@37: static PyPlugScanner *m_instance; fazekasgy@37: std::string m_dir; fazekasgy@37: std::vector m_path; fazekasgy@37: std::vector m_pyClasses; fazekasgy@37: }; fazekasgy@37: fazekasgy@37: #endif fazekasgy@37: