[PD-cvs] externals/grill/flext/source flclass.h,1.51,1.52 fldsp.cpp,1.26,1.27 fldsp.h,1.13,1.14 flext.cpp,1.32,1.33 flmsg.cpp,1.13,1.14 flprefix.h,1.31,1.32 flproxy.cpp,1.8,1.9 flqueue.cpp,1.30,1.31 flsupport.h,1.80,1.81 flthr.cpp,1.28,1.29

Thomas Grill xovo at users.sourceforge.net
Sun Mar 13 05:56:42 CET 2005


Update of /cvsroot/pure-data/externals/grill/flext/source
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29295/source

Modified Files:
	flclass.h fldsp.cpp fldsp.h flext.cpp flmsg.cpp flprefix.h 
	flproxy.cpp flqueue.cpp flsupport.h flthr.cpp 
Log Message:
fixes for attribute editor (to deal with large dialogs)
fix for gcc strangeness
eliminated ChannelsIn/ChannelsOut
moved ShouldExit to flext namespace
new naming for some virtual callback functions
fix for flext_dsp @ Max


Index: flqueue.cpp
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/flext/source/flqueue.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** flqueue.cpp	8 Mar 2005 04:57:17 -0000	1.30
--- flqueue.cpp	13 Mar 2005 04:56:39 -0000	1.31
***************
*** 48,52 ****
          if(out < 0)
              // message to self
!             th->m_methodmain(-1-out,msg.Header(),msg.Count(),msg.Atoms()); 
          else
              // message to outlet
--- 48,52 ----
          if(out < 0)
              // message to self
!             th->CbMethodHandler(-1-out,msg.Header(),msg.Count(),msg.Atoms()); 
          else
              // message to outlet

Index: flprefix.h
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/flext/source/flprefix.h,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** flprefix.h	12 Mar 2005 04:56:34 -0000	1.31
--- flprefix.h	13 Mar 2005 04:56:39 -0000	1.32
***************
*** 222,226 ****
  
      #ifndef FLEXT_CPU
!         #if defined(_X86_64_) // not sure about this one
              #define FLEXT_CPU FLEXT_CPU_X86_64
          #elif defined(_X86_) || defined(__i386__) || defined(__i586__) || defined(__i686__)
--- 222,226 ----
  
      #ifndef FLEXT_CPU
!         #if defined(__x86_64__) // not sure about this one
              #define FLEXT_CPU FLEXT_CPU_X86_64
          #elif defined(_X86_) || defined(__i386__) || defined(__i586__) || defined(__i686__)
***************
*** 340,352 ****
  
  // ----- set threading model -----
! // shared builds are always threaded (although this not be so....)
  #ifdef FLEXT_SHARED
      #undef FLEXT_THREADS
      #define FLEXT_THREADS
- /*
-     // and also enabled for virtual daughter-classes??
-     #undef FLEXT_VIRT
-     #define FLEXT_VIRT
- */
  #endif
  
--- 340,347 ----
  
  // ----- set threading model -----
! // shared builds are always threaded
  #ifdef FLEXT_SHARED
      #undef FLEXT_THREADS
      #define FLEXT_THREADS
  #endif
  

Index: flthr.cpp
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/flext/source/flthr.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** flthr.cpp	12 Mar 2005 04:56:35 -0000	1.28
--- flthr.cpp	13 Mar 2005 04:56:40 -0000	1.29
***************
*** 321,328 ****
  }
  
! bool flext_base::ShouldExit() const 
  {
!     thr_entry *fnd = thrstopped.Find(GetThreadId());
!     return fnd != NULL;
  }
  
--- 321,327 ----
  }
  
! bool flext::ShouldExit() 
  {
!     return thrstopped.Find(GetThreadId()) != NULL;
  }
  

Index: flsupport.h
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/flext/source/flsupport.h,v
retrieving revision 1.80
retrieving revision 1.81
diff -C2 -d -r1.80 -r1.81
*** flsupport.h	12 Mar 2005 04:56:34 -0000	1.80
--- flsupport.h	13 Mar 2005 04:56:39 -0000	1.81
***************
*** 742,746 ****
  	*/
  	static thrid_t GetSysThreadId();
