From 3ce0fb7e8ad57909fadcd4072817d69bc54e3a66 Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Sun, 13 Mar 2005 04:59:47 +0000 Subject: pydsp: share dsp buffer objects at inplace operation DSP support for py/pyext: new objects pyext~,pyx~,pyext.~,pyx.~ new base class for py and pyext classes preset sys.argv for module loading support for buffer objects (preliminary) py: bang in left inlet now really triggers without arguments fixes for detached operation and single-threaded version little restructuring adjust pd and py files for correct argument passing more optimizations update for new flext callback naming use lock count instead of message queuing to avoid py->py messaging deadlock pyext: fix for inlet count svn path=/trunk/; revision=2624 --- externals/grill/py/source/main.h | 47 +++++++++++++--------------------------- 1 file changed, 15 insertions(+), 32 deletions(-) (limited to 'externals/grill/py/source/main.h') diff --git a/externals/grill/py/source/main.h b/externals/grill/py/source/main.h index 7079dc2f..c76d43fa 100644 --- a/externals/grill/py/source/main.h +++ b/externals/grill/py/source/main.h @@ -41,23 +41,25 @@ public: typedef PooledFifo PyFifo; -class py: - public flext_base -{ - FLEXT_HEADER_S(py,flext_base,Setup) +class pybase + : public flext +{ public: - py(); - ~py(); - static void lib_setup(); + pybase(); + virtual ~pybase(); - virtual void Exit(); + void Exit(); static PyObject *MakePyArgs(const t_symbol *s,int argc,const t_atom *argv,int inlet = -1,bool withself = false); static AtomList *GetPyArgs(PyObject *pValue,PyObject **self = NULL); + static void lib_setup(); + protected: + virtual void DumpOut(const t_symbol *sym,int argc,const t_atom *argv) = 0; + void m__dir(PyObject *obj); void m__doc(PyObject *obj); @@ -83,12 +85,15 @@ protected: void Reregister(const char *reg); virtual void Reload() = 0; + void OpenEditor(); void Respond(bool b); static bool IsAnything(const t_symbol *s) { return s && s != sym_float && s != sym_int && s != sym_symbol && s != sym_list && s != sym_pointer; } enum retval { nothing,atom,sequ }; + static PyObject *emptytuple; + // --- module stuff ----- static PyObject *module_obj,*module_dict; @@ -131,6 +136,7 @@ protected: int detach; bool gencall(PyObject *fun,PyObject *args); + virtual bool thrcall(void *data) = 0; virtual bool callpy(PyObject *fun,PyObject *args) = 0; #if FLEXT_SYS == FLEXT_SYS_MAX @@ -139,7 +145,7 @@ protected: static bool collect(); -private: +protected: void work_wrapper(void *data); @@ -151,10 +157,6 @@ private: static PyThreadState *FindThreadState(); static void FreeThreadState(); - - FLEXT_THREAD_X(work_wrapper) -#else - FLEXT_CALLBACK_X(work_wrapper) #endif public: @@ -189,25 +191,6 @@ public: #endif static PyObject* StdOut_Write(PyObject* Self, PyObject* Args); - -protected: - - virtual void m_click(); - - static void Setup(t_classid c); - - // callbacks - FLEXT_ATTRVAR_I(detach) - FLEXT_ATTRVAR_B(respond) - FLEXT_CALLBACK_V(m_stop) - FLEXT_CALLBACK(m_dir) - FLEXT_CALLGET_V(mg_dir) - FLEXT_CALLBACK(m_doc) - -#ifdef FLEXT_THREADS - FLEXT_CALLBACK_T(tick) - FLEXT_THREAD(threadworker) -#endif }; #endif -- cgit v1.2.1