annotate PyRealTime.h @ 92:a6718f9fe942

If a module appears to redefine one of our own types, refuse to load it. Also clear out the class dict for all refused modules now, so that we don't get stale names on the next scan due to not having cleared the module on unload
author Chris Cannam
date Mon, 14 Jan 2019 16:19:44 +0000
parents f5c028376bf9
children
rev   line source
fazekasgy@37 1 /*
fazekasgy@37 2
fazekasgy@37 3 * Vampy : This plugin is a wrapper around the Vamp plugin API.
fazekasgy@37 4 * It allows for writing Vamp plugins in Python.
fazekasgy@37 5
fazekasgy@37 6 * Centre for Digital Music, Queen Mary University of London.
fazekasgy@37 7 * Copyright (C) 2008-2009 Gyorgy Fazekas, QMUL. (See Vamp sources
fazekasgy@37 8 * for licence information.)
fazekasgy@37 9
fazekasgy@37 10 */
fazekasgy@37 11
fazekasgy@37 12 #ifndef _PYREALTIME_H_
fazekasgy@37 13 #define _PYREALTIME_H_
fazekasgy@37 14
fazekasgy@37 15 #include "vamp-sdk/Plugin.h"
fazekasgy@37 16
fazekasgy@37 17 typedef struct {
fazekasgy@37 18 PyObject_HEAD
fazekasgy@37 19 Vamp::RealTime *rt;
fazekasgy@37 20 } RealTimeObject;
fazekasgy@37 21
Chris@79 22 extern PyTypeObject RealTime_Type;
fazekasgy@37 23
fazekasgy@37 24 #define PyRealTime_CheckExact(v) ((v)->ob_type == &RealTime_Type)
fazekasgy@37 25 #define PyRealTime_Check(v) PyObject_TypeCheck(v, &RealTime_Type)
fazekasgy@37 26 ///fast macro version as per API convention
fazekasgy@37 27 #define PyRealTime_AS_REALTIME(v) ((const RealTimeObject* const) (v))->rt
fazekasgy@37 28
fazekasgy@37 29 /* PyRealTime C++ API */
fazekasgy@37 30
fazekasgy@37 31
Chris@79 32 extern PyObject *
fazekasgy@37 33 PyRealTime_FromRealTime(Vamp::RealTime&);
fazekasgy@37 34
Chris@79 35 extern const Vamp::RealTime*
fazekasgy@37 36 PyRealTime_AsRealTime (PyObject *self);
fazekasgy@37 37
fazekasgy@37 38
fazekasgy@37 39 #endif