! 	
  	//! Check if current thread is the realtime system's thread
  	static bool IsThread(thrid_t t,thrid_t ref = GetThreadId()) { 
--- 742,749 ----
  	*/
  	static thrid_t GetSysThreadId();
! 
! 	//! Check if current thread should terminate
! 	static bool ShouldExit();
! 
  	//! Check if current thread is the realtime system's thread
  	static bool IsThread(thrid_t t,thrid_t ref = GetThreadId()) { 

Index: flext.cpp
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/flext/source/flext.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** flext.cpp	26 Jan 2005 05:01:47 -0000	1.32
--- flext.cpp	13 Mar 2005 04:56:39 -0000	1.33
***************
*** 146,150 ****
  
  #if FLEXT_SYS == FLEXT_SYS_PD || FLEXT_SYS == FLEXT_SYS_MAX
-     add_method(c,cb_help,"help");
      add_loadbang(c,cb_loadbang);
  #if FLEXT_SYS == FLEXT_SYS_MAX
--- 146,149 ----
***************
*** 153,157 ****
  #endif
  #else
-     fts_class_message_varargs(c,MakeSymbol("help"),cb_help);
      #pragma message ("no implementation of loadbang or assist") 
  #endif
--- 152,155 ----
***************
*** 175,194 ****
  }
  
! #if FLEXT_SYS == FLEXT_SYS_JMAX
! void flext_base::cb_help(fts_object_t *c,int, fts_symbol_t, int, const fts_atom_t *) { thisObject(c)->m_help(); }   
! #else
! void flext_base::cb_help(t_class *c) { thisObject(c)->m_help(); }   
! void flext_base::cb_loadbang(t_class *c) { thisObject(c)->m_loadbang(); }   
  #endif
  
- void flext_base::m_help()
- {
-     // This should better be overloaded
-     post("%s (using flext " FLEXT_VERSTR ") - compiled on %s %s",thisName(),__DATE__,__TIME__);
- }
- 
  void flext_base::m_loadbang() {}
  
! void flext_base::m_click() {}
  
  #if FLEXT_SYS == FLEXT_SYS_PD
--- 173,184 ----
  }
  
! #if FLEXT_SYS != FLEXT_SYS_JMAX
! void flext_base::cb_loadbang(t_class *c) { thisObject(c)->CbLoadbang(); }   
  #endif
  
  void flext_base::m_loadbang() {}
+ void flext_base::CbLoadbang() { return m_loadbang(); }
  
! void flext_base::CbClick() {}
  
  #if FLEXT_SYS == FLEXT_SYS_PD
***************
*** 196,200 ****
  {
      if(doit && alt) {
!         thisObject(c)->m_click();
          return 1;
      }
--- 186,190 ----
  {
      if(doit && alt) {
!         thisObject(c)->CbClick();
          return 1;
      }
***************
*** 207,211 ****
  void flext_base::cb_click(t_class *c, Point pt, short mods)
  {
!     thisObject(c)->m_click();
  }
  
--- 197,201 ----
  void flext_base::cb_click(t_class *c, Point pt, short mods)
  {
!     thisObject(c)->CbClick();
  }
  

Index: flproxy.cpp
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/flext/source/flproxy.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** flproxy.cpp	26 Jan 2005 05:02:00 -0000	1.8
--- flproxy.cpp	13 Mar 2005 04:56:39 -0000	1.9
***************
*** 25,34 ****
  void flext_base::px_object::px_method(px_object *obj,const t_symbol *s,int argc,t_atom *argv)
  {
!     obj->base->m_methodmain(obj->index,s,argc,argv);
  }
  
  void flext_base::cb_px_anything(t_class *c,const t_symbol *s,int argc,t_atom *argv)
  {
!     thisObject(c)->m_methodmain(0,s,argc,argv);
  }
  
--- 25,34 ----
  void flext_base::px_object::px_method(px_object *obj,const t_symbol *s,int argc,t_atom *argv)
  {
!     obj->base->CbMethodHandler(obj->index,s,argc,argv);
  }
  
  void flext_base::cb_px_anything(t_class *c,const t_symbol *s,int argc,t_atom *argv)
  {
!     thisObject(c)->CbMethodHandler(0,s,argc,argv);
  }
  
***************
*** 36,40 ****
  void flext_base::cb_px_ft ## IX(t_class *c,float v) { \
      t_atom atom; SETFLOAT(&atom,v);  \
!     thisObject(c)->m_methodmain(IX,sym_float,1,&atom); \
  }
  
--- 36,40 ----
  void flext_base::cb_px_ft ## IX(t_class *c,float v) { \
      t_atom atom; SETFLOAT(&atom,v);  \
!     thisObject(c)->CbMethodHandler(IX,sym_float,1,&atom); \
  }
  
