comparison PyExtensionModule.h @ 37:27bab3a16c9a vampy2final

new branch Vampy2final
author fazekasgy
date Mon, 05 Oct 2009 11:28:00 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 37:27bab3a16c9a
1 /*
2
3 * Vampy : This plugin is a wrapper around the Vamp plugin API.
4 * It allows for writing Vamp plugins in Python.
5
6 * Centre for Digital Music, Queen Mary University of London.
7 * Copyright (C) 2008-2009 Gyorgy Fazekas, QMUL. (See Vamp sources
8 * for licence information.)
9
10 */
11
12 #ifndef _PYEXTENSIONMODULE_H_
13 #define _PYEXTENSIONMODULE_H_
14
15 #include <Python.h>
16 #include <limits.h>
17 #include "PyRealTime.h"
18 #include "PyFeature.h"
19 #include "PyFeatureSet.h"
20 #include "PyParameterDescriptor.h"
21 #include "PyOutputDescriptor.h"
22
23 #ifndef UINT_MAX
24 #define UINT_MAX ((unsigned int) -1)
25 #endif
26 #define UINT_MAXD ((double) UINT_MAX)
27 /* long error() { std::cerr << "type error" << std::endl; return 0; } */
28 #define _dbl2uint(x) ((x) < 0 || (x) > UINT_MAXD ? 0 : (unsigned int)(x)+0.5)
29 #define _long2uint(x) ((x) < 0 || (x) > UINT_MAXD ? 0 : (unsigned int)(x))
30
31 using std::string;
32 using std::vector;
33
34 enum eVampyFlags {
35 vf_NULL = 0,
36 vf_DEBUG = 1,
37 vf_STRICT = 2,
38 vf_QUIT = 4,
39 vf_REALTIME = 8,
40 vf_BUFFER = 16,
41 vf_ARRAY = 32,
42 vf_DEFAULT_V2 = (32 | 8)
43 };
44
45 #define PyDescriptor_Check(v) ((v)->ob_type == &Feature_Type) || ((v)->ob_type == &OutputDescriptor_Type) || ((v)->ob_type == &ParameterDescriptor_Type)
46
47 #ifndef PyMODINIT_FUNC
48 #define PyMODINIT_FUNC void
49 #endif
50
51 PyMODINIT_FUNC initvampy();
52
53 #endif