comparison PyPlugScanner.h @ 0:e20e214bdfb5

Added VAMP-Python binding project vampy
author fazekasgy
date Tue, 11 Mar 2008 19:47:34 +0000
parents
children 134313c59d82
comparison
equal deleted inserted replaced
-1:000000000000 0:e20e214bdfb5
1 /*
2 Vamp
3
4 An API for audio analysis and feature extraction plugins.
5
6 Centre for Digital Music, Queen Mary, University of London.
7 Copyright 2006-2007 Chris Cannam and QMUL.
8
9 Permission is hereby granted, free of charge, to any person
10 obtaining a copy of this software and associated documentation
11 files (the "Software"), to deal in the Software without
12 restriction, including without limitation the rights to use, copy,
13 modify, merge, publish, distribute, sublicense, and/or sell copies
14 of the Software, and to permit persons to whom the Software is
15 furnished to do so, subject to the following conditions:
16
17 The above copyright notice and this permission notice shall be
18 included in all copies or substantial portions of the Software.
19
20 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
24 ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
25 CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27
28 Except as contained in this notice, the names of the Centre for
29 Digital Music; Queen Mary, University of London; and Chris Cannam
30 shall not be used in advertising or otherwise to promote the sale,
31 use or other dealings in this Software without prior written
32 authorization.
33 */
34
35
36 /*
37 Objective: We want to find available pyVamp plugins here
38 Future: We may have multiple plugins per script
39 */
40
41 #ifndef _VAMP_PYPLUG_SCANNER_H_
42 #define _VAMP_PYPLUG_SCANNER_H_
43
44 #include "/usr/include/python/Python.h"
45 #include <iostream>
46 #include <vector>
47 #include <string>
48 #include <map>
49 //#include <fstream>
50
51 class PyPlugScanner
52 {
53 public:
54 ~PyPlugScanner() { m_hasInstance = false; }
55 static PyPlugScanner *getInstance();
56 std::vector<std::string> getPyPlugs();
57 std::vector<PyObject*> getPyInstances();
58 void setPath(std::vector<std::string> path);
59 std::vector<std::string> getAllValidPath();
60
61 protected:
62 PyPlugScanner();
63 PyObject *getScriptInstance(std::string path, std::string classname);
64 std::vector<std::string> listFiles(std::string dir, std::string ext);
65 static bool m_hasInstance;
66 static PyPlugScanner *m_instance;
67 std::string m_dir;
68 std::vector<std::string> m_path;
69 std::vector<PyObject*> m_pyInstances;
70 };
71
72 #endif
73