***************
*** 50,54 ****
      flext_base *o = thisObject(c);
      int ci = ((flext_hdr *)o->x_obj)->curinlet;
!     o->m_methodmain(ci,s,argc,argv);
  }
  
--- 50,54 ----
      flext_base *o = thisObject(c);
      int ci = ((flext_hdr *)o->x_obj)->curinlet;
!     o->CbMethodHandler(ci,s,argc,argv);
  }
  
***************
*** 63,67 ****
      t_atom atom;
      SetInt(atom,v);  
!     o->m_methodmain(ci,sym_int,1,&atom);
  }
  
--- 63,67 ----
      t_atom atom;
      SetInt(atom,v);  
!     o->CbMethodHandler(ci,sym_int,1,&atom);
  }
  
***************
*** 73,77 ****
      t_atom atom;
      SetFloat(atom,v);  
!     o->m_methodmain(ci,sym_float,1,&atom);
  }
  #else
--- 73,77 ----
      t_atom atom;
      SetFloat(atom,v);  
!     o->CbMethodHandler(ci,sym_float,1,&atom);
  }
  #else
***************
*** 162,166 ****
  {
      flext_base *o = thisObject(c);
!     o->m_methodmain(winlet,s,argc,argv);
  }
  
--- 162,166 ----
  {
      flext_base *o = thisObject(c);
!     o->CbMethodHandler(winlet,s,argc,argv);
  }
  

Index: flmsg.cpp
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/flext/source/flmsg.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** flmsg.cpp	26 Jan 2005 05:01:59 -0000	1.13
--- flmsg.cpp	13 Mar 2005 04:56:39 -0000	1.14
***************
*** 161,165 ****
      The messages of all the inlets go here and are promoted to the registered callback functions
  */
! bool flext_base::m_methodmain(int inlet,const t_symbol *s,int argc,const t_atom *argv)
  {
      static bool trap = false;
--- 161,165 ----
      The messages of all the inlets go here and are promoted to the registered callback functions
  */
! bool flext_base::CbMethodHandler(int inlet,const t_symbol *s,int argc,const t_atom *argv)
  {
      static bool trap = false;
***************
*** 180,184 ****
              SetInt(fl,GetAInt(argv[0]));
              trap = true;
!             ret = m_methodmain(inlet,sym_int,1,&fl);
              trap = false;
          }
--- 180,184 ----
              SetInt(fl,GetAInt(argv[0]));
              trap = true;
!             ret = CbMethodHandler(inlet,sym_int,1,&fl);
              trap = false;
          }
***************
*** 190,194 ****
              SetFloat(fl,GetAFloat(argv[0]));
              trap = true;
!             ret = m_methodmain(inlet,sym_float,1,&fl);
              trap = false;
          }
--- 190,194 ----
              SetFloat(fl,GetAFloat(argv[0]));
              trap = true;
!             ret = CbMethodHandler(inlet,sym_float,1,&fl);
              trap = false;
          }
***************
*** 211,215 ****
  
              trap = true;
!             ret = m_methodmain(inlet,sym_list,1,&list);
              trap = false;
          }
--- 211,215 ----
  
              trap = true;
