diff options
Diffstat (limited to 'externals/grill/py/source/main.cpp')
-rw-r--r-- | externals/grill/py/source/main.cpp | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/externals/grill/py/source/main.cpp b/externals/grill/py/source/main.cpp index 01dc0afa..c24f998c 100644 --- a/externals/grill/py/source/main.cpp +++ b/externals/grill/py/source/main.cpp @@ -60,6 +60,7 @@ void py::FreeThreadState() void initsymbol(); +void initsamplebuffer(); void py::lib_setup() { @@ -69,12 +70,11 @@ void py::lib_setup() post("(C)2002-2005 Thomas Grill - http://grrrr.org/ext"); post(""); post("using Python %s",Py_GetVersion()); + #ifdef FLEXT_DEBUG post(""); post("DEBUG version compiled on %s %s",__DATE__,__TIME__); #endif - post("------------------------------------------------"); - post(""); // ------------------------------------------------------------- @@ -115,6 +115,10 @@ void py::lib_setup() PyModule_AddObject(module_obj,"_s_float",(PyObject *)pySymbol_float); PyModule_AddObject(module_obj,"_s_int",(PyObject *)pySymbol_int); + // add samplebuffer type + initsamplebuffer(); + PyModule_AddObject(module_obj,"Buffer",(PyObject *)&pySamplebuffer_Type); + // redirect stdout PyObject* py_out; py_out = Py_InitModule("stdout", StdOut_Methods); @@ -138,6 +142,9 @@ void py::lib_setup() // release global lock PyEval_ReleaseLock(); #endif + + post("------------------------------------------------"); + post(""); } FLEXT_LIB_SETUP(py,py::lib_setup) @@ -189,12 +196,14 @@ void py::Exit() qucond.Signal(); if(thrcount) { // Wait for a certain time - for(int i = 0; i < (PY_STOP_WAIT/PY_STOP_TICK) && thrcount; ++i) Sleep(PY_STOP_TICK/1000.f); - - // Wait forever - post("%s - Waiting for thread termination!",thisName()); - while(thrcount) Sleep(PY_STOP_TICK/1000.f); - post("%s - Okay, all threads have terminated",thisName()); + for(int i = 0; i < (PY_STOP_WAIT/PY_STOP_TICK) && thrcount; ++i) + Sleep(PY_STOP_TICK*0.001f); + if(thrcount) { + // Wait forever + post("%s - Waiting for thread termination!",thisName()); + while(thrcount) Sleep(PY_STOP_TICK*0.001f); + post("%s - Okay, all threads have terminated",thisName()); + } } #endif flext_base::Exit(); |