flext  0.6.0
flclass.h
Go to the documentation of this file.
1 /*
2 flext - C++ layer for Max and Pure Data externals
3 
4 Copyright (c) 2001-2015 Thomas Grill (gr@grrrr.org)
5 For information on usage and redistribution, and for a DISCLAIMER OF ALL
6 WARRANTIES, see the file, "license.txt," in this distribution.
7 */
8 
14 #ifndef __FLCLASS_H
15 #define __FLCLASS_H
16 
17 // include the header file declaring the base classes
18 #include "flbase.h"
19 #include "flsupport.h"
20 #include "flmap.h"
21 #include "flinternal.h"
22 
23 #ifdef _MSC_VER
24 #pragma warning(disable: 4786)
25 #endif
26 
27 #ifdef __BORLANDC__
28 #pragma warn -8008 // Condition is always false
29 #pragma warn -8057 // Parameter is never used
30 #pragma warn -8066 // Unreachable code
31 #endif
32 
33 
34 #include "flpushns.h"
35 
36 // === flext_base ==================================================
37 
54 
56 
59  public flext_obj
60 {
61  FLEXT_HEADER_S(FLEXT_CLASSDEF(flext_base),flext_obj,Setup)
62 
63  friend class FLEXT_SHARE FLEXT_CLASSDEF(flext_obj);
64 
65 public:
66 
67 // --- inheritable virtual methods --------------------------------
68 
74  virtual void CbLoadbang();
76  virtual void m_loadbang();
77 
79  virtual void CbClick();
80 
85  virtual bool CbMethodHandler(int inlet,const t_symbol *s,int argc,const t_atom *argv);
86 
89  virtual bool CbMethodResort(int inlet,const t_symbol *s,int argc,const t_atom *argv);
90  virtual bool m_method_(int inlet,const t_symbol *s,int argc,const t_atom *argv);
91 
92  virtual bool CbIdle();
93 
95 
96 
97 // --- inlet/outlet stuff -----------------------------------------
98 
109  // argument m specifies multiple inlet/outlet count
110 
111 // void AddInDef() { AddInlet(xlet_def,1); }
112 
116  void AddInAnything(int m = 1) { AddInlet(xlet_any,m); }
120  void AddInAnything(const char *desc,int m = 1) { AddInlet(xlet_any,m,desc); }
122  void AddInFloat(int m = 1) { AddInlet(xlet_float,m); }
124  void AddInFloat(const char *desc,int m = 1) { AddInlet(xlet_float,m,desc); }
126  void AddInInt(int m = 1) { AddInlet(xlet_int,m); }
128  void AddInInt(const char *desc,int m = 1) { AddInlet(xlet_int,m,desc); }
130  void AddInSymbol(int m = 1) { AddInlet(xlet_sym,m); }
132  void AddInSymbol(const char *desc,int m = 1) { AddInlet(xlet_sym,m,desc); }
134  void AddInBang(int m = 1) { AddInlet(xlet_sym,m); }
136  void AddInBang(const char *desc,int m = 1) { AddInlet(xlet_sym,m,desc); }
138  void AddInList(int m = 1) { AddInlet(xlet_list,m); }
140  void AddInList(const char *desc,int m = 1) { AddInlet(xlet_list,m,desc); }
141 
143  void AddOutAnything(int m = 1) { AddOutlet(xlet_any,m); }
145  void AddOutAnything(const char *desc,int m = 1) { AddOutlet(xlet_any,m,desc); }
147  void AddOutFloat(int m = 1) { AddOutlet(xlet_float,m); }
149  void AddOutFloat(const char *desc,int m = 1) { AddOutlet(xlet_float,m,desc); }
151  void AddOutInt(int m = 1) { AddOutlet(xlet_int,m); }
153  void AddOutInt(const char *desc,int m = 1) { AddOutlet(xlet_int,m,desc); }
155  void AddOutSymbol(int m = 1) { AddOutlet(xlet_sym,m); }
157  void AddOutSymbol(const char *desc,int m = 1) { AddOutlet(xlet_sym,m,desc); }
159  void AddOutBang(int m = 1) { AddOutlet(xlet_sym,m); }
161  void AddOutBang(const char *desc,int m = 1) { AddOutlet(xlet_sym,m,desc); }
163  void AddOutList(int m = 1) { AddOutlet(xlet_list,m); }
165  void AddOutList(const char *desc,int m = 1) { AddOutlet(xlet_list,m,desc); }
166 
168  bool SetupInOut() { return true; }
169 
171 
176  int CntIn() const { return incnt; }
179  int CntOut() const { return outcnt; }
181  int CntInSig() const { return insigs; }
183  int CntOutSig() const { return outsigs; }
184 
185 
187  static const t_symbol *thisTag() { return curtag; }
188 
189  class outlet;
190 
192  outlet *GetOut(int ix) const { return outlets[ix]; }
193 
194  int GetOutAttr() const { return HasAttributes()?CntOut():0; }
195 
197 
202  // output messages
203 
205  void ToOutBang(int n) const;
206 
208  void ToOutFloat(int n,float f) const;
209 
211  void ToOutInt(int n,int f) const;
212 
214  void ToOutBool(int n,bool f) const { ToOutInt(n,f?1:0); }
215 
217  void ToOutDouble(int n,double d) const { t_atom dbl[2]; ToOutList(n,2,SetDouble(dbl,d)); }
218 
220  void ToOutSymbol(int n,const t_symbol *s) const;
222  void ToOutString(int n,const char *s) const { ToOutSymbol(n,MakeSymbol(s)); }
223 
225  void ToOutAtom(int n,const t_atom &at) const;
226 
228  void ToOutList(int n,int argc,const t_atom *argv) const;
230  void ToOutList(int n,const AtomList &list) const { ToOutList(n,list.Count(),list.Atoms()); }
231 
233  void ToOutAnything(int n,const t_symbol *s,int argc,const t_atom *argv) const;
235  void ToOutAnything(int n,const AtomAnything &any) const { ToOutAnything(n,any.Header(),any.Count(),any.Atoms()); }
237  void ToOutAnything(int n,const t_symbol *s,const AtomList &list) const { ToOutAnything(n,s,list.Count(),list.Atoms()); }
238 
240 
245  void ToQueueBang(int n) const;
247 
249  void ToQueueFloat(int n,float f) const;
250 
252  void ToQueueInt(int n,int f) const;
253 
255  void ToQueueBool(int n,bool f) const { ToQueueInt(n,f?1:0); }
256 
258  void ToQueueDouble(int n,double d) const { t_atom dbl[2]; ToQueueList(n,2,SetDouble(dbl,d)); }
259 
261  void ToQueueSymbol(int n,const t_symbol *s) const;
263  void ToQueueString(int n,const char *s) const { ToQueueSymbol(n,MakeSymbol(s)); }
264 
266  void ToQueueAtom(int n,const t_atom &at) const;
267 
269  void ToQueueList(int n,int argc,const t_atom *argv) const;
271  void ToQueueList(int n,const AtomList &list) const { ToQueueList(n,list.Count(),list.Atoms()); }
272 
274  void ToQueueAnything(int n,const t_symbol *s,int argc,const t_atom *argv) const;
276  void ToQueueAnything(int n,const AtomAnything &any) const { ToQueueAnything(n,any.Header(),any.Count(),any.Atoms()); }
277 
279 
280 
285  void ToSelfBang(int n) const { ToQueueBang(-1-n); }
287 
289  void ToSelfFloat(int n,float f) const { ToQueueFloat(-1-n,f); }
290 
292  void ToSelfInt(int n,int f) const { ToQueueInt(-1-n,f); }
293 
295  void ToSelfBool(int n,bool f) const { ToSelfInt(n,f?1:0); }
296 
298  void ToSelfDouble(int n,double d) const { t_atom dbl[2]; ToSelfList(n,2,SetDouble(dbl,d)); }
299 
301  void ToSelfSymbol(int n,const t_symbol *s) const { ToQueueSymbol(-1-n,s); }
303  void ToSelfString(int n,const char *s) const { ToSelfSymbol(n,MakeSymbol(s)); }
304 
306  void ToSelfAtom(int n,const t_atom &at) const { ToQueueAtom(-1-n,at); }
307 
309  void ToSelfList(int n,int argc,const t_atom *argv) const { ToQueueList(-1-n,argc,argv); }
311  void ToSelfList(int n,const AtomList &list) const { ToSelfList(n,list.Count(),list.Atoms()); }
312 
314  void ToSelfAnything(int n,const t_symbol *s,int argc,const t_atom *argv) const { ToQueueAnything(-1-n,s,argc,argv); }
316  void ToSelfAnything(int n,const AtomAnything &any) const { ToSelfAnything(n,any.Header(),any.Count(),any.Atoms()); }
317 
319 
320 
328  void MsgAddBang(MsgBundle *mb,int n) const;
330 
332  void MsgAddFloat(MsgBundle *mb,int n,float f) const;
333 
335  void MsgAddInt(MsgBundle *mb,int n,int f) const;
336 
338  void MsgAddBool(MsgBundle *mb,int n,bool f) const { MsgAddInt(mb,n,f?1:0); }
339 
341  void MsgAddDouble(MsgBundle *mb,int n,double d) const { t_atom dbl[2]; MsgAddList(mb,n,2,SetDouble(dbl,d)); }
342 
344  void MsgAddSymbol(MsgBundle *mb,int n,const t_symbol *s) const;
346  void MsgAddString(MsgBundle *mb,int n,const char *s) const { MsgAddSymbol(mb,n,MakeSymbol(s)); }
347 
349  void MsgAddAtom(MsgBundle *mb,int n,const t_atom &at) const;
350 
352  void MsgAddList(MsgBundle *mb,int n,int argc,const t_atom *argv) const;
353 
355  void MsgAddList(MsgBundle *mb,int n,const AtomList &list) const { MsgAddList(mb,n,list.Count(),list.Atoms()); }
356 
358  void MsgAddAnything(MsgBundle *mb,int n,const t_symbol *s,int argc,const t_atom *argv) const;
360  void MsgAddAnything(MsgBundle *mb,int n,const AtomAnything &any) const { MsgAddAnything(mb,n,any.Header(),any.Count(),any.Atoms()); }
361 
362  void MsgSelfBang(MsgBundle *mb,int n) const { MsgAddBang(mb,-1-n); }
363 
365  void MsgSelfFloat(MsgBundle *mb,int n,float f) const { MsgAddFloat(mb,-1-n,f); }
366 
368  void MsgSelfInt(MsgBundle *mb,int n,int f) const { MsgAddInt(mb,-1-n,f); }
369 
371  void MsgSelfBool(MsgBundle *mb,int n,bool f) const { MsgSelfInt(mb,n,f?1:0); }
372 
374  void MsgSelfDouble(MsgBundle *mb,int n,double d) const { t_atom dbl[2]; MsgSelfList(mb,n,2,SetDouble(dbl,d)); }
375 
377  void MsgSelfSymbol(MsgBundle *mb,int n,const t_symbol *s) const { MsgAddSymbol(mb,-1-n,s); }
379  void MsgSelfString(MsgBundle *mb,int n,const char *s) const { MsgSelfSymbol(mb,n,MakeSymbol(s)); }
380 
382  void MsgSelfAtom(MsgBundle *mb,int n,const t_atom &at) const { MsgAddAtom(mb,-1-n,at); }
383 
385  void MsgSelfList(MsgBundle *mb,int n,int argc,const t_atom *argv) const { MsgAddList(mb,-1-n,argc,argv); }
387  void MsgSelfList(MsgBundle *mb,int n,const AtomList &list) const { MsgSelfList(mb,n,list.Count(),list.Atoms()); }
388 
390  void MsgSelfAnything(MsgBundle *mb,int n,const t_symbol *s,int argc,const t_atom *argv) const { MsgAddAnything(mb,-1-n,s,argc,argv); }
392  void MsgSelfAnything(MsgBundle *mb,int n,const AtomAnything &any) const { MsgSelfAnything(mb,n,any.Header(),any.Count(),any.Atoms()); }
393 
395 
397 
398 
399 // --- message handling -------------------------------------------
400 
401  enum metharg {
402  a_null = 0,
403  a_float,a_int,a_bool,
404  a_symbol,a_pointer,
405  a_list,a_any, // (t_symbol *) / int / t_atom *
406  a_LIST,a_ANY // AtomList, AtomAnything
407  };
408 
409  typedef bool (*methfun)(flext_base *c);
410 
416  void AddMethodDef(int inlet,const t_symbol *tag = NULL) { ThMeths()->Add(new MethItem,tag,inlet); }
417  void AddMethodDef(int inlet,const char *tag = NULL) { AddMethodDef(inlet,MakeSymbol(tag)); }
418 
419  void AddMethod(int inlet,bool (*m)(flext_base *)) { AddMethod(ThMeths(),inlet,sym_bang,(methfun)m,a_null); }
420  void AddMethod(int inlet,bool (*m)(flext_base *,int,t_atom *)) { AddMethod(ThMeths(),inlet,sym_list,(methfun)m,a_list,a_null); }
421  void AddMethod(int inlet,bool (*m)(flext_base *,int,const t_atom *)) { AddMethod(ThMeths(),inlet,sym_list,(methfun)m,a_list,a_null); }
422  void AddMethod(int inlet,const t_symbol *tag,bool (*m)(flext_base *)) { AddMethod(ThMeths(),inlet,tag,(methfun)m,a_null); } // pure method
423  void AddMethod(int inlet,const char *tag,bool (*m)(flext_base *)) { AddMethod(inlet,MakeSymbol(tag),m); }
424  void AddMethod(int inlet,bool (*m)(flext_base *,t_symbol *,int,t_atom *)) { AddMethod(ThMeths(),inlet,sym_anything,(methfun)m,a_any,a_null); } // anything
425  void AddMethod(int inlet,bool (*m)(flext_base *,const t_symbol *,int,const t_atom *)) { AddMethod(ThMeths(),inlet,sym_anything,(methfun)m,a_any,a_null); } // anything
426  void AddMethod(int inlet,bool (*m)(flext_base *,t_symbol *&)) { AddMethod(ThMeths(),inlet,sym_symbol,(methfun)m,a_symbol,a_null); } // single symbol
427  void AddMethod(int inlet,bool (*m)(flext_base *,const t_symbol *&)) { AddMethod(ThMeths(),inlet,sym_symbol,(methfun)m,a_symbol,a_null); } // single symbol
428  void AddMethod(int inlet,bool (*m)(flext_base *,float &)) { AddMethod(ThMeths(),inlet,sym_float,(methfun)m,a_float,a_null); } // single float
429  void AddMethod(int inlet,bool (*m)(flext_base *,float &,float &)) { AddMethod(ThMeths(),inlet,sym_list,(methfun)m,a_float,a_float,a_null); } // list of 2 floats
430  void AddMethod(int inlet,bool (*m)(flext_base *,float &,float &,float &)) { AddMethod(ThMeths(),inlet,sym_list,(methfun)m,a_float,a_float,a_float,a_null); } // list of 3 floats
431 #if FLEXT_SYS == FLEXT_SYS_PD
432  void AddMethod(int inlet,bool (*m)(flext_base *,int &)) { AddMethod(ThMeths(),inlet,sym_float,(methfun)m,a_int,a_null); } // single float
433 #else
434  void AddMethod(int inlet,bool (*m)(flext_base *,int &)) { AddMethod(ThMeths(),inlet,sym_int,(methfun)m,a_int,a_null); } // single float
435 #endif
436  void AddMethod(int inlet,bool (*m)(flext_base *,int &,int &)) { AddMethod(ThMeths(),inlet,sym_list,(methfun)m,a_int,a_int,a_null); } // list of 2 floats
437  void AddMethod(int inlet,bool (*m)(flext_base *,int &,int &,int &)) { AddMethod(ThMeths(),inlet,sym_list,(methfun)m,a_int,a_int,a_int,a_null); } // list of 3 floats
438  void AddMethod(int inlet,const t_symbol *tag,bool (*m)(flext_base *,int,t_atom *)) { AddMethod(ThMeths(),inlet,tag,(methfun)m,a_list,a_null); } // method+gimme
439  void AddMethod(int inlet,const t_symbol *tag,bool (*m)(flext_base *,int,const t_atom *)) { AddMethod(ThMeths(),inlet,tag,(methfun)m,a_list,a_null); } // method+gimme
440  void AddMethod(int inlet,const t_symbol *tag,bool (*m)(flext_base *,t_symbol *,int,t_atom *)) { AddMethod(ThMeths(),inlet,tag,(methfun)m,a_any,a_null); } // method+gimme
441  void AddMethod(int inlet,const t_symbol *tag,bool (*m)(flext_base *,const t_symbol *,int,const t_atom *)) { AddMethod(ThMeths(),inlet,tag,(methfun)m,a_any,a_null); } // method+gimme
442  void AddMethod(int inlet,const t_symbol *tag,bool (*m)(flext_base *,t_symbol *&)) { AddMethod(ThMeths(),inlet,tag,(methfun)m,a_symbol,a_null); } // method+symbol
443  void AddMethod(int inlet,const t_symbol *tag,bool (*m)(flext_base *,const t_symbol *&)) { AddMethod(ThMeths(),inlet,tag,(methfun)m,a_symbol,a_null); } // method+symbol
444  void AddMethod(int inlet,const t_symbol *tag,bool (*m)(flext_base *,float &)) { AddMethod(ThMeths(),inlet,tag,(methfun)m,a_float,a_null); } // method+float
445  void AddMethod(int inlet,const t_symbol *tag,bool (*m)(flext_base *,int &)) { AddMethod(ThMeths(),inlet,tag,(methfun)m,a_int,a_null); } // method+int
446  void AddMethod(int inlet,const char *tag,bool (*m)(flext_base *,int,t_atom *)) { AddMethod(inlet,MakeSymbol(tag),m); }
447  void AddMethod(int inlet,const char *tag,bool (*m)(flext_base *,int,const t_atom *)) { AddMethod(inlet,MakeSymbol(tag),m); }
448  void AddMethod(int inlet,const char *tag,bool (*m)(flext_base *,t_symbol *,int,t_atom *)) { AddMethod(inlet,MakeSymbol(tag),m); }
449  void AddMethod(int inlet,const char *tag,bool (*m)(flext_base *,const t_symbol *,int,const t_atom *)) { AddMethod(inlet,MakeSymbol(tag),m); }
450  void AddMethod(int inlet,const char *tag,bool (*m)(flext_base *,t_symbol *&)) { AddMethod(inlet,MakeSymbol(tag),m); }
451  void AddMethod(int inlet,const char *tag,bool (*m)(flext_base *,const t_symbol *&)) { AddMethod(inlet,MakeSymbol(tag),m); }
452  void AddMethod(int inlet,const char *tag,bool (*m)(flext_base *,float &)) { AddMethod(inlet,MakeSymbol(tag),m); }
453  void AddMethod(int inlet,const char *tag,bool (*m)(flext_base *,int &)) { AddMethod(inlet,MakeSymbol(tag),m); }
454 
455  // Â¥schedule call of the CbIdle method during the next idle cycle
456  void AddIdle();
457 
459  static void SetDist(t_classid c,bool d = true);
461  bool DoDist() const;
462 
463 
465 
471  static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *)) { AddMethod(ClMeths(c),inlet,sym_bang,(methfun)m,a_null); }
472  static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,int,t_atom *)) { AddMethod(ClMeths(c),inlet,sym_list,(methfun)m,a_list,a_null); }
473  static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,int,const t_atom *)) { AddMethod(ClMeths(c),inlet,sym_list,(methfun)m,a_list,a_null); }
474  static void AddMethod(t_classid c,int inlet,const t_symbol *tag,bool (*m)(flext_base *)) { AddMethod(ClMeths(c),inlet,tag,(methfun)m,a_null); } // pure method
475  static void AddMethod(t_classid c,int inlet,const char *tag,bool (*m)(flext_base *)) { AddMethod(c,inlet,MakeSymbol(tag),m); }
476  static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,t_symbol *,int,t_atom *)) { AddMethod(ClMeths(c),inlet,sym_anything,(methfun)m,a_any,a_null); } // anything
477  static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,const t_symbol *,int,const t_atom *)) { AddMethod(ClMeths(c),inlet,sym_anything,(methfun)m,a_any,a_null); } // anything
478  static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,t_symbol *&)) { AddMethod(ClMeths(c),inlet,sym_symbol,(methfun)m,a_symbol,a_null); } // single symbol
479  static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,const t_symbol *&)) { AddMethod(ClMeths(c),inlet,sym_symbol,(methfun)m,a_symbol,a_null); } // single symbol
480  static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,float &)) { AddMethod(ClMeths(c),inlet,sym_float,(methfun)m,a_float,a_null); } // single float
481  static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,float &,float &)) { AddMethod(ClMeths(c),inlet,sym_list,(methfun)m,a_float,a_float,a_null); } // list of 2 floats
482  static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,float &,float &,float &)) { AddMethod(ClMeths(c),inlet,sym_list,(methfun)m,a_float,a_float,a_float,a_null); } // list of 3 floats
483 #if FLEXT_SYS == FLEXT_SYS_PD
484  static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,int &)) { AddMethod(ClMeths(c),inlet,sym_float,(methfun)m,a_int,a_null); } // single integer
485 #else
486  static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,int &)) { AddMethod(ClMeths(c),inlet,sym_int,(methfun)m,a_int,a_null); } // single integer
487 #endif
488  static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,int &,int &)) { AddMethod(ClMeths(c),inlet,sym_list,(methfun)m,a_int,a_int,a_null); } // list of 2 floats
489  static void AddMethod(t_classid c,int inlet,bool (*m)(flext_base *,int &,int &,int &)) { AddMethod(ClMeths(c),inlet,sym_list,(methfun)m,a_int,a_int,a_int,a_null); } // list of 3 floats
490  static void AddMethod(t_classid c,int inlet,const t_symbol *tag,bool (*m)(flext_base *,int,t_atom *)) { AddMethod(ClMeths(c),inlet,tag,(methfun)m,a_list,a_null); } // method+gimme
491  static void AddMethod(t_classid c,int inlet,const t_symbol *tag,bool (*m)(flext_base *,int,const t_atom *)) { AddMethod(ClMeths(c),inlet,tag,(methfun)m,a_list,a_null); } // method+gimme
492  static void AddMethod(t_classid c,int inlet,const t_symbol *tag,bool (*m)(flext_base *,t_symbol *,int,t_atom *)) { AddMethod(ClMeths(c),inlet,tag,(methfun)m,a_any,a_null); } // method+gimme
493  static void AddMethod(t_classid c,int inlet,const t_symbol *tag,bool (*m)(flext_base *,const t_symbol *,int,const t_atom *)) { AddMethod(ClMeths(c),inlet,tag,(methfun)m,a_any,a_null); } // method+gimme
494  static void AddMethod(t_classid c,int inlet,const t_symbol *tag,bool (*m)(flext_base *,t_symbol *&)) { AddMethod(ClMeths(c),inlet,tag,(methfun)m,a_symbol,a_null); } // method+symbol
495  static void AddMethod(t_classid c,int inlet,const t_symbol *tag,bool (*m)(flext_base *,const t_symbol *&)) { AddMethod(ClMeths(c),inlet,tag,(methfun)m,a_symbol,a_null); } // method+symbol
496  static void AddMethod(t_classid c,int inlet,const t_symbol *tag,bool (*m)(flext_base *,float &)) { AddMethod(ClMeths(c),inlet,tag,(methfun)m,a_float,a_null); } // method+float
497  static void AddMethod(t_classid c,int inlet,const t_symbol *tag,bool (*m)(flext_base *,int &)) { AddMethod(ClMeths(c),inlet,tag,(methfun)m,a_int,a_null); } // method+int
498  static void AddMethod(t_classid c,int inlet,const char *tag,bool (*m)(flext_base *,int,t_atom *)) { AddMethod(c,inlet,MakeSymbol(tag),m); }
499  static void AddMethod(t_classid c,int inlet,const char *tag,bool (*m)(flext_base *,int,const t_atom *)) { AddMethod(c,inlet,MakeSymbol(tag),m); }
500  static void AddMethod(t_classid c,int inlet,const char *tag,bool (*m)(flext_base *,t_symbol *,int,t_atom *)) { AddMethod(c,inlet,MakeSymbol(tag),m); }
501  static void AddMethod(t_classid c,int inlet,const char *tag,bool (*m)(flext_base *,const t_symbol *,int,const t_atom *)) { AddMethod(c,inlet,MakeSymbol(tag),m); }
502  static void AddMethod(t_classid c,int inlet,const char *tag,bool (*m)(flext_base *,t_symbol *&)) { AddMethod(c,inlet,MakeSymbol(tag),m); }
503  static void AddMethod(t_classid c,int inlet,const char *tag,bool (*m)(flext_base *,const t_symbol *&)) { AddMethod(c,inlet,MakeSymbol(tag),m); }
504  static void AddMethod(t_classid c,int inlet,const char *tag,bool (*m)(flext_base *,float &)) { AddMethod(c,inlet,MakeSymbol(tag),m); }
505  static void AddMethod(t_classid c,int inlet,const char *tag,bool (*m)(flext_base *,int &)) { AddMethod(c,inlet,MakeSymbol(tag),m); }
506 
507  // Â¥schedule call of the given idlefun during the next idle cycle
508  static void AddIdle(bool (*idlefun)(int argc,const t_atom *argv),int argc,const t_atom *argv);
509 
511 
512 // --- bind/unbind ---------------------------------------
513 
519  bool Bind(const t_symbol *sym);
522  bool Unbind(const t_symbol *sym);
523 
525  bool Bind(const char *sym) { return Bind(MakeSymbol(sym)); }
527  bool Unbind(const char *sym) { return Unbind(MakeSymbol(sym)); }
528 
535  bool BindMethod(const t_symbol *sym,bool (*meth)(flext_base *obj,t_symbol *sym,int argc,t_atom *argv,void *data),void *data = NULL);
542  bool UnbindMethod(const t_symbol *sym,bool (*meth)(flext_base *obj,t_symbol *sym,int argc,t_atom *argv,void *data) = NULL,void **data = NULL);
549  bool GetBoundMethod(const t_symbol *sym,bool (*meth)(flext_base *obj,t_symbol *sym,int argc,t_atom *argv,void *data),void *&data);
550 
552  bool BindMethod(const char *sym,bool (*meth)(flext_base *obj,t_symbol *sym,int argc,t_atom *argv,void *data),void *data = NULL) { return BindMethod(MakeSymbol(sym),meth,data); }
554  bool UnbindMethod(const char *sym,bool (*meth)(flext_base *obj,t_symbol *sym,int argc,t_atom *argv,void *data) = NULL,void **data = NULL) { return UnbindMethod(MakeSymbol(sym),meth,data); }
556  bool GetBoundMethod(const char *sym,bool (*meth)(flext_base *obj,t_symbol *sym,int argc,t_atom *argv,void *data),void *&data) { return GetBoundMethod(MakeSymbol(sym),meth,data); }
557 
561  bool UnbindAll();
562 
564 
565  // --- thread stuff -----------------------------------------------
566 
567 #ifdef FLEXT_THREADS
568 
573  bool StartThread(void (*meth)(thr_params *p),thr_params *p,const char * = NULL) { p->cl = this; return flext::LaunchThread(meth,p); }
575 
577  bool StopThreads();
578 #endif // FLEXT_THREADS
579 
581 
582 // xxx internal stuff xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
583 
584 public: // needed by VC++ 6
585 
586  enum xlettype {
587  xlet_none = 0,
588  xlet_float,xlet_int,xlet_sym,xlet_list,xlet_any,
589  xlet_LIST,xlet_ANY, // use AtomList and AtomAnything
590  xlet_sig
591  };
592 
593 protected:
594 
596 
599  virtual bool Init();
600 
603  virtual void Exit();
604 
605 
610  void AddAttrib(const t_symbol *attr,bool (*get)(flext_base *,float &),bool (*set)(flext_base *,float &)) { AddAttrib(attr,a_float,(methfun)get,(methfun)set); }
611  void AddAttrib(const t_symbol *attr,bool (*get)(flext_base *,int &),bool (*set)(flext_base *,int &)) { AddAttrib(attr,a_int,(methfun)get,(methfun)set); }
612  void AddAttrib(const t_symbol *attr,bool (*get)(flext_base *,bool &),bool (*set)(flext_base *,bool &)) { AddAttrib(attr,a_bool,(methfun)get,(methfun)set); }
613  void AddAttrib(const t_symbol *attr,bool (*get)(flext_base *,const t_symbol *&),bool (*set)(flext_base *,const t_symbol *&)) { AddAttrib(attr,a_symbol,(methfun)get,(methfun)set); }
614  void AddAttrib(const t_symbol *attr,bool (*get)(flext_base *,t_symptr &),bool (*set)(flext_base *,t_symptr &)) { AddAttrib(attr,a_symbol,(methfun)get,(methfun)set); }
615  void AddAttrib(const t_symbol *attr,bool (*get)(flext_base *,AtomList *&),bool (*set)(flext_base *,AtomList *&)) { AddAttrib(attr,a_LIST,(methfun)get,(methfun)set); }
616  void AddAttrib(const t_symbol *attr,bool (*get)(flext_base *,AtomAnything *&),bool (*set)(flext_base *,AtomAnything *&)) { AddAttrib(attr,a_ANY,(methfun)get,(methfun)set); }
617  void AddAttrib(const char *attr,bool (*get)(flext_base *,float &),bool (*set)(flext_base *,float &)) { AddAttrib(MakeSymbol(attr),get,set); }
618  void AddAttrib(const char *attr,bool (*get)(flext_base *,int &),bool (*set)(flext_base *,int &)) { AddAttrib(MakeSymbol(attr),get,set); }
619  void AddAttrib(const char *attr,bool (*get)(flext_base *,bool &),bool (*set)(flext_base *,bool &)) { AddAttrib(MakeSymbol(attr),get,set); }
620  void AddAttrib(const char *attr,bool (*get)(flext_base *,const t_symbol *&),bool (*set)(flext_base *,const t_symbol *&)) { AddAttrib(MakeSymbol(attr),get,set); }
621  void AddAttrib(const char *attr,bool (*get)(flext_base *,t_symptr &),bool (*set)(flext_base *,t_symptr &)) { AddAttrib(MakeSymbol(attr),get,set); }
622  void AddAttrib(const char *attr,bool (*get)(flext_base *,AtomList *&),bool (*set)(flext_base *,AtomList *&)) { AddAttrib(MakeSymbol(attr),get,set); }
623  void AddAttrib(const char *attr,bool (*get)(flext_base *,AtomAnything *&),bool (*set)(flext_base *,AtomAnything *&)) { AddAttrib(MakeSymbol(attr),get,set); }
624 
626 
631  static void AddAttrib(t_classid c,const t_symbol *attr,bool (*get)(flext_base *,float &),bool (*set)(flext_base *,float &)) { AddAttrib(c,attr,a_float,(methfun)get,(methfun)set); }
632  static void AddAttrib(t_classid c,const t_symbol *attr,bool (*get)(flext_base *,int &),bool (*set)(flext_base *,int &)) { AddAttrib(c,attr,a_int,(methfun)get,(methfun)set); }
633  static void AddAttrib(t_classid c,const t_symbol *attr,bool (*get)(flext_base *,bool &),bool (*set)(flext_base *,bool &)) { AddAttrib(c,attr,a_bool,(methfun)get,(methfun)set); }
634  static void AddAttrib(t_classid c,const t_symbol *attr,bool (*get)(flext_base *,const t_symbol *&),bool (*set)(flext_base *,const t_symbol *&)) { AddAttrib(c,attr,a_symbol,(methfun)get,(methfun)set); }
635  static void AddAttrib(t_classid c,const t_symbol *attr,bool (*get)(flext_base *,t_symptr &),bool (*set)(flext_base *,t_symptr &)) { AddAttrib(c,attr,a_symbol,(methfun)get,(methfun)set); }
636  static void AddAttrib(t_classid c,const t_symbol *attr,bool (*get)(flext_base *,AtomList *&),bool (*set)(flext_base *,AtomList *&)) { AddAttrib(c,attr,a_LIST,(methfun)get,(methfun)set); }
637  static void AddAttrib(t_classid c,const t_symbol *attr,bool (*get)(flext_base *,AtomAnything *&),bool (*set)(flext_base *,AtomAnything *&)) { AddAttrib(c,attr,a_ANY,(methfun)get,(methfun)set); }
638  static void AddAttrib(t_classid c,const char *attr,bool (*get)(flext_base *,float &),bool (*set)(flext_base *,float &)) { AddAttrib(c,MakeSymbol(attr),get,set); }
639  static void AddAttrib(t_classid c,const char *attr,bool (*get)(flext_base *,int &),bool (*set)(flext_base *,int &)) { AddAttrib(c,MakeSymbol(attr),get,set); }
640  static void AddAttrib(t_classid c,const char *attr,bool (*get)(flext_base *,bool &),bool (*set)(flext_base *,bool &)) { AddAttrib(c,MakeSymbol(attr),get,set); }
641  static void AddAttrib(t_classid c,const char *attr,bool (*get)(flext_base *,const t_symbol *&),bool (*set)(flext_base *,const t_symbol *&)) { AddAttrib(c,MakeSymbol(attr),get,set); }
642  static void AddAttrib(t_classid c,const char *attr,bool (*get)(flext_base *,t_symptr &),bool (*set)(flext_base *,t_symptr &)) { AddAttrib(c,MakeSymbol(attr),get,set); }
643  static void AddAttrib(t_classid c,const char *attr,bool (*get)(flext_base *,AtomList *&),bool (*set)(flext_base *,AtomList *&)) { AddAttrib(c,MakeSymbol(attr),get,set); }
644  static void AddAttrib(t_classid c,const char *attr,bool (*get)(flext_base *,AtomAnything *&),bool (*set)(flext_base *,AtomAnything *&)) { AddAttrib(c,MakeSymbol(attr),get,set); }
645 
647 
649  bool DumpAttrib(const t_symbol *attr) const;
651  bool DumpAttrib(const char *attr) const { return DumpAttrib(MakeSymbol(attr)); }
652 
653  // check for attribute symbol @
654  static int CheckAttrib(int argc,const t_atom *argv);
655  // check for attribute symbol @
656  static int CheckAttrib(const AtomList &args,int offset = 0) { return CheckAttrib(args.Count()-offset,args.Atoms()+offset)+offset; }
657 
659  bool ListAttrib() const;
661  void ListAttrib(AtomList &a) const;
663  bool GetAttrib(const t_symbol *s,AtomList &a) const;
665  bool SetAttrib(const t_symbol *s,int argc,const t_atom *argv);
667  bool SetAttrib(const t_symbol *s,const AtomList &a) { return SetAttrib(s,a.Count(),a.Atoms()); }
668 
669  // get and set the attribute
670  bool BangAttrib(const t_symbol *a);
671  // get and set the attribute
672  bool BangAttrib(const char *a) { return BangAttrib(MakeSymbol(a)); }
673  // get and set all (both get- and settables)
674  bool BangAttribAll();
675  // show/hide the attribute
676  bool ShowAttrib(const t_symbol *a,bool show) const;
677  // show/hide the attribute
678  bool ShowAttrib(const char *a,bool show) { return ShowAttrib(MakeSymbol(a),show); }
679 
681  void ListMethods(AtomList &a,int inlet = 0) const;
682 
687  unsigned long XletCode(xlettype tp = xlet_none,...); // end list with 0 (= tp_none) !!
689 
693  void AddInlets(unsigned long code);
694 
696  void AddInlet(xlettype tp,int mult = 1,const char *desc = NULL);
697 
701  void AddOutlets(unsigned long code);
702 
704  void AddOutlet(xlettype tp,int mult = 1,const char *desc = NULL);
705 
707  void DescInlet(int ix,const char *desc);
708 
710  void DescOutlet(int ix,const char *desc);
711 
713 
714 
715 // method handling
716 
717  public:
718 
719  class AttrItem;
720 
721  class Item
722  {
723  public:
724  Item(AttrItem *a): attr(a),nxt(NULL) {}
725  virtual ~Item();
726 
727  bool IsAttr() const { return attr != NULL; }
728 
731  };
732 
734 
735  class ItemSet
736  :public TablePtrMapDef
737  {
738  public:
739  virtual ~ItemSet();
740  virtual void clear();
741  };
742 
747  {
748  public:
749  ItemCont();
750  ~ItemCont();
751 
752  int Min() const { return -1; }
753  int Max() const { return size-2; }
754 
755  bool Contained(int i) const { return i+1 < size; }
756 
758  void Add(Item *it,const t_symbol *tag,int inlet = 0);
760  bool Remove(Item *it,const t_symbol *tag,int inlet,bool free);
762  Item *FindList(const t_symbol *tag,int inlet = 0);
763 
765  ItemSet &GetInlet(int inlet = 0)
766  {
767  FLEXT_ASSERT(inlet >= Min() && inlet <= Max());
768  return *cont[inlet+1];
769  }
770 
772  int Members() const { return members; }
773 
774  protected:
775 
776  void Resize(int nsz);
777 
778  int members;
779  int memsize,size;
781  };
782 
784  class MethItem:
785  public Item
786  {
787  public:
788  MethItem(AttrItem *conn = NULL);
789  virtual ~MethItem();
790 
791  void SetArgs(methfun fun,int argc,metharg *args);
792 
793  int index;
794  int argc;
796  methfun fun;
797  };
798 
800  class AttrItem:
801  public Item
802  {
803  public:
804  AttrItem(const t_symbol *tag,metharg tp,methfun fun,int flags);
805 
806  enum {
807  afl_get = 0x01, afl_set = 0x02,
808  afl_getset = afl_get|afl_set,
809  afl_shown = 0x08
810  };
811 
812  bool IsGet() const { return (flags&afl_getset) == afl_get; }
813  bool IsSet() const { return (flags&afl_getset) == afl_set; }
814  bool IsShown() const { return (flags&afl_shown) != 0; }
815  bool BothExist() const { return counter != NULL; }
816  AttrItem *Counterpart() { return counter; }
817 
818  int index;
819  int flags;
821  methfun fun;
823  const t_symbol *tag;
824  };
825 
827  class AttrData:
828  public flext_root
829  {
830  public:
831  AttrData(): flags(0) {}
832 
833  enum { afl_save = 0x01,afl_init = 0x02,afl_inited = 0x04 };
834 
835  void SetSave(bool s) { if(s) flags |= afl_save; else flags &= ~afl_save; }
836  bool IsSaved() const { return (flags&afl_save) != 0; }
837  void SetInit(bool s) { if(s) flags |= afl_init; else flags &= ~afl_init; }
838  bool IsInit() const { return (flags&afl_init) != 0; }
839  void SetInitValue(int argc,const t_atom *argv) { init(argc,argv); flags |= afl_inited; }
840  void SetInitValue(const AtomList &l) { SetInitValue(l.Count(),l.Atoms()); }
841  bool IsInitValue() const { return (flags&afl_inited) != 0; }
842  const AtomList &GetInitValue() const { return init; }
843 
844  AtomList init;
845  int flags;
846  };
847 
849  :public TablePtrMap<const t_symbol *,AttrData *,8>
850  {
851  public:
852  virtual ~AttrDataCont();
853  virtual void clear();
854  };
855 
856  // these outlet functions don't check for thread but send directly to the real-time system
857  void ToSysBang(int n) const { outlet *o = GetOut(n); if(o) { CRITON(); outlet_bang((t_outlet *)o); CRITOFF(); } }
858  void ToSysFloat(int n,float f) const { outlet *o = GetOut(n); if(o) { CRITON(); outlet_float((t_outlet *)o,f); CRITOFF(); } }
859  void ToSysInt(int n,int f) const { outlet *o = GetOut(n); if(o) { CRITON(); outlet_flint((t_outlet *)o,f); CRITOFF(); } }
860  void ToSysSymbol(int n,const t_symbol *s) const { outlet *o = GetOut(n); if(o) { CRITON(); outlet_symbol((t_outlet *)o,const_cast<t_symbol *>(s)); CRITOFF(); } }
861  void ToSysString(int n,const char *s) const { ToSysSymbol(n,MakeSymbol(s)); }
862  void ToSysList(int n,int argc,const t_atom *argv) const { outlet *o = GetOut(n); if(o) { CRITON(); outlet_list((t_outlet *)o,const_cast<t_symbol *>(sym_list),argc,(t_atom *)argv); CRITOFF(); } }
863  void ToSysList(int n,const AtomList &list) const { ToSysList(n,list.Count(),list.Atoms()); }
864  void ToSysAnything(int n,const t_symbol *s,int argc,const t_atom *argv) const { outlet *o = GetOut(n); if(o) { CRITON(); outlet_anything((t_outlet *)o,const_cast<t_symbol *>(s),argc,(t_atom *)argv); CRITOFF(); } }
865  void ToSysAnything(int n,const AtomAnything &any) const { ToSysAnything(n,any.Header(),any.Count(),any.Atoms()); }
866  void ToSysAnything(int n,const t_symbol *s,const AtomList &list) const { ToSysAnything(n,s,list.Count(),list.Atoms()); }
867 
868  void ToSysBool(int n,bool f) const { ToSysInt(n,f?1:0); }
869  void ToSysAtom(int n,const t_atom &at) const;
870  void ToSysDouble(int n,double d) const { t_atom dbl[2]; ToSysList(n,2,SetDouble(dbl,d)); }
871 
872  static void ToSysMsg(MsgBundle *mb);
873 
874  // add class method handlers
875  static void AddMessageMethods(t_class *c,bool dsp,bool dspin);
876 
877 private:
878  class pxbnd_object;
879 public:
880 
882  class BindItem:
883  public Item
884  {
885  public:
886  BindItem(bool (*f)(flext_base *,t_symbol *s,int,t_atom *,void *),pxbnd_object *px);
887  virtual ~BindItem();
888 
889  void Unbind(const t_symbol *s);
890 
891  bool (*fun)(flext_base *,t_symbol *s,int,t_atom *,void *);
893  };
894 
895  ItemCont *ThMeths() { if(!methhead) methhead = new ItemCont; return methhead; }
896  static ItemCont *ClMeths(t_classid c);
897 
899  static void AddMethod(ItemCont *ma,int inlet,const t_symbol *tag,methfun fun,metharg tp,...);
900 
901  ItemCont *ThAttrs() { return attrhead; }
902  static ItemCont *ClAttrs(t_classid c);
903 
904  static void AddAttrib(ItemCont *aa,ItemCont *ma,const t_symbol *attr,metharg tp,methfun gfun,methfun sfun);
905  void AddAttrib(const t_symbol *attr,metharg tp,methfun gfun,methfun sfun);
906  static void AddAttrib(t_classid c,const t_symbol *attr,metharg tp,methfun gfun,methfun sfun);
907 
908 private:
909 
910  static inline flext_base *thisObject(flext_hdr *c) { return FLEXT_CAST<flext_base *>(c->data); }
911 
912  static void Setup(t_classid c);
913 
915  class FLEXT_SHARE xlet {
916  public:
917  xlet();
918  ~xlet();
919 
921  char *desc;
922 
923  void Desc(const char *c);
924  };
925 
926  static xlet inlist[];
927  static xlet outlist[];
928 
930  static const t_symbol *curtag;
932  unsigned char incnt,outcnt,insigs,outsigs;
933 
934  outlet **outlets;
935 
936  union t_any {
937  float ft;
938  int it;
939  bool bt;
940  const t_symbol *st;
941 #if FLEXT_SYS == FLEXT_SYS_PD
942  t_gpointer *pt;
943 #endif
944  void *vt;
945  };
946 
947  typedef bool (*methfun_V)(flext_base *c,int argc,t_atom *argv);
948  typedef bool (*methfun_A)(flext_base *c,const t_symbol *s,int argc,t_atom *argv);
949  typedef bool (*methfun_0)(flext_base *c);
950  typedef bool (*methfun_1)(flext_base *c,t_any &);
951  typedef bool (*methfun_2)(flext_base *c,t_any &,t_any &);
952  typedef bool (*methfun_3)(flext_base *c,t_any &,t_any &,t_any &);
953  typedef bool (*methfun_4)(flext_base *c,t_any &,t_any &,t_any &,t_any &);
954  typedef bool (*methfun_5)(flext_base *c,t_any &,t_any &,t_any &,t_any &,t_any &);
955 
956  mutable ItemCont *methhead;
957  mutable ItemCont *bindhead;
958 
959  bool FindMeth(int inlet,const t_symbol *s,int argc,const t_atom *argv);
960  bool FindMethAny(int inlet,const t_symbol *s,int argc,const t_atom *argv);
961  bool TryMethTag(Item *lst,const t_symbol *tag,int argc,const t_atom *argv);
962  bool TryMethSym(Item *lst,const t_symbol *s);
963  bool TryMethAny(Item *lst,const t_symbol *s,int argc,const t_atom *argv);
964 
965  mutable ItemCont *attrhead;
967 
968  AttrItem *FindAttrib(const t_symbol *tag,bool get,bool msg = false) const;
969 
970  bool InitAttrib(int argc,const t_atom *argv);
971 
972  bool DumpAttrib(const t_symbol *tag,AttrItem *a) const;
973  bool GetAttrib(const t_symbol *tag,AttrItem *a,AtomList &l) const;
974  bool SetAttrib(const t_symbol *tag,AttrItem *a,int argc,const t_atom *argv);
975  bool SetAttrib(const t_symbol *tag,AttrItem *a,const AtomList &l) { return SetAttrib(tag,a,l.Count(),l.Atoms()); }
976  // get and set the attribute
977  bool BangAttrib(const t_symbol *tag,AttrItem *a);
978  // show/hide the attribute
979  bool ShowAttrib(AttrItem *a,bool show) const;
980 
981  static bool cb_ListMethods(flext_base *c,int argc,const t_atom *argv);
982  static bool cb_ListAttrib(flext_base *c) { Locker lock(c); return c->ListAttrib(); }
983 
984  // queue stuff
985 
987  static void StartQueue();
988 #if FLEXT_QMODE == 2
989  static void QWorker(thr_params *);
991 #endif
992  static void QFlush(flext_base *th = NULL);
994 
995  static bool qustarted;
996 
997 #if FLEXT_SYS == FLEXT_SYS_PD
998 
999  static void SetGfx(t_classid c);
1000 
1001 #ifndef FLEXT_NOATTREDIT
1002  // attribute editor
1003  static bool cb_AttrDialog(flext_base *c,int argc,const t_atom *argv);
1004  static void cb_GfxProperties(flext_hdr *c, t_glist *);
1005 #endif
1006 
1007 #ifdef FLEXT_ATTRHIDE
1008  static void cb_GfxVis(flext_hdr *c, t_glist *gl, int vis);
1009  static void cb_GfxSave(flext_hdr *c, t_binbuf *b);
1010  static void cb_GfxSelect(flext_hdr *x, struct _glist *glist, int state);
1011 
1012  void BinbufArgs(t_binbuf *b,t_binbuf *args,bool withname,bool transdoll);
1013  void BinbufAttr(t_binbuf *b,bool transdoll);
1014 #endif
1015 
1016  static void cb_bang(flext_hdr *c);
1017  static void cb_float(flext_hdr *c,t_float f);
1018  static void cb_symbol(flext_hdr *c,const t_symbol *s);
1019 // static void cb_pointer(fltext_hdr *c,const t_gpointer *p);
1020  static void cb_anything(flext_hdr *c,const t_symbol *s,int argc,t_atom *argv);
1021 
1022  // proxy object (for additional inlets)
1023  static t_class *px_class;
1024 
1025  struct px_object // no virtual table!
1026  {
1027  t_object obj; // MUST reside at memory offset 0
1029  int index;
1030 
1031  void init(flext_base *b,int ix) { base = b; index = ix; }
1032  static void px_bang(px_object *c);
1033  static void px_float(px_object *c,t_float f);
1034  static void px_symbol(px_object *c,const t_symbol *s);
1035 // static void px_pointer(px_object *c,const t_gpointer *p);
1036  static void px_anything(px_object *c,const t_symbol *s,int argc,t_atom *argv);
1037  };
1038 
1039  static void cb_px_ft1(flext_hdr *c,t_float f);
1040  static void cb_px_ft2(flext_hdr *c,t_float f);
1041  static void cb_px_ft3(flext_hdr *c,t_float f);
1042  static void cb_px_ft4(flext_hdr *c,t_float f);
1043  static void cb_px_ft5(flext_hdr *c,t_float f);
1044  static void cb_px_ft6(flext_hdr *c,t_float f);
1045  static void cb_px_ft7(flext_hdr *c,t_float f);
1046  static void cb_px_ft8(flext_hdr *c,t_float f);
1047  static void cb_px_ft9(flext_hdr *c,t_float f);
1048 
1049 #elif FLEXT_SYS == FLEXT_SYS_MAX
1050  typedef object px_object;
1051  static void cb_bang(flext_hdr *c);
1052  static void cb_float(flext_hdr *c,double f);
1053  static void cb_int(flext_hdr *c,long v);
1054  static void cb_anything(flext_hdr *c,const t_symbol *s,short argc,t_atom *argv);
1055 
1056  static void cb_px_in1(flext_hdr *c,long v);
1057  static void cb_px_in2(flext_hdr *c,long v);
1058  static void cb_px_in3(flext_hdr *c,long v);
1059  static void cb_px_in4(flext_hdr *c,long v);
1060  static void cb_px_in5(flext_hdr *c,long v);
1061  static void cb_px_in6(flext_hdr *c,long v);
1062  static void cb_px_in7(flext_hdr *c,long v);
1063  static void cb_px_in8(flext_hdr *c,long v);
1064  static void cb_px_in9(flext_hdr *c,long v);
1065 
1066  static void cb_px_ft1(flext_hdr *c,double f);
1067  static void cb_px_ft2(flext_hdr *c,double f);
1068  static void cb_px_ft3(flext_hdr *c,double f);
1069  static void cb_px_ft4(flext_hdr *c,double f);
1070  static void cb_px_ft5(flext_hdr *c,double f);
1071  static void cb_px_ft6(flext_hdr *c,double f);
1072  static void cb_px_ft7(flext_hdr *c,double f);
1073  static void cb_px_ft8(flext_hdr *c,double f);
1074  static void cb_px_ft9(flext_hdr *c,double f);
1075 #endif
1076 
1077  px_object **inlets;
1078 
1079  // --------- symbol-bound proxy
1080 
1081  static t_class *pxbnd_class;
1082 
1084  public flext_root
1085  // no virtual table!
1086  {
1087  public:
1088  t_object obj; // MUST reside at memory offset 0
1091  void *data;
1092 
1093  void init(flext_base *b,BindItem *it,void *d) { base = b; item = it; data = d; }
1094  static void px_method(pxbnd_object *c,const t_symbol *s,int argc,t_atom *argv);
1095  };
1096 
1098  static void SetupBindProxy();
1099 
1100  // ---------
1101 
1103  static void SetProxies(t_class *c,bool dsp);
1104 
1106  bool InitInlets();
1107 
1109  bool InitOutlets();
1110 
1111  // callback functions
1112 
1113  static void cb_loadbang(flext_hdr *c);
1114 
1115 #if FLEXT_SYS == FLEXT_SYS_MAX
1116  char **indesc,**outdesc;
1117 
1118  static void cb_assist(flext_hdr *c,void *b,long msg,long arg,char *s);
1119  static void cb_click (flext_hdr *c, Point pt, short mods);
1120 
1121  static void cb_dsp(flext_hdr *c,t_signal **s,short *count);
1122 #elif FLEXT_SYS == FLEXT_SYS_PD
1123  static void cb_click(flext_hdr *z,t_floatarg xpos,t_floatarg ypos,t_floatarg shift,t_floatarg ctrl,t_floatarg alt);
1124 
1125  static void cb_dsp(flext_hdr *c,t_signal **s);
1126 #endif
1127 };
1128 
1129 #include "flpopns.h"
1130 
1131 #endif
void AddMethod(int inlet, const char *tag, bool(*m)(flext_base *, t_symbol *, int, t_atom *))
Definition: flclass.h:448
px_object ** inlets
Definition: flclass.h:1077
void AddInInt(int m=1)
Add inlet(s) for integers.
Definition: flclass.h:126
Definition: flclass.h:721
void ToQueueAnything(int n, const AtomAnything &any) const
Output low priority anything (index n starts with 0)
Definition: flclass.h:276
void ToOutAnything(int n, const AtomAnything &any) const
Output anything (index n starts with 0)
Definition: flclass.h:235
void MsgSelfDouble(MsgBundle *mb, int n, double d) const
Output double (index n starts with 0)
Definition: flclass.h:374
ItemCont * ThAttrs()
Definition: flclass.h:901
void ToSelfDouble(int n, double d) const
Send double to self (index n starts with 0)
Definition: flclass.h:298
void MsgSelfList(MsgBundle *mb, int n, int argc, const t_atom *argv) const
Send list to self (inlet n)
Definition: flclass.h:385
void AddOutList(int m=1)
Add outlet(s) for lists.
Definition: flclass.h:163
void AddMethod(int inlet, const t_symbol *tag, bool(*m)(flext_base *, t_symbol *, int, t_atom *))
Definition: flclass.h:440
void ToSelfAtom(int n, const t_atom &at) const
Output atom (index n starts with 0)
Definition: flclass.h:306
ItemSet & GetInlet(int inlet=0)
Get list for an inlet.
Definition: flclass.h:765
int Min() const
Definition: flclass.h:752
void MsgSelfInt(MsgBundle *mb, int n, int f) const
Send integer to self (inlet n)
Definition: flclass.h:368
unsigned char outsigs
Definition: flclass.h:932
This represents an item of the method list.
Definition: flclass.h:784
Internal flext base classes.
float ft
Definition: flclass.h:937
void ToSelfList(int n, const AtomList &list) const
Send list to self (inlet n)
Definition: flclass.h:311
static void AddMethod(t_classid c, int inlet, const char *tag, bool(*m)(flext_base *, const t_symbol *, int, const t_atom *))
Definition: flclass.h:501
static const t_symbol * curtag
current message tag
Definition: flclass.h:930
void ToSysInt(int n, int f) const
Definition: flclass.h:859
void MsgAddList(MsgBundle *mb, int n, const AtomList &list) const
Output list (index n starts with 0)
Definition: flclass.h:355
pxbnd_object * px
Definition: flclass.h:892
void AddInSymbol(const char *desc, int m=1)
Add inlet(s) for symbol (with description)
Definition: flclass.h:132
const t_symbol * st
Definition: flclass.h:940
void ToOutList(int n, const AtomList &list) const
Output list (index n starts with 0)
Definition: flclass.h:230
int GetOutAttr() const
Definition: flclass.h:194
#define FLEXT_HEADER_S(NEW_CLASS, PARENT_CLASS, SETUPFUN)
Flext class header with setup function.
Definition: fldefs_hdr.h:47
void AddInInt(const char *desc, int m=1)
Add inlet(s) for integers (with description)
Definition: flclass.h:128
int flags
Definition: flclass.h:819
t_gpointer * pt
Definition: flclass.h:942
void AddAttrib(const char *attr, bool(*get)(flext_base *, AtomList *&), bool(*set)(flext_base *, AtomList *&))
Definition: flclass.h:622
void AddMethod(int inlet, bool(*m)(flext_base *, int, const t_atom *))
Definition: flclass.h:421
flext_base * base
Definition: flclass.h:1028
static void AddMethod(t_classid c, int inlet, const t_symbol *tag, bool(*m)(flext_base *, int, const t_atom *))
Definition: flclass.h:491
void ToSysAnything(int n, const t_symbol *s, int argc, const t_atom *argv) const
Definition: flclass.h:864
Definition: flclass.h:58
void * data
Definition: flclass.h:1091
void AddAttrib(const char *attr, bool(*get)(flext_base *, bool &), bool(*set)(flext_base *, bool &))
Definition: flclass.h:619
methfun fun
Definition: flclass.h:821
static void AddAttrib(t_classid c, const t_symbol *attr, bool(*get)(flext_base *, bool &), bool(*set)(flext_base *, bool &))
Definition: flclass.h:633
void AddMethod(int inlet, const t_symbol *tag, bool(*m)(flext_base *))
Definition: flclass.h:422
void ToOutString(int n, const char *s) const
Output string aka symbol (index n starts with 0)
Definition: flclass.h:222
BindItem * item
Definition: flclass.h:1090
void AddInList(int m=1)
Add inlet(s) for lists.
Definition: flclass.h:138
void AddMethod(int inlet, bool(*m)(flext_base *, int &))
Definition: flclass.h:432
void AddOutInt(int m=1)
Add outlet(s) for integers.
Definition: flclass.h:151
void ToSysFloat(int n, float f) const
Definition: flclass.h:858
static void AddMethod(t_classid c, int inlet, const t_symbol *tag, bool(*m)(flext_base *, const t_symbol *, int, const t_atom *))
Definition: flclass.h:493
static void AddMethod(t_classid c, int inlet, const char *tag, bool(*m)(flext_base *, t_symbol *&))
Definition: flclass.h:502
static void AddMethod(t_classid c, int inlet, bool(*m)(flext_base *, int &))
Definition: flclass.h:484
void SetInitValue(int argc, const t_atom *argv)
Definition: flclass.h:839
outlet ** outlets
Definition: flclass.h:934
xlettype
Definition: flclass.h:586
static void AddMethod(t_classid c, int inlet, const char *tag, bool(*m)(flext_base *, int &))
Definition: flclass.h:505
static void AddMethod(t_classid c, int inlet, const char *tag, bool(*m)(flext_base *, int, t_atom *))
Definition: flclass.h:498
void AddMethod(int inlet, bool(*m)(flext_base *, float &))
Definition: flclass.h:428
bool IsInitValue() const
Definition: flclass.h:841
void AddMethod(int inlet, bool(*m)(flext_base *, int &, int &))
Definition: flclass.h:436
void AddAttrib(const t_symbol *attr, bool(*get)(flext_base *, t_symptr &), bool(*set)(flext_base *, t_symptr &))
Definition: flclass.h:614
bool IsInit() const
Definition: flclass.h:838
bool BothExist() const
Definition: flclass.h:815
void AddInSymbol(int m=1)
Add inlet(s) for symbols.
Definition: flclass.h:130
Item(AttrItem *a)
Definition: flclass.h:724
AttrItem * counter
Definition: flclass.h:822
bool Unbind(const char *sym)
Unbind object from a symbol (as string)
Definition: flclass.h:527
flext support functions and classes
void AddMethod(int inlet, const t_symbol *tag, bool(*m)(flext_base *, float &))
Definition: flclass.h:444
static void AddMethod(t_classid c, int inlet, bool(*m)(flext_base *, t_symbol *, int, t_atom *))
Definition: flclass.h:476
static void AddMethod(t_classid c, int inlet, bool(*m)(flext_base *, int, const t_atom *))
Definition: flclass.h:473
void AddMethod(int inlet, bool(*m)(flext_base *))
Definition: flclass.h:419
void ToSelfAnything(int n, const AtomAnything &any) const
Send anything to self (inlet n)
Definition: flclass.h:316
static void AddMethod(t_classid c, int inlet, bool(*m)(flext_base *, int &, int &))
Definition: flclass.h:488
static t_class * pxbnd_class
Definition: flclass.h:1081
void AddMethod(int inlet, bool(*m)(flext_base *, int &, int &, int &))
Definition: flclass.h:437
int CntOut() const
Get number of outlets.
Definition: flclass.h:179
void AddAttrib(const t_symbol *attr, bool(*get)(flext_base *, AtomAnything *&), bool(*set)(flext_base *, AtomAnything *&))
Definition: flclass.h:616
Definition: flclass.h:746
static void AddMethod(t_classid c, int inlet, bool(*m)(flext_base *))
Definition: flclass.h:471
void AddMethod(int inlet, bool(*m)(flext_base *, const t_symbol *, int, const t_atom *))
Definition: flclass.h:425
void AddInList(const char *desc, int m=1)
Add inlet(s) for lists (with description)
Definition: flclass.h:140
void MsgSelfList(MsgBundle *mb, int n, const AtomList &list) const
Send list to self (inlet n)
Definition: flclass.h:387
void SetInitValue(const AtomList &l)
Definition: flclass.h:840
void AddMethod(int inlet, const char *tag, bool(*m)(flext_base *, t_symbol *&))
Definition: flclass.h:450
void ToQueueList(int n, const AtomList &list) const
Output low priority list (index n starts with 0)
Definition: flclass.h:271
void * vt
Definition: flclass.h:944
int argc
Definition: flclass.h:794
static void AddAttrib(t_classid c, const char *attr, bool(*get)(flext_base *, const t_symbol *&), bool(*set)(flext_base *, const t_symbol *&))
Definition: flclass.h:641
void AddMethod(int inlet, const char *tag, bool(*m)(flext_base *, int, t_atom *))
Definition: flclass.h:446
void AddAttrib(const t_symbol *attr, bool(*get)(flext_base *, int &), bool(*set)(flext_base *, int &))
Definition: flclass.h:611
void ToSysBang(int n) const
Definition: flclass.h:857
flext_base * base
Definition: flclass.h:1089
void ToSelfBool(int n, bool f) const
Send boolean to self (inlet n)
Definition: flclass.h:295
void ToSysAnything(int n, const t_symbol *s, const AtomList &list) const
Definition: flclass.h:866
bool IsSet() const
Definition: flclass.h:813
static void AddAttrib(t_classid c, const char *attr, bool(*get)(flext_base *, AtomList *&), bool(*set)(flext_base *, AtomList *&))
Definition: flclass.h:643
void MsgSelfAnything(MsgBundle *mb, int n, const AtomAnything &any) const
Send anything to self (inlet n)
Definition: flclass.h:392
methfun fun
Definition: flclass.h:796
This represents either an inlet or outlet during construction.
Definition: flclass.h:915
metharg * args
Definition: flclass.h:795
void AddAttrib(const t_symbol *attr, bool(*get)(flext_base *, float &), bool(*set)(flext_base *, float &))
Definition: flclass.h:610
static void AddMethod(t_classid c, int inlet, bool(*m)(flext_base *, int &, int &, int &))
Definition: flclass.h:489
void AddMethod(int inlet, bool(*m)(flext_base *, t_symbol *, int, t_atom *))
Definition: flclass.h:424
static void AddAttrib(t_classid c, const t_symbol *attr, bool(*get)(flext_base *, int &), bool(*set)(flext_base *, int &))
Definition: flclass.h:632
t_symbol * t_symptr
Definition: flstdc.h:225
bool SetAttrib(const t_symbol *s, const AtomList &a)
Set an attribute value.
Definition: flclass.h:667
AtomList init
Definition: flclass.h:844
void AddAttrib(const t_symbol *attr, bool(*get)(flext_base *, bool &), bool(*set)(flext_base *, bool &))
Definition: flclass.h:612
bool SetupInOut()
Definition: flclass.h:168
Definition: flclass.h:406
bool ShowAttrib(const char *a, bool show)
Definition: flclass.h:678
#define FLEXT_ASSERT(b)
Definition: flstdc.h:284
static void AddAttrib(t_classid c, const t_symbol *attr, bool(*get)(flext_base *, AtomList *&), bool(*set)(flext_base *, AtomList *&))
Definition: flclass.h:636
void ToSysList(int n, int argc, const t_atom *argv) const
Definition: flclass.h:862
void AddInFloat(int m=1)
Add inlet(s) for floats.
Definition: flclass.h:122
TablePtrMap< const t_symbol *, Item *, 8 > TablePtrMapDef
Definition: flclass.h:733
static void AddMethod(t_classid c, int inlet, bool(*m)(flext_base *, const t_symbol *, int, const t_atom *))
Definition: flclass.h:477
void ToSysAnything(int n, const AtomAnything &any) const
Definition: flclass.h:865
static void AddMethod(t_classid c, int inlet, const t_symbol *tag, bool(*m)(flext_base *, int, t_atom *))
Definition: flclass.h:490
void MsgAddAnything(MsgBundle *mb, int n, const AtomAnything &any) const
Output anything (index n starts with 0)
Definition: flclass.h:360
ItemCont * bindhead
Definition: flclass.h:957
Definition: flclass.h:848
void MsgAddString(MsgBundle *mb, int n, const char *s) const
Output string aka symbol (to appointed outlet)
Definition: flclass.h:346
void AddMethodDef(int inlet, const t_symbol *tag=NULL)
Definition: flclass.h:416
static void AddAttrib(t_classid c, const t_symbol *attr, bool(*get)(flext_base *, t_symptr &), bool(*set)(flext_base *, t_symptr &))
Definition: flclass.h:635
metharg
Definition: flclass.h:401
void MsgAddDouble(MsgBundle *mb, int n, double d) const
Output double (index n starts with 0)
Definition: flclass.h:341
Definition: flmap.h:190
void AddInFloat(const char *desc, int m=1)
Add inlet(s) for floats (with description)
Definition: flclass.h:124
void AddInBang(int m=1)
Add inlet(s) for bang.
Definition: flclass.h:134
void MsgSelfString(MsgBundle *mb, int n, const char *s) const
Send string aka symbol to self (inlet 0)
Definition: flclass.h:379
static const t_symbol * thisTag()
Retrieve currently processed message tag (NULL if no message processing)
Definition: flclass.h:187
Definition: flclass.h:588
static void AddAttrib(t_classid c, const t_symbol *attr, bool(*get)(flext_base *, float &), bool(*set)(flext_base *, float &))
Definition: flclass.h:631
static void AddAttrib(t_classid c, const char *attr, bool(*get)(flext_base *, t_symptr &), bool(*set)(flext_base *, t_symptr &))
Definition: flclass.h:642
static void AddAttrib(t_classid c, const char *attr, bool(*get)(flext_base *, bool &), bool(*set)(flext_base *, bool &))
Definition: flclass.h:640
void AddInBang(const char *desc, int m=1)
Add inlet(s) for bangs (with description)
Definition: flclass.h:136
Represent a data value of an attribute.
Definition: flclass.h:827
bool Bind(const char *sym)
Bind object to a symbol (as string)
Definition: flclass.h:525
static void AddMethod(t_classid c, int inlet, bool(*m)(flext_base *, float &, float &))
Definition: flclass.h:481
int Max() const
Definition: flclass.h:753
void AddAttrib(const t_symbol *attr, bool(*get)(flext_base *, AtomList *&), bool(*set)(flext_base *, AtomList *&))
Definition: flclass.h:615
void MsgSelfAnything(MsgBundle *mb, int n, const t_symbol *s, int argc, const t_atom *argv) const
Send anything to self (inlet n)
Definition: flclass.h:390
char * desc
Definition: flclass.h:921
void AddAttrib(const char *attr, bool(*get)(flext_base *, AtomAnything *&), bool(*set)(flext_base *, AtomAnything *&))
Definition: flclass.h:623
bool Contained(int i) const
Definition: flclass.h:755
bool IsAttr() const
Definition: flclass.h:727
void ToOutAnything(int n, const t_symbol *s, const AtomList &list) const
Output anything (index n starts with 0)
Definition: flclass.h:237
AttrItem * Counterpart()
Definition: flclass.h:816
const AtomList & GetInitValue() const
Definition: flclass.h:842
Definition: flclass.h:404
void AddAttrib(const char *attr, bool(*get)(flext_base *, const t_symbol *&), bool(*set)(flext_base *, const t_symbol *&))
Definition: flclass.h:620
const t_symbol * tag
Definition: flclass.h:823
bool ListAttrib() const
List attributes.
Definition: flattr.cpp:195
ItemCont * ThMeths()
Definition: flclass.h:895
#define FLEXT_TEMPINST(fun)
Definition: flprefix.h:457
bool IsGet() const
Definition: flclass.h:812
static void AddMethod(t_classid c, int inlet, bool(*m)(flext_base *, const t_symbol *&))
Definition: flclass.h:479
void AddAttrib(const t_symbol *attr, bool(*get)(flext_base *, const t_symbol *&), bool(*set)(flext_base *, const t_symbol *&))
Definition: flclass.h:613
static void AddAttrib(t_classid c, const char *attr, bool(*get)(flext_base *, float &), bool(*set)(flext_base *, float &))
Definition: flclass.h:638
ItemCont * methhead
Definition: flclass.h:956
Definition: flclass.h:735
#define FLEXT_TEMPLATE
Definition: flprefix.h:455
void ToOutDouble(int n, double d) const
Output double (index n starts with 0)
Definition: flclass.h:217
void AddMethod(int inlet, bool(*m)(flext_base *, t_symbol *&))
Definition: flclass.h:426
void MsgAddBool(MsgBundle *mb, int n, bool f) const
Output boolean (index n starts with 0)
Definition: flclass.h:338
xlettype tp
Definition: flclass.h:920
AttrDataCont * attrdata
Definition: flclass.h:966
static void AddMethod(t_classid c, int inlet, const char *tag, bool(*m)(flext_base *))
Definition: flclass.h:475
bool UnbindMethod(const char *sym, bool(*meth)(flext_base *obj, t_symbol *sym, int argc, t_atom *argv, void *data)=NULL, void **data=NULL)
Unbind a method from a symbol (as string)
Definition: flclass.h:554
void AddMethod(int inlet, const char *tag, bool(*m)(flext_base *, const t_symbol *, int, const t_atom *))
Definition: flclass.h:449
static void AddMethod(t_classid c, int inlet, const t_symbol *tag, bool(*m)(flext_base *, t_symbol *&))
Definition: flclass.h:494
void AddOutBang(const char *desc, int m=1)
Add outlet(s) for bangs (with description)
Definition: flclass.h:161
Definition: flclass.h:1083
static void AddMethod(t_classid c, int inlet, const t_symbol *tag, bool(*m)(flext_base *))
Definition: flclass.h:474
The obligatory PD or Max/MSP object header.
Definition: flbase.h:38
void ToSelfInt(int n, int f) const
Send integer to self (inlet n)
Definition: flclass.h:292
static bool qustarted
Definition: flclass.h:995
t_object obj
Definition: flclass.h:1027
void AddMethod(int inlet, const t_symbol *tag, bool(*m)(flext_base *, const t_symbol *&))
Definition: flclass.h:443
int CntOutSig() const
Get number of signal outlets.
Definition: flclass.h:183
void SetSave(bool s)
Definition: flclass.h:835
This represents an item of the symbol-bound method list.
Definition: flclass.h:882
void AddMethod(int inlet, const t_symbol *tag, bool(*m)(flext_base *, int, t_atom *))
Definition: flclass.h:438
static void AddMethod(t_classid c, int inlet, bool(*m)(flext_base *, float &, float &, float &))
Definition: flclass.h:482
int index
Definition: flclass.h:1029
void AddMethod(int inlet, const char *tag, bool(*m)(flext_base *, float &))
Definition: flclass.h:452
void AddOutInt(const char *desc, int m=1)
Add outlet(s) for integers (with description)
Definition: flclass.h:153
AttrData()
Definition: flclass.h:831
void AddAttrib(const char *attr, bool(*get)(flext_base *, t_symptr &), bool(*set)(flext_base *, t_symptr &))
Definition: flclass.h:621
bool GetBoundMethod(const char *sym, bool(*meth)(flext_base *obj, t_symbol *sym, int argc, t_atom *argv, void *data), void *&data)
Get data of bound method of a symbol (as string)
Definition: flclass.h:556
void ToSelfList(int n, int argc, const t_atom *argv) const
Send list to self (inlet n)
Definition: flclass.h:309
void ToSelfFloat(int n, float f) const
Send float to self (inlet n)
Definition: flclass.h:289
void AddMethod(int inlet, bool(*m)(flext_base *, float &, float &, float &))
Definition: flclass.h:430
#define FLEXT_SHARE
Definition: flprefix.h:418
void AddMethod(int inlet, const char *tag, bool(*m)(flext_base *, const t_symbol *&))
Definition: flclass.h:451
void AddOutFloat(const char *desc, int m=1)
Add outlet(s) for floats (with description)
Definition: flclass.h:149
void init(flext_base *b, int ix)
Definition: flclass.h:1031
static void AddMethod(t_classid c, int inlet, const char *tag, bool(*m)(flext_base *, float &))
Definition: flclass.h:504
static void AddMethod(t_classid c, int inlet, const t_symbol *tag, bool(*m)(flext_base *, const t_symbol *&))
Definition: flclass.h:495
This represents an item of the attribute list.
Definition: flclass.h:800
void AddOutSymbol(int m=1)
Add outlet(s) for symbols.
Definition: flclass.h:155
static void AddMethod(t_classid c, int inlet, const t_symbol *tag, bool(*m)(flext_base *, int &))
Definition: flclass.h:497
Definition: flclass.h:589
static t_class * px_class
Definition: flclass.h:1023
void ToQueueBool(int n, bool f) const
Output low priority boolean (index n starts with 0)
Definition: flclass.h:255
void MsgSelfBool(MsgBundle *mb, int n, bool f) const
Send boolean to self (inlet n)
Definition: flclass.h:371
static void AddAttrib(t_classid c, const t_symbol *attr, bool(*get)(flext_base *, const t_symbol *&), bool(*set)(flext_base *, const t_symbol *&))
Definition: flclass.h:634
bool DumpAttrib(const char *attr) const
Dump an attribute to the attribute outlet.
Definition: flclass.h:651
void AddOutList(const char *desc, int m=1)
Add outlet(s) for lists (with description)
Definition: flclass.h:165
ItemSet ** cont
Definition: flclass.h:780
int flags
Definition: flclass.h:845
void AddAttrib(const char *attr, bool(*get)(flext_base *, float &), bool(*set)(flext_base *, float &))
Definition: flclass.h:617
void AddInAnything(const char *desc, int m=1)
Add inlet(s) for anythings (with description)
Definition: flclass.h:120
int size
Definition: flclass.h:779
void MsgSelfAtom(MsgBundle *mb, int n, const t_atom &at) const
Output atom (index n starts with 0)
Definition: flclass.h:382
void AddMethod(int inlet, const t_symbol *tag, bool(*m)(flext_base *, int, const t_atom *))
Definition: flclass.h:439
static flext_base * thisObject(flext_hdr *c)
Definition: flclass.h:910
int index
Definition: flclass.h:793
int CntInSig() const
Get number of signal inlets.
Definition: flclass.h:181
void AddMethod(int inlet, const char *tag, bool(*m)(flext_base *, int, const t_atom *))
Definition: flclass.h:447
bool IsShown() const
Definition: flclass.h:814
void ToSysString(int n, const char *s) const
Definition: flclass.h:861
static int CheckAttrib(const AtomList &args, int offset=0)
Definition: flclass.h:656
void AddAttrib(const char *attr, bool(*get)(flext_base *, int &), bool(*set)(flext_base *, int &))
Definition: flclass.h:618
static void AddMethod(t_classid c, int inlet, const t_symbol *tag, bool(*m)(flext_base *, t_symbol *, int, t_atom *))
Definition: flclass.h:492
Definition: flclass.h:936
#define FLEXT_CLASSDEF(CL)
Definition: flprefix.h:383
outlet * GetOut(int ix) const
Get pointer to outlet (not in the constructor!)
Definition: flclass.h:192
void AddMethod(int inlet, const char *tag, bool(*m)(flext_base *))
Definition: flclass.h:423
void ToQueueDouble(int n, double d) const
Output double (index n starts with 0)
Definition: flclass.h:258
static void AddMethod(t_classid c, int inlet, const t_symbol *tag, bool(*m)(flext_base *, float &))
Definition: flclass.h:496
static void AddAttrib(t_classid c, const char *attr, bool(*get)(flext_base *, AtomAnything *&), bool(*set)(flext_base *, AtomAnything *&))
Definition: flclass.h:644
ItemCont * attrhead
Definition: flclass.h:965
t_object obj
Definition: flclass.h:1088
static void AddMethod(t_classid c, int inlet, const char *tag, bool(*m)(flext_base *, t_symbol *, int, t_atom *))
Definition: flclass.h:500
void ToSysList(int n, const AtomList &list) const
Definition: flclass.h:863
metharg argtp
Definition: flclass.h:820
static void AddMethod(t_classid c, int inlet, bool(*m)(flext_base *, t_symbol *&))
Definition: flclass.h:478
int Members() const
Get counter for total members (for index of new item)
Definition: flclass.h:772
static void AddMethod(t_classid c, int inlet, const char *tag, bool(*m)(flext_base *, const t_symbol *&))
Definition: flclass.h:503
void SetInit(bool s)
Definition: flclass.h:837
void ToSelfSymbol(int n, const t_symbol *s) const
Send symbol to self (inlet n)
Definition: flclass.h:301
void AddMethod(int inlet, bool(*m)(flext_base *, int, t_atom *))
Definition: flclass.h:420
static void AddMethod(t_classid c, int inlet, const char *tag, bool(*m)(flext_base *, int, const t_atom *))
Definition: flclass.h:499
bool IsSaved() const
Definition: flclass.h:836
Item * nxt
Definition: flclass.h:730
bool bt
Definition: flclass.h:939
void AddOutSymbol(const char *desc, int m=1)
Add outlet(s) for symbols (with description)
Definition: flclass.h:157
static void AddMethod(t_classid c, int inlet, bool(*m)(flext_base *, float &))
Definition: flclass.h:480
void AddMethod(int inlet, const char *tag, bool(*m)(flext_base *, int &))
Definition: flclass.h:453
void MsgSelfBang(MsgBundle *mb, int n) const
Definition: flclass.h:362
void AddMethodDef(int inlet, const char *tag=NULL)
Definition: flclass.h:417
static void AddMethod(t_classid c, int inlet, bool(*m)(flext_base *, int, t_atom *))
Definition: flclass.h:472
Definition: flclass.h:405
Definition: flclass.h:403
void AddMethod(int inlet, const t_symbol *tag, bool(*m)(flext_base *, const t_symbol *, int, const t_atom *))
Definition: flclass.h:441
void AddMethod(int inlet, const t_symbol *tag, bool(*m)(flext_base *, int &))
Definition: flclass.h:445
static void AddAttrib(t_classid c, const t_symbol *attr, bool(*get)(flext_base *, AtomAnything *&), bool(*set)(flext_base *, AtomAnything *&))
Definition: flclass.h:637
void AddMethod(int inlet, bool(*m)(flext_base *, float &, float &))
Definition: flclass.h:429
AttrItem * attr
Definition: flclass.h:729
void ToSysDouble(int n, double d) const
Definition: flclass.h:870
void ToSelfString(int n, const char *s) const
Send string aka symbol to self (inlet 0)
Definition: flclass.h:303
int it
Definition: flclass.h:938
void MsgSelfSymbol(MsgBundle *mb, int n, const t_symbol *s) const
Send symbol to self (inlet n)
Definition: flclass.h:377
special map class (faster and less memory-consuming than std::map)
void AddOutFloat(int m=1)
Add outlet(s) for floats.
Definition: flclass.h:147
void init(flext_base *b, BindItem *it, void *d)
Definition: flclass.h:1093
void AddMethod(int inlet, const t_symbol *tag, bool(*m)(flext_base *, t_symbol *&))
Definition: flclass.h:442
void ToOutBool(int n, bool f) const
Output boolean (index n starts with 0)
Definition: flclass.h:214
bool BangAttrib(const char *a)
Definition: flclass.h:672
void AddOutAnything(int m=1)
Add outlet(s) for anythings.
Definition: flclass.h:143
void ToSysBool(int n, bool f) const
Definition: flclass.h:868
bool BindMethod(const char *sym, bool(*meth)(flext_base *obj, t_symbol *sym, int argc, t_atom *argv, void *data), void *data=NULL)
Bind a method to a symbol (as string)
Definition: flclass.h:552
static bool cb_ListAttrib(flext_base *c)
Definition: flclass.h:982
void ToSelfAnything(int n, const t_symbol *s, int argc, const t_atom *argv) const
Send anything to self (inlet n)
Definition: flclass.h:314
void MsgSelfFloat(MsgBundle *mb, int n, float f) const
Send float to self (inlet n)
Definition: flclass.h:365
void ToQueueString(int n, const char *s) const
Output low priority string aka symbol (to appointed outlet)
Definition: flclass.h:263
void AddOutBang(int m=1)
Add outlet(s) for bangs.
Definition: flclass.h:159
static void AddAttrib(t_classid c, const char *attr, bool(*get)(flext_base *, int &), bool(*set)(flext_base *, int &))
Definition: flclass.h:639
void AddOutAnything(const char *desc, int m=1)
Add outlet(s) for anythings (with description)
Definition: flclass.h:145
void AddMethod(int inlet, bool(*m)(flext_base *, const t_symbol *&))
Definition: flclass.h:427
void ToSysSymbol(int n, const t_symbol *s) const
Definition: flclass.h:860
Definitions for internal flext usage.
Definition: flclass.h:1025
int index
Definition: flclass.h:818
int members
Definition: flclass.h:778
bool SetAttrib(const t_symbol *tag, AttrItem *a, const AtomList &l)
Definition: flclass.h:975