!             ret = CbMethodHandler(inlet,sym_list,1,&list);
              trap = false;
          }
***************
*** 221,225 ****
              SetSymbol(list,s);
              trap = true;
!             ret = m_methodmain(inlet,sym_list,1,&list);
              trap = false;
          }
--- 221,225 ----
              SetSymbol(list,s);
              trap = true;
!             ret = CbMethodHandler(inlet,sym_list,1,&list);
              trap = false;
          }
***************
*** 240,244 ****
                  if(sym) {
                      trap = true;
!                     m_methodmain(i,sym,1,argv+i);           
                      trap = false;
                  }
--- 240,244 ----
                  if(sym) {
                      trap = true;
!                     CbMethodHandler(i,sym,1,argv+i);           
                      trap = false;
                  }
***************
*** 248,252 ****
          }
          
!         if(!ret && !trap) ret = m_method_(inlet,s,argc,argv);
      }
      catch(std::exception &x) {
--- 248,252 ----
          }
          
!         if(!ret && !trap) ret = CbMethodResort(inlet,s,argc,argv);
      }
      catch(std::exception &x) {
***************
*** 274,275 ****
--- 274,279 ----
  }
  
+ bool flext_base::CbMethodResort(int inlet,const t_symbol *s,int argc,const t_atom *argv) 
+ {
+     return m_method_(inlet,s,argc,argv);
+ }

Index: fldsp.cpp
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/flext/source/fldsp.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** fldsp.cpp	12 Feb 2005 04:56:09 -0000	1.26
--- fldsp.cpp	13 Mar 2005 04:56:33 -0000	1.27
***************
*** 91,95 ****
      {
          obj->indsp = true;
!         obj->m_signal(obj->blksz,obj->invecs,obj->outvecs); 
          obj->indsp = false;
      }
--- 91,95 ----
      {
          obj->indsp = true;
!         obj->CbSignal(); 
          obj->indsp = false;
      }
***************
*** 157,170 ****
  
      // with the following call derived classes can do their eventual DSP setup
!     obj->m_dsp(obj->blksz,obj->invecs,obj->outvecs);
! 
!     // set the DSP function
  #if FLEXT_SYS == FLEXT_SYS_JMAX
!     fts_atom_t args;
!     fts_set_pointer(args,obj);
!     fts_dsp_add_function(dspsym,1,args);
  #else
!     dsp_add((t_dspmethod)dspmeth,1,obj);  
  #endif
  }
  
--- 157,170 ----
  
      // with the following call derived classes can do their eventual DSP setup
!     if(obj->CbDsp()) {
!         // set the DSP function
  #if FLEXT_SYS == FLEXT_SYS_JMAX
!         fts_atom_t args;
!         fts_set_pointer(args,obj);
!         fts_dsp_add_function(dspsym,1,args);
  #else
!         dsp_add((t_dspmethod)dspmeth,1,obj);  
  #endif
+     }
  }
  
***************
*** 185,188 ****
--- 185,194 ----
  void flext_dsp::m_dsp(int /*n*/,t_signalvec const * /*insigs*/,t_signalvec const * /*outsigs*/) {}
  
+ bool flext_dsp::CbDsp() 
+ { 
+     m_dsp(Blocksize(),invecs,outvecs); 
+     return true;
+ }
+ 
  void flext_dsp::m_signal(int n,t_sample *const * /*insigs*/,t_sample *const *outs) 
  {
***************
*** 190,193 ****
--- 196,202 ----
  }
  
+ void flext_dsp::CbSignal() { m_signal(Blocksize(),invecs,outvecs); }
+ 
+ 
  #if FLEXT_SYS == FLEXT_SYS_PD
  void flext_dsp::cb_enable(t_class *c,t_float on) { thisObject(c)->dspon = on != 0; }

Index: fldsp.h
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/flext/source/fldsp.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** fldsp.h	12 Feb 2005 04:56:09 -0000	1.13
--- fldsp.h	13 Mar 2005 04:56:39 -0000	1.14
***************
*** 52,55 ****
--- 52,61 ----
  	int Blocksize() const { return blksz; }
      
