Mercurial > hg > vampy-host
comparison vampyhost.cpp @ 14:8565ec421f9c
Build fixes -- avoid undefined symbol VAMPY_ARRAY_API
author | Chris Cannam |
---|---|
date | Mon, 24 Nov 2014 10:11:46 +0000 |
parents | d0d91312e5a2 |
children | 8b264cabbc28 |
comparison
equal
deleted
inserted
replaced
13:628c84ed0ef6 | 14:8565ec421f9c |
---|---|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ | 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ |
2 | 2 |
3 //include for python extension module: must be first | 3 //include for python extension module: must be first |
4 #include <Python.h> | 4 #include <Python.h> |
5 | |
6 // define a unique API pointer | |
7 #define PY_ARRAY_UNIQUE_SYMBOL VAMPY_ARRAY_API | |
8 #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION | |
9 #include "numpy/arrayobject.h" | |
10 | |
5 #include <vampyhost.h> | 11 #include <vampyhost.h> |
6 | 12 |
7 #include <PyRealTime.h> | 13 #include "PyTypeConversions.h" |
14 #include "PyRealTime.h" | |
8 | 15 |
9 //!!! NB all our NumPy stuff is currently using the deprecated API -- | 16 //!!! NB all our NumPy stuff is currently using the deprecated API -- |
10 //!!! need to work out how to update this | 17 //!!! need to work out how to update this |
11 //#include "numpy/arrayobject.h" | 18 //#include "numpy/arrayobject.h" |
12 | 19 |
13 #define HAVE_NUMPY 1 // Required | 20 #define HAVE_NUMPY 1 // Required |
14 | |
15 #include "PyTypeConversions.h" | |
16 | 21 |
17 //includes for vamp host | 22 //includes for vamp host |
18 #include "vamp-hostsdk/Plugin.h" | 23 #include "vamp-hostsdk/Plugin.h" |
19 #include "vamp-hostsdk/PluginHostAdapter.h" | 24 #include "vamp-hostsdk/PluginHostAdapter.h" |
20 #include "vamp-hostsdk/PluginChannelAdapter.h" | 25 #include "vamp-hostsdk/PluginChannelAdapter.h" |
624 }; | 629 }; |
625 | 630 |
626 //Documentation for our new module | 631 //Documentation for our new module |
627 PyDoc_STRVAR(module_doc, "This is a template module just for instruction."); | 632 PyDoc_STRVAR(module_doc, "This is a template module just for instruction."); |
628 | 633 |
634 | |
635 | |
629 /* Initialization function for the module (*must* be called initxx) */ | 636 /* Initialization function for the module (*must* be called initxx) */ |
630 | 637 |
631 //module initialization (includes extern C {...} as necessary) | 638 //module initialization (includes extern C {...} as necessary) |
632 PyMODINIT_FUNC | 639 PyMODINIT_FUNC |
633 initvampyhost(void) | 640 initvampyhost(void) |
644 | 651 |
645 /* Create the module and add the functions */ | 652 /* Create the module and add the functions */ |
646 m = Py_InitModule3("vampyhost", vampyhost_methods, module_doc); | 653 m = Py_InitModule3("vampyhost", vampyhost_methods, module_doc); |
647 if (m == NULL) return; | 654 if (m == NULL) return; |
648 | 655 |
656 import_array(); | |
657 | |
649 // PyModule_AddObject(m, "realtime", (PyObject *)&RealTime_Type); | 658 // PyModule_AddObject(m, "realtime", (PyObject *)&RealTime_Type); |
650 | 659 |
651 } | 660 } |