aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/py/source/main.h
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2005-03-13 04:59:47 +0000
committerThomas Grill <xovo@users.sourceforge.net>2005-03-13 04:59:47 +0000
commit3ce0fb7e8ad57909fadcd4072817d69bc54e3a66 (patch)
treef4d4478420cc9f34bf26835f2edc5bd03f95a86b /externals/grill/py/source/main.h
parent0e0bfeecb60ffa25d997830553685482c666b7ba (diff)
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
Diffstat (limited to 'externals/grill/py/source/main.h')
-rw-r--r--externals/grill/py/source/main.h47
1 files changed, 15 insertions, 32 deletions
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<FifoEl> 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