+ 	//! returns array of input vectors (CntInSig() vectors)
+     t_sample *const *InSig() const { return invecs; }
+ 
+ 	//! returns array of output vectors (CntOutSig() vectors)
+     t_sample *const *OutSig() const { return outvecs; }
+ 
  	//! typedef describing a signal vector
  #if FLEXT_SYS == FLEXT_SYS_JMAX
***************
*** 69,73 ****
--- 75,92 ----
  	/*! \brief Called on every dsp init.
  		\note Don't expect any valid data in the signal vectors!
+         flext_dsp::CbDsp should not be called by the derived class
+ 
+         \return true (default)... use DSP, false, don't use DSP
+     */
+ 	virtual bool CbDsp();
  
+ 	/*! \brief Called with every signal vector - here you do the dsp calculation
+         flext_dsp::CbSignal fills all output vectors with silence
+     */
+ 	virtual void CbSignal();
+ 
+ 
+     /*! \brief Deprecated method for CbSignal
+         \deprecated
  		\param n: frames (aka samples) in one signal vector
  		\param insigs: array of input vectors  (get number with function CntInSig())
***************
*** 76,81 ****
  	virtual void m_dsp(int n,t_signalvec const *insigs,t_signalvec const *outsigs);
  
! 	/*! \brief Called with every signal vector - here you do the dsp calculation
! 
  		\param n: frames (aka samples) in one signal vector
  		\param insigs: array of input vectors  (get number with function CntInSig())
--- 95,100 ----
  	virtual void m_dsp(int n,t_signalvec const *insigs,t_signalvec const *outsigs);
  
!     /*! \brief Deprecated method for CbSignal
!         \deprecated
  		\param n: frames (aka samples) in one signal vector
  		\param insigs: array of input vectors  (get number with function CntInSig())

Index: flclass.h
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/flext/source/flclass.h,v
retrieving revision 1.51
retrieving revision 1.52
diff -C2 -d -r1.51 -r1.52
*** flclass.h	26 Jan 2005 05:01:41 -0000	1.51
--- flclass.h	13 Mar 2005 04:56:31 -0000	1.52
***************
*** 87,98 ****
  	*/
  
- 	//! called on "help" message: should post some text
- 	virtual void m_help();
- 	
  	//! called on patcher load (not on mere object creation!)
  	virtual void m_loadbang();
  
  	//! called on (double-)click into object box
! 	virtual void m_click();
  
  	/*!	\brief Called for every incoming message.
--- 87,96 ----
  	*/
  
  	//! called on patcher load (not on mere object creation!)
+ 	virtual void CbLoadbang();
  	virtual void m_loadbang();
  
  	//! called on (double-)click into object box
! 	virtual void CbClick();
  
  	/*!	\brief Called for every incoming message.
***************
*** 100,107 ****
  		\return True if a handler was found and called
  	*/
! 	virtual bool m_methodmain(int inlet,const t_symbol *s,int argc,const t_atom *argv);
  
! 	/*! \brief Called for every unhandled message (by m_methodmain)
  	*/
  	virtual bool m_method_(int inlet,const t_symbol *s,int argc,const t_atom *argv);
  
--- 98,106 ----
  		\return True if a handler was found and called
  	*/
! 	virtual bool CbMethodHandler(int inlet,const t_symbol *s,int argc,const t_atom *argv);
  
! 	/*! \brief Called for every unhandled message (by CbMethodHandler)
  	*/
+ 	virtual bool CbMethodResort(int inlet,const t_symbol *s,int argc,const t_atom *argv);
  	virtual bool m_method_(int inlet,const t_symbol *s,int argc,const t_atom *argv);
  
***************
*** 502,509 ****
  	//! Terminate all threads of this object
  	bool StopThreads();
- 
- 	//! Check if current thread should terminate
- 	bool ShouldExit() const;
- 
  #endif // FLEXT_THREADS
  
--- 501,504 ----





More information about the Pd-cvs mailing list