comparison PyTypeInterface.cpp @ 34:c905122f79e7 vampy2

* Fixes from OpenSolaris build
author cannam
date Wed, 23 Sep 2009 12:07:32 +0000
parents c4da8d559872
children 2ba482378038
comparison
equal deleted inserted replaced
33:c4da8d559872 34:c905122f79e7
702 } 702 }
703 // Py_CLEAR(pyOutputList); 703 // Py_CLEAR(pyOutputList);
704 return rFeatureSet; 704 return rFeatureSet;
705 } 705 }
706 706
707 Vamp::RealTime::RealTime 707 Vamp::RealTime
708 PyTypeInterface::PyValue_To_RealTime(PyObject* pyValue) const 708 PyTypeInterface::PyValue_To_RealTime(PyObject* pyValue) const
709 { 709 {
710 // We accept integer sample counts (for backwards compatibility) 710 // We accept integer sample counts (for backwards compatibility)
711 // or PyRealTime objects and convert them to Vamp::RealTime 711 // or PyRealTime objects and convert them to Vamp::RealTime
712 712
714 { 714 {
715 #ifdef _DEBUG 715 #ifdef _DEBUG
716 cerr << "Converting from PyRealTime" << endl; 716 cerr << "Converting from PyRealTime" << endl;
717 #endif 717 #endif
718 /// just create a copy of the wrapped object 718 /// just create a copy of the wrapped object
719 return Vamp::RealTime::RealTime( 719 return Vamp::RealTime(
720 *PyRealTime_AS_REALTIME(pyValue)); 720 *PyRealTime_AS_REALTIME(pyValue));
721 } 721 }
722 // assume integer sample count 722 // assume integer sample count
723 long sampleCount = PyLong_AsLong(pyValue); 723 long sampleCount = PyLong_AsLong(pyValue);
724 if (PyErr_Occurred()) 724 if (PyErr_Occurred())
725 { 725 {
726 PyErr_Print(); PyErr_Clear(); 726 PyErr_Print(); PyErr_Clear();
727 setValueError("Error while converting integer to RealTime.",m_strict); 727 setValueError("Error while converting integer to RealTime.",m_strict);
728 return Vamp::RealTime::RealTime(); 728 return Vamp::RealTime();
729 } 729 }
730 #ifdef _DEBUG 730 #ifdef _DEBUG
731 Vamp::RealTime::RealTime rt = 731 Vamp::RealTime rt =
732 Vamp::RealTime::frame2RealTime(sampleCount,m_inputSampleRate ); 732 Vamp::RealTime::frame2RealTime(sampleCount,m_inputSampleRate );
733 cerr << "RealTime: " << (long)sampleCount << ", ->" << rt.toString() << endl; 733 cerr << "RealTime: " << (long)sampleCount << ", ->" << rt.toString() << endl;
734 return rt; 734 return rt;
735 #else 735 #else
736 return Vamp::RealTime::frame2RealTime(sampleCount,m_inputSampleRate ); 736 return Vamp::RealTime::frame2RealTime(sampleCount,m_inputSampleRate );