changeset 70:6c755f3e1173

More fixes
author Chris Cannam
date Mon, 17 Nov 2014 14:07:00 +0000
parents f5b8646494d2
children 40a01bb24209 d8eaa10e153e
files Example VamPy plugins/PySpectralCentroid.py Makefile.osx PyPlugScanner.cpp PyTypeInterface.cpp README vampy-main.cpp
diffstat 6 files changed, 11 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/Example VamPy plugins/PySpectralCentroid.py	Mon Nov 17 12:53:51 2014 +0000
+++ b/Example VamPy plugins/PySpectralCentroid.py	Mon Nov 17 14:07:00 2014 +0000
@@ -35,7 +35,6 @@
 class PySpectralCentroid: 
 	
 	def __init__(self,inputSampleRate): 
-		self.m_imputSampleRate = 0.0 
 		self.m_stepSize = 0
 		self.m_blockSize = 0
 		self.m_channels = 0
--- a/Makefile.osx	Mon Nov 17 12:53:51 2014 +0000
+++ b/Makefile.osx	Mon Nov 17 14:07:00 2014 +0000
@@ -1,7 +1,7 @@
 
-CXXFLAGS	:= -D_DEBUG -DHAVE_NUMPY -I../vamp-plugin-sdk -O2 -Wall -I/usr/include/python2.5 -I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/core/include/
+CXXFLAGS	:= -DHAVE_NUMPY -mmacosx-version-min=10.6 -I../vamp-plugin-sdk -O2 -Wall -I/usr/include/python2.7 -I/usr/local/lib/python2.7/site-packages/numpy/core/include
 
-LDFLAGS		:= -install_name vampy.dylib -exported_symbols_list vamp-plugin.list ../vamp-plugin-sdk/libvamp-sdk.a -dynamiclib -lpython2.5 -lpthread
+LDFLAGS		:= -install_name vampy.dylib -exported_symbols_list vamp-plugin.list -mmacosx-version-min=10.6 ../vamp-plugin-sdk/libvamp-sdk.a -dynamiclib -lpython2.7 -lpthread
 
 default: vampy.dylib 
 all: vampy.dylib vampymod.so
--- a/PyPlugScanner.cpp	Mon Nov 17 12:53:51 2014 +0000
+++ b/PyPlugScanner.cpp	Mon Nov 17 14:07:00 2014 +0000
@@ -153,7 +153,7 @@
 	//Import it as a module into the py interpreter
 	PyObject *pyModule = PyImport_Import(pySource);
 	PyObject* pyError = PyErr_Occurred();
-	if (! pyError == 0) { 
+	if (pyError) { 
 		cerr << "ERROR: error importing source: " << classname << endl; 
 		PyErr_Print(); 
 		Py_DECREF(pySource); 
--- a/PyTypeInterface.cpp	Mon Nov 17 12:53:51 2014 +0000
+++ b/PyTypeInterface.cpp	Mon Nov 17 14:07:00 2014 +0000
@@ -182,11 +182,16 @@
 			setValueError("Error while converting integer object.",m_strict);
 			return 0;
 		}
+		// this test is nonsense -- neither part can occur
+		// owing to range of data types -- size_t is at least
+		// as big as long, and unsigned is always non-negative
+/*
 		if ((unsigned long)rValue > SIZE_T_MAX || (unsigned long)rValue < 0)
 		{
 			setValueError("Overflow error. Object can not be converted to size_t.",m_strict);
 			return 0;
 		}
+*/
 		return (size_t) rValue;
 	}
 	
@@ -717,7 +722,7 @@
 		std::string msg = "NumPy array must be a one dimensional vector.";
 		setValueError(msg,m_strict);
 #ifdef _DEBUG
-		cerr << "PyTypeInterface::PyArray_To_FloatVector failed. Error: " << msg << " Dims: " << (int) pyArray->nd << endl;
+		cerr << "PyTypeInterface::PyArray_To_FloatVector failed. Error: " << msg << " Dims: " << (int) PyArray_NDIM(pyArray) << endl;
 #endif	
 		return Output;
 	}
--- a/README	Mon Nov 17 12:53:51 2014 +0000
+++ b/README	Mon Nov 17 14:07:00 2014 +0000
@@ -1,5 +1,5 @@
 
- *  Vampy is a wrapper for the Vamp audio analysis plugin API.
+*  Vampy is a wrapper for the Vamp audio analysis plugin API.
 	(http://www.vamp-plugins.org/) It allows for writing Vamp 
 	plugins in Python.
 
--- a/vampy-main.cpp	Mon Nov 17 12:53:51 2014 +0000
+++ b/vampy-main.cpp	Mon Nov 17 14:07:00 2014 +0000
@@ -31,7 +31,7 @@
 // Vampy will not attempt to load a lower version than specified
 #ifdef HAVE_NUMPY
 #ifndef NUMPY_SHORTVERSION
-#define NUMPY_SHORTVERSION 1.1 
+#define NUMPY_SHORTVERSION 1.9
 #endif
 #endif