Update of /cvsroot/pure-data/externals/grill/flext/source
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16839/source
Modified Files:
flclass.h fldsp.cpp fldsp.h flout.cpp flqueue.cpp flstdc.h
flsupport.h
Log Message:
minor updates
adapted the queue stuff to work with the new set_callback functionality
reconsidered flext::buffer:Update
added object construction and destruction flags
updated autoconf system
small updates
better templates, some minor changes
update for linux
cleanups
Index: flout.cpp
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/flext/source/flout.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** flout.cpp 17 Dec 2004 05:01:18 -0000 1.19
--- flout.cpp 8 Jan 2005 04:58:30 -0000 1.20
***************
*** 63,67 ****
#if defined(FLEXT_THREADS)
! #if defined(FLEXT_QTHR)
#define CHKTHR() (IsSystemThread() || IsThread(flext::thrmsgid))
#else
--- 63,67 ----
#if defined(FLEXT_THREADS)
! #if FLEXT_QMODE == 2
#define CHKTHR() (IsSystemThread() || IsThread(flext::thrmsgid))
#else
Index: flqueue.cpp
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/flext/source/flqueue.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** flqueue.cpp 17 Dec 2004 05:01:18 -0000 1.22
--- flqueue.cpp 8 Jan 2005 04:58:30 -0000 1.23
***************
*** 26,30 ****
#endif
-
#define QUEUE_LENGTH 2048
#define QUEUE_ATOMS 8192
--- 26,29 ----
***************
*** 204,210 ****
! #ifdef FLEXT_QTHR
static flext::ThrCond qthrcond;
! #else
static t_qelem *qclk = NULL;
#endif
--- 203,209 ----
! #if FLEXT_QMODE == 2
static flext::ThrCond qthrcond;
! #elif FLEXT_QMODE == 0
static t_qelem *qclk = NULL;
#endif
***************
*** 223,227 ****
if(!qc) break;
! #ifdef FLEXT_QTHR
if(syslock) sys_lock();
#endif
--- 222,226 ----
if(!qc) break;
! #if FLEXT_QMODE == 2
if(syslock) sys_lock();
#endif
***************
*** 233,237 ****
} // inner loop
! #ifdef FLEXT_QTHR
if(syslock) sys_unlock();
#endif
--- 232,236 ----
} // inner loop
! #if FLEXT_QMODE == 2
if(syslock) sys_unlock();
#endif
***************
*** 240,244 ****
}
! #if !defined(FLEXT_QTHR)
#if FLEXT_SYS == FLEXT_SYS_JMAX
static void QTick(fts_object_t *c,int winlet, fts_symbol_t s, int ac, const fts_atom_t *at)
--- 239,243 ----
}
! #if FLEXT_QMODE == 0
#if FLEXT_SYS == FLEXT_SYS_JMAX
static void QTick(fts_object_t *c,int winlet, fts_symbol_t s, int ac, const fts_atom_t *at)
***************
*** 253,256 ****
--- 252,266 ----
QWork(false);
}
+
+ #elif FLEXT_QMODE == 1
+ static t_int QTick(t_int *)
+ {
+ QWork(false);
+ #ifdef FLEXT_SHARED
+ return 1;
+ #else
+ return 0;
+ #endif
+ }
#endif
***************
*** 274,288 ****
{
#if FLEXT_SYS == FLEXT_SYS_PD
! #ifdef FLEXT_QTHR
// wake up worker thread
qthrcond.Signal();
! #else
clock_delay(qclk,0);
#endif
#elif FLEXT_SYS == FLEXT_SYS_MAX
! qelem_set(qclk);
#elif FLEXT_SYS == FLEXT_SYS_JMAX
! // this is dangerous because there may be other timers on this object!
! fts_timebase_add_call(fts_get_timebase(), (fts_object_t *)thisHdr(), QTick, NULL, 0);
#else
#error Not implemented
--- 284,304 ----
{
#if FLEXT_SYS == FLEXT_SYS_PD
! #if FLEXT_QMODE == 2
// wake up worker thread
qthrcond.Signal();
! #elif FLEXT_QMODE == 1 && !defined(FLEXT_SHARED)
! set_callback(QTick,NULL,0);
! #elif FLEXT_QMODE == 0
clock_delay(qclk,0);
#endif
#elif FLEXT_SYS == FLEXT_SYS_MAX
! #if FLEXT_QMODE == 0
! qelem_set(qclk);
! #endif
#elif FLEXT_SYS == FLEXT_SYS_JMAX
! #if FLEXT_QMODE == 0
! // this is dangerous because there may be other timers on this object!
! fts_timebase_add_call(fts_get_timebase(), (fts_object_t *)thisHdr(), QTick, NULL, 0);
! #endif
#else
#error Not implemented
***************
*** 290,294 ****
}
! #ifdef FLEXT_QTHR
void flext_base::QWorker(thr_params *)
{
--- 306,310 ----
}
! #if FLEXT_QMODE == 2
void flext_base::QWorker(thr_params *)
{
***************
*** 307,319 ****
else started = true;
! #ifdef FLEXT_QTHR
LaunchThread(QWorker,NULL);
! #else
! #if FLEXT_SYS == FLEXT_SYS_PD || FLEXT_SYS == FLEXT_SYS_MAX
qclk = (t_qelem *)(qelem_new(NULL,(t_method)QTick));
#else
#error Not implemented!
#endif
- #endif
}
--- 323,337 ----
else started = true;
! #if FLEXT_QMODE == 1
! #ifdef FLEXT_SHARED
! set_callback(QTick,NULL,0);
! #endif
! #elif FLEXT_QMODE == 2
LaunchThread(QWorker,NULL);
! #elif FLEXT_QMODE == 0 && (FLEXT_SYS == FLEXT_SYS_PD || FLEXT_SYS == FLEXT_SYS_MAX)
qclk = (t_qelem *)(qelem_new(NULL,(t_method)QTick));
#else
#error Not implemented!
#endif
}
Index: flstdc.h
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/flext/source/flstdc.h,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** flstdc.h 6 Jan 2005 04:59:05 -0000 1.31
--- flstdc.h 8 Jan 2005 04:58:31 -0000 1.32
***************
*** 282,287 ****
// ----- set message queue mode -----
- #undef FLEXT_QTHR
-
#if FLEXT_SYS == FLEXT_SYS_PD && PD_MINOR_VERSION >= 37
// for PD version >= 0.37test10 FLEXT_PDLOCK is standard
--- 282,285 ----
***************
*** 290,305 ****
#endif
! #ifdef FLEXT_PDLOCK
// new PD thread locking functionality shall be used
#if FLEXT_SYS == FLEXT_SYS_PD
#ifdef FLEXT_THREADS
// can only be used with PD and threaded build
! #define FLEXT_QTHR
#endif
#else
#error FLEXT_PDLOCK can only be defined with PD
#endif
#endif
#endif
--- 288,313 ----
#endif
! #if FLEXT_SYS == FLEXT_SYS_PD && PD_MINOR_VERSION >= 38 && defined(PD_DEVEL_VERSION)
! // use idle callback
! #define FLEXT_QMODE 1
! #elif defined(FLEXT_PDLOCK)
// new PD thread locking functionality shall be used
#if FLEXT_SYS == FLEXT_SYS_PD
#ifdef FLEXT_THREADS
// can only be used with PD and threaded build
! #define FLEXT_QMODE 2
! #else
! #define FLEXT_QMODE 0
#endif
#else
#error FLEXT_PDLOCK can only be defined with PD
#endif
+ #else
+ #define FLEXT_QMODE 0
#endif
+ #ifndef FLEXT_QMODE
+ #error Internal error: Queueing mode not defined
+ #endif
#endif
Index: flsupport.h
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/flext/source/flsupport.h,v
retrieving revision 1.74
retrieving revision 1.75
diff -C2 -d -r1.74 -r1.75
*** flsupport.h 6 Jan 2005 04:59:05 -0000 1.74
--- flsupport.h 8 Jan 2005 04:58:31 -0000 1.75
***************
*** 3,7 ****
flext - C++ layer for Max/MSP and pd (pure data) externals
! Copyright (c) 2001-2004 Thomas Grill (xovo(a)gmx.net)
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.
--- 3,7 ----
flext - C++ layer for Max/MSP and pd (pure data) externals
! Copyright (c) 2001-2005 Thomas Grill (gr(a)grrrr.org)
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.
***************
*** 226,230 ****
//! Get symbol of buffer
! t_symbol *Symbol() const { return const_cast<t_symbol *>(sym); }
//! Get literal name of buffer
--- 226,230 ----
//! Get symbol of buffer
! const t_symbol *Symbol() const { return sym; }
//! Get literal name of buffer
Index: fldsp.cpp
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/flext/source/fldsp.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** fldsp.cpp 16 Dec 2004 05:01:06 -0000 1.22
--- fldsp.cpp 8 Jan 2005 04:58:30 -0000 1.23
***************
*** 49,63 ****
srate(sys_getsr()),blksz(sys_getblksize()),
#endif
- #if FLEXT_SYS == FLEXT_SYS_PD
- chnsin(sys_get_inchannels()),
- chnsout(sys_get_outchannels()),
- #elif FLEXT_SYS == FLEXT_SYS_MAX
- chnsin(0),chnsout(0),
- #elif FLEXT_SYS == FLEXT_SYS_JMAX
- #pragma message("not implemented")
chnsin(0),chnsout(0),
- #else
- #error
- #endif
#if FLEXT_SYS != FLEXT_SYS_MAX
dspon(true),
--- 49,53 ----
***************
*** 77,80 ****
--- 67,73 ----
#endif
+ if(invecs) delete[] invecs;
+ if(outvecs) delete[] outvecs;
+
/*
#if FLEXT_SYS == FLEXT_SYS_MAX
***************
*** 139,154 ****
#endif
- /*
- #if FLEXT_SYS == FLEXT_SYS_PD
- obj->chnsin = sys_get_inchannels();
- obj->chnsout = sys_get_outchannels();
- #elif FLEXT_SYS == FLEXT_SYS_MAX
- obj->chnsin = obj->chnsout = sys_getch();
- #elif FLEXT_SYS == FLEXT_SYS_JMAX
- #pragma message ("How to query the channels?")
- #else
- #error
- #endif
- */
// store in and out signal vectors
int i;
--- 132,135 ----
Index: fldsp.h
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/flext/source/fldsp.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** fldsp.h 5 Aug 2003 02:32:31 -0000 1.10
--- fldsp.h 8 Jan 2005 04:58:30 -0000 1.11
***************
*** 51,55 ****
//! returns current block (aka vector) size
int Blocksize() const { return blksz; }
!
/*! \brief returns number of audio system input channels
\bug Doesn't work in Max/MSP - is always 0
--- 51,55 ----
//! returns current block (aka vector) size
int Blocksize() const { return blksz; }
!
/*! \brief returns number of audio system input channels
\bug Doesn't work in Max/MSP - is always 0
***************
*** 61,65 ****
*/
int ChannelsOut() const { return chnsout; }
!
//! typedef describing a signal vector
#if FLEXT_SYS == FLEXT_SYS_JMAX
--- 61,65 ----
*/
int ChannelsOut() const { return chnsout; }
!
//! typedef describing a signal vector
#if FLEXT_SYS == FLEXT_SYS_JMAX
Index: flclass.h
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/flext/source/flclass.h,v
retrieving revision 1.48
retrieving revision 1.49
diff -C2 -d -r1.48 -r1.49
*** flclass.h 17 Dec 2004 05:01:17 -0000 1.48
--- flclass.h 8 Jan 2005 04:58:30 -0000 1.49
***************
*** 855,859 ****
//! Start message queue
static void StartQueue();
! #ifdef FLEXT_QTHR
//! Queue worker function
static void QWorker(thr_params *);
--- 855,859 ----
//! Start message queue
static void StartQueue();
! #if FLEXT_QMODE == 2
//! Queue worker function
static void QWorker(thr_params *);