flext 0.6.2
flclass.h
Go to the documentation of this file.
1/*
2flext - C++ layer for Max and Pure Data externals
3
4Copyright (c) 2001-2017 Thomas Grill (gr@grrrr.org)
5For information on usage and redistribution, and for a DISCLAIMER OF ALL
6WARRANTIES, 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{
62
63 friend class FLEXT_SHARE FLEXT_CLASSDEF(flext_obj);
64
65public:
66
67// --- inheritable virtual methods --------------------------------
68
75 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
177 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
246 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
286 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
329 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 {
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
520 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
574 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
584public: // needed by VC++ 6
585
586 enum {
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
593protected:
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
688 unsigned long XletCode(int tp = xlet_none,...); // end list with 0 (= tp_none) !!
689
693 void AddInlets(unsigned long code);
694
696 void AddInlet(int tp,int mult = 1,const char *desc = NULL);
697
701 void AddOutlets(unsigned long code);
702
704 void AddOutlet(int 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
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
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,int *args);
792
793 int index;
794 int argc;
795 int *args;
796 methfun fun;
797 };
798
800 class AttrItem:
801 public Item
802 {
803 public:
804 AttrItem(const t_symbol *tag,int 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;
820 int argtp;
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
877private:
878 class pxbnd_object;
879public:
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,int 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,int tp,methfun gfun,methfun sfun);
905 void AddAttrib(const t_symbol *attr,int tp,methfun gfun,methfun sfun);
906 static void AddAttrib(t_classid c,const t_symbol *attr,int tp,methfun gfun,methfun sfun);
907
908private:
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
916 public:
917 xlet();
918 ~xlet();
919
920 int tp;
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
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
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
990 static void QWorker(thr_params *);
991#endif
993 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
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 t_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
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 typedef void *Point;
1120 static void cb_click (flext_hdr *c, Point pt, short mods);
1121#if MSP64
1122 static void cb_dsp64(flext_hdr *x, t_object *dsp64, short *count, double samplerate, long maxvectorsize, long flags);
1123#else
1124 static void cb_dsp(flext_hdr *c,t_signal **s,short *count);
1125#endif
1126
1127#elif FLEXT_SYS == FLEXT_SYS_PD
1128 static void cb_click(flext_hdr *z,t_floatarg xpos,t_floatarg ypos,t_floatarg shift,t_floatarg ctrl,t_floatarg alt);
1129
1130 static void cb_dsp(flext_hdr *c,t_signal **s);
1131#endif
1132};
1133
1134#include "flpopns.h"
1135
1136#endif
Definition: flmap.h:196
Definition: flclass.h:850
Represent a data value of an attribute.
Definition: flclass.h:829
bool IsInit() const
Definition: flclass.h:838
bool IsInitValue() const
Definition: flclass.h:841
const AtomList & GetInitValue() const
Definition: flclass.h:842
void SetSave(bool s)
Definition: flclass.h:835
bool IsSaved() const
Definition: flclass.h:836
void SetInitValue(const AtomList &l)
Definition: flclass.h:840
AtomList init
Definition: flclass.h:844
void SetInit(bool s)
Definition: flclass.h:837
AttrData()
Definition: flclass.h:831
int flags
Definition: flclass.h:845
void SetInitValue(int argc, const t_atom *argv)
Definition: flclass.h:839
This represents an item of the attribute list.
Definition: flclass.h:802
AttrItem * counter
Definition: flclass.h:822
int flags
Definition: flclass.h:819
int index
Definition: flclass.h:818
bool IsGet() const
Definition: flclass.h:812
bool IsShown() const
Definition: flclass.h:814
bool BothExist() const
Definition: flclass.h:815
const t_symbol * tag
Definition: flclass.h:823
int argtp
Definition: flclass.h:820
bool IsSet() const
Definition: flclass.h:813
AttrItem * Counterpart()
Definition: flclass.h:816
methfun fun
Definition: flclass.h:821
This represents an item of the symbol-bound method list.
Definition: flclass.h:884
pxbnd_object * px
Definition: flclass.h:892
Definition: flclass.h:747
bool Contained(int i) const
Definition: flclass.h:755
int members
Definition: flclass.h:778
ItemSet ** cont
Definition: flclass.h:780
int memsize
Definition: flclass.h:779
int Members() const
Get counter for total members (for index of new item)
Definition: flclass.h:772
ItemSet & GetInlet(int inlet=0)
Get list for an inlet.
Definition: flclass.h:765
int Min() const
Definition: flclass.h:752
int Max() const
Definition: flclass.h:753
Definition: flclass.h:722
AttrItem * attr
Definition: flclass.h:729
bool IsAttr() const
Definition: flclass.h:727
Item * nxt
Definition: flclass.h:730
Item(AttrItem *a)
Definition: flclass.h:724
Definition: flclass.h:737
This represents an item of the method list.
Definition: flclass.h:786
int index
Definition: flclass.h:793
int * args
Definition: flclass.h:795
methfun fun
Definition: flclass.h:796
int argc
Definition: flclass.h:794
Definition: flclass.h:1086
void * data
Definition: flclass.h:1091
BindItem * item
Definition: flclass.h:1090
void init(flext_base *b, BindItem *it, void *d)
Definition: flclass.h:1093
flext_base * base
Definition: flclass.h:1089
t_object obj
Definition: flclass.h:1088
This represents either an inlet or outlet during construction.
Definition: flclass.h:915
int tp
Definition: flclass.h:920
char * desc
Definition: flclass.h:921
Definition: flclass.h:60
ItemCont * bindhead
Definition: flclass.h:957
static t_class * px_class
Definition: flclass.h:1023
void ToSysInt(int n, int f) const
Definition: flclass.h:859
ItemCont * methhead
Definition: flclass.h:956
void AddMethod(int inlet, const char *tag, bool(*m)(flext_base *, int, const t_atom *))
Definition: flclass.h:447
px_object ** inlets
Definition: flclass.h:1077
void AddMethod(int inlet, const char *tag, bool(*m)(flext_base *, t_symbol *, int, t_atom *))
Definition: flclass.h:448
static void AddMethod(t_classid c, int inlet, const t_symbol *tag, bool(*m)(flext_base *, int, t_atom *))
Definition: flclass.h:490
void AddMethodDef(int inlet, const t_symbol *tag=NULL)
Definition: flclass.h:416
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, bool(*m)(flext_base *, float &, float &, float &))
Definition: flclass.h:482
bool TryMethSym(Item *lst, const t_symbol *s)
void AddMethod(int inlet, const t_symbol *tag, bool(*m)(flext_base *, const t_symbol *&))
Definition: flclass.h:443
ItemCont * attrhead
Definition: flclass.h:965
bool ShowAttrib(const char *a, bool show)
Definition: flclass.h:678
void ToSysAnything(int n, const t_symbol *s, const AtomList &list) const
Definition: flclass.h:866
static void AddMethod(t_classid c, int inlet, bool(*m)(flext_base *, int, t_atom *))
Definition: flclass.h:472
void AddMethod(int inlet, const char *tag, bool(*m)(flext_base *))
Definition: flclass.h:423
TablePtrMap< const t_symbol *, Item *, 8 > TablePtrMapDef
Definition: flclass.h:733
void ToSysList(int n, int argc, const t_atom *argv) const
Definition: flclass.h:862
void AddMethod(int inlet, bool(*m)(flext_base *, int &))
Definition: flclass.h:432
static void AddMethod(t_classid c, int inlet, const char *tag, bool(*m)(flext_base *, const t_symbol *&))
Definition: flclass.h:503
static void AddMethod(t_classid c, int inlet, bool(*m)(flext_base *, float &))
Definition: flclass.h:480
bool SetAttrib(const t_symbol *s, const AtomList &a)
Set an attribute value.
Definition: flclass.h:667
static void AddMethod(t_classid c, int inlet, const t_symbol *tag, bool(*m)(flext_base *, int &))
Definition: flclass.h:497
bool SetAttrib(const t_symbol *tag, AttrItem *a, const AtomList &l)
Definition: flclass.h:975
@ a_LIST
Definition: flclass.h:406
@ a_pointer
Definition: flclass.h:404
@ a_bool
Definition: flclass.h:403
@ a_any
Definition: flclass.h:405
void AddMethod(int inlet, bool(*m)(flext_base *, int, const t_atom *))
Definition: flclass.h:421
static void AddMethod(t_classid c, int inlet, bool(*m)(flext_base *, const t_symbol *, int, const t_atom *))
Definition: flclass.h:477
void AddMethod(int inlet, bool(*m)(flext_base *, int &, int &, int &))
Definition: flclass.h:437
bool DumpAttrib(const char *attr) const
Dump an attribute to the attribute outlet.
Definition: flclass.h:651
static bool qustarted
Definition: flclass.h:995
void AddMethodDef(int inlet, const char *tag=NULL)
Definition: flclass.h:417
static void AddMethod(t_classid c, int inlet, bool(*m)(flext_base *, const t_symbol *&))
Definition: flclass.h:479
void ToSysList(int n, const AtomList &list) const
Definition: flclass.h:863
void AddMethod(int inlet, bool(*m)(flext_base *, t_symbol *, int, t_atom *))
Definition: flclass.h:424
void ToSysString(int n, const char *s) const
Definition: flclass.h:861
void AddMethod(int inlet, bool(*m)(flext_base *, const t_symbol *&))
Definition: flclass.h:427
void AddMethod(int inlet, const char *tag, bool(*m)(flext_base *, t_symbol *&))
Definition: flclass.h:450
static int CheckAttrib(const AtomList &args, int offset=0)
Definition: flclass.h:656
static void AddMethod(t_classid c, int inlet, const char *tag, bool(*m)(flext_base *, int, t_atom *))
Definition: flclass.h:498
outlet ** outlets
Definition: flclass.h:934
static void AddMethod(t_classid c, int inlet, const char *tag, bool(*m)(flext_base *, t_symbol *&))
Definition: flclass.h:502
void AddMethod(int inlet, const t_symbol *tag, bool(*m)(flext_base *, const t_symbol *, int, const t_atom *))
Definition: flclass.h:441
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
static void AddMethod(t_classid c, int inlet, const t_symbol *tag, bool(*m)(flext_base *, float &))
Definition: flclass.h:496
void ToSysBool(int n, bool f) const
Definition: flclass.h:868
void AddMethod(int inlet, const t_symbol *tag, bool(*m)(flext_base *, float &))
Definition: flclass.h:444
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, bool(*m)(flext_base *))
Definition: flclass.h:471
static t_class * pxbnd_class
Definition: flclass.h:1081
void AddMethod(int inlet, const char *tag, bool(*m)(flext_base *, int, t_atom *))
Definition: flclass.h:446
AttrDataCont * attrdata
Definition: flclass.h:966
static void AddMethod(t_classid c, int inlet, bool(*m)(flext_base *, t_symbol *, int, t_atom *))
Definition: flclass.h:476
void AddMethod(int inlet, bool(*m)(flext_base *, float &, float &))
Definition: flclass.h:429
void AddMethod(int inlet, const t_symbol *tag, bool(*m)(flext_base *, int &))
Definition: flclass.h:445
bool ListAttrib() const
List attributes.
Definition: flattr.cpp:195
static void AddMethod(t_classid c, int inlet, bool(*m)(flext_base *, int &))
Definition: flclass.h:484
static void AddMethod(t_classid c, int inlet, bool(*m)(flext_base *, int &, int &))
Definition: flclass.h:488
void AddMethod(int inlet, const char *tag, bool(*m)(flext_base *, int &))
Definition: flclass.h:453
static void AddMethod(t_classid c, int inlet, bool(*m)(flext_base *, t_symbol *&))
Definition: flclass.h:478
static void AddMethod(t_classid c, int inlet, const char *tag, bool(*m)(flext_base *, t_symbol *, int, t_atom *))
Definition: flclass.h:500
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
ItemCont * ThAttrs()
Definition: flclass.h:901
static const t_symbol * curtag
current message tag
Definition: flclass.h:930
void AddMethod(int inlet, const t_symbol *tag, bool(*m)(flext_base *))
Definition: flclass.h:422
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 *, int, const t_atom *))
Definition: flclass.h:473
static void AddMethod(t_classid c, int inlet, const char *tag, bool(*m)(flext_base *, float &))
Definition: flclass.h:504
static bool cb_ListAttrib(flext_base *c)
Definition: flclass.h:982
void AddMethod(int inlet, const char *tag, bool(*m)(flext_base *, const t_symbol *&))
Definition: flclass.h:451
unsigned char incnt
number of message and signal inlets/outlets
Definition: flclass.h:932
void AddMethod(int inlet, bool(*m)(flext_base *, const t_symbol *, int, const t_atom *))
Definition: flclass.h:425
void AddMethod(int inlet, bool(*m)(flext_base *, float &, float &, float &))
Definition: flclass.h:430
static flext_base * thisObject(flext_hdr *c)
Definition: flclass.h:910
bool BangAttrib(const char *a)
Definition: flclass.h:672
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 t_symbol *tag, bool(*m)(flext_base *, const t_symbol *&))
Definition: flclass.h:495
void ToSysAnything(int n, const AtomAnything &any) const
Definition: flclass.h:865
@ xlet_ANY
Definition: flclass.h:589
@ xlet_any
Definition: flclass.h:588
void ToSysBang(int n) const
Definition: flclass.h:857
static void AddMethod(t_classid c, int inlet, const t_symbol *tag, bool(*m)(flext_base *))
Definition: flclass.h:474
void AddMethod(int inlet, bool(*m)(flext_base *))
Definition: flclass.h:419
void ToSysDouble(int n, double d) const
Definition: flclass.h:870
static void AddMethod(t_classid c, int inlet, const char *tag, bool(*m)(flext_base *))
Definition: flclass.h:475
void AddMethod(int inlet, const t_symbol *tag, bool(*m)(flext_base *, int, const t_atom *))
Definition: flclass.h:439
void ToSysAnything(int n, const t_symbol *s, int argc, const t_atom *argv) const
Definition: flclass.h:864
static void AddMethod(t_classid c, int inlet, bool(*m)(flext_base *, int &, int &, int &))
Definition: flclass.h:489
static void AddMethod(t_classid c, int inlet, const char *tag, bool(*m)(flext_base *, int, const t_atom *))
Definition: flclass.h:499
static void ToSysMsg(MsgBundle *mb)
void AddMethod(int inlet, const t_symbol *tag, bool(*m)(flext_base *, t_symbol *, int, t_atom *))
Definition: flclass.h:440
ItemCont * ThMeths()
Definition: flclass.h:895
static void AddMethod(t_classid c, int inlet, bool(*m)(flext_base *, float &, float &))
Definition: flclass.h:481
void ToSysFloat(int n, float f) const
Definition: flclass.h:858
void AddMethod(int inlet, const char *tag, bool(*m)(flext_base *, float &))
Definition: flclass.h:452
void AddMethod(int inlet, bool(*m)(flext_base *, t_symbol *&))
Definition: flclass.h:426
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 AddMethod(int inlet, bool(*m)(flext_base *, int &, int &))
Definition: flclass.h:436
void ToSysSymbol(int n, const t_symbol *s) const
Definition: flclass.h:860
void AddMethod(int inlet, bool(*m)(flext_base *, int, t_atom *))
Definition: flclass.h:420
void AddMethod(int inlet, const t_symbol *tag, bool(*m)(flext_base *, t_symbol *&))
Definition: flclass.h:442
static void AddMethod(t_classid c, int inlet, const t_symbol *tag, bool(*m)(flext_base *, t_symbol *&))
Definition: flclass.h:494
void AddMethod(int inlet, bool(*m)(flext_base *, float &))
Definition: flclass.h:428
Internal flext base classes.
Definitions for internal flext usage.
special map class (faster and less memory-consuming than std::map)
#define FLEXT_TEMPINST(fun)
Definition: flprefix.h:464
#define FLEXT_SHARE
Definition: flprefix.h:425
#define FLEXT_CLASSDEF(CL)
Definition: flprefix.h:390
#define FLEXT_TEMPLATE
Definition: flprefix.h:462
#define FLEXT_ASSERT(b)
Definition: flstdc.h:316
t_symbol * t_symptr
Definition: flstdc.h:255
flext support functions and classes
void AddAttrib(const t_symbol *attr, bool(*get)(flext_base *, float &), bool(*set)(flext_base *, float &))
Definition: flclass.h:610
void AddAttrib(const char *attr, bool(*get)(flext_base *, AtomAnything *&), bool(*set)(flext_base *, AtomAnything *&))
Definition: flclass.h:623
void AddAttrib(const t_symbol *attr, bool(*get)(flext_base *, AtomList *&), bool(*set)(flext_base *, AtomList *&))
Definition: flclass.h:615
void AddAttrib(const t_symbol *attr, bool(*get)(flext_base *, AtomAnything *&), bool(*set)(flext_base *, AtomAnything *&))
Definition: flclass.h:616
void AddAttrib(const char *attr, bool(*get)(flext_base *, float &), bool(*set)(flext_base *, float &))
Definition: flclass.h:617
void AddAttrib(const char *attr, bool(*get)(flext_base *, bool &), bool(*set)(flext_base *, bool &))
Definition: flclass.h:619
void AddAttrib(const t_symbol *attr, bool(*get)(flext_base *, t_symptr &), bool(*set)(flext_base *, t_symptr &))
Definition: flclass.h:614
void AddAttrib(const char *attr, bool(*get)(flext_base *, const t_symbol *&), bool(*set)(flext_base *, const t_symbol *&))
Definition: flclass.h:620
void AddAttrib(const t_symbol *attr, bool(*get)(flext_base *, int &), bool(*set)(flext_base *, int &))
Definition: flclass.h:611
void AddAttrib(const t_symbol *attr, bool(*get)(flext_base *, bool &), bool(*set)(flext_base *, bool &))
Definition: flclass.h:612
void AddAttrib(const char *attr, bool(*get)(flext_base *, int &), bool(*set)(flext_base *, int &))
Definition: flclass.h:618
void AddAttrib(const char *attr, bool(*get)(flext_base *, AtomList *&), bool(*set)(flext_base *, AtomList *&))
Definition: flclass.h:622
void AddAttrib(const char *attr, bool(*get)(flext_base *, t_symptr &), bool(*set)(flext_base *, t_symptr &))
Definition: flclass.h:621
void AddAttrib(const t_symbol *attr, bool(*get)(flext_base *, const t_symbol *&), bool(*set)(flext_base *, const t_symbol *&))
Definition: flclass.h:613
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
bool Bind(const char *sym)
Bind object to a symbol (as string)
Definition: flclass.h:525
bool Unbind(const char *sym)
Unbind object from a symbol (as string)
Definition: flclass.h:527
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
bool GetBoundMethod(const t_symbol *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.
bool BindMethod(const t_symbol *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.
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
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)
Unbind a method from a symbol.
static void AddAttrib(t_classid c, const char *attr, bool(*get)(flext_base *, int &), bool(*set)(flext_base *, int &))
Definition: flclass.h:639
static void AddAttrib(t_classid c, const char *attr, bool(*get)(flext_base *, AtomAnything *&), bool(*set)(flext_base *, AtomAnything *&))
Definition: flclass.h:644
static void AddAttrib(t_classid c, const char *attr, bool(*get)(flext_base *, float &), bool(*set)(flext_base *, float &))
Definition: flclass.h:638
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 t_symbol *attr, bool(*get)(flext_base *, bool &), bool(*set)(flext_base *, bool &))
Definition: flclass.h:633
static void AddAttrib(t_classid c, const char *attr, bool(*get)(flext_base *, AtomList *&), bool(*set)(flext_base *, AtomList *&))
Definition: flclass.h:643
static void AddAttrib(t_classid c, const t_symbol *attr, bool(*get)(flext_base *, AtomAnything *&), bool(*set)(flext_base *, AtomAnything *&))
Definition: flclass.h:637
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
static void AddAttrib(t_classid c, const t_symbol *attr, bool(*get)(flext_base *, AtomList *&), bool(*set)(flext_base *, AtomList *&))
Definition: flclass.h:636
static void AddAttrib(t_classid c, const char *attr, bool(*get)(flext_base *, bool &), bool(*set)(flext_base *, bool &))
Definition: flclass.h:640
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
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 *, const t_symbol *&), bool(*set)(flext_base *, const t_symbol *&))
Definition: flclass.h:641
static void AddAttrib(t_classid c, const t_symbol *attr, bool(*get)(flext_base *, int &), bool(*set)(flext_base *, int &))
Definition: flclass.h:632
void MsgSelfString(MsgBundle *mb, int n, const char *s) const
Send string aka symbol to self (inlet 0)
Definition: flclass.h:379
void MsgSelfList(MsgBundle *mb, int n, int argc, const t_atom *argv) const
Send list to self (inlet n)
Definition: flclass.h:385
void MsgSelfInt(MsgBundle *mb, int n, int f) const
Send integer to self (inlet n)
Definition: flclass.h:368
void MsgAddBool(MsgBundle *mb, int n, bool f) const
Output boolean (index n starts with 0)
Definition: flclass.h:338
void MsgSelfAnything(MsgBundle *mb, int n, const AtomAnything &any) const
Send anything to self (inlet n)
Definition: flclass.h:392
void MsgSelfList(MsgBundle *mb, int n, const AtomList &list) const
Send list to self (inlet n)
Definition: flclass.h:387
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
void MsgSelfDouble(MsgBundle *mb, int n, double d) const
Output double (index n starts with 0)
Definition: flclass.h:374
void MsgAddString(MsgBundle *mb, int n, const char *s) const
Output string aka symbol (to appointed outlet)
Definition: flclass.h:346
void MsgAddDouble(MsgBundle *mb, int n, double d) const
Output double (index n starts with 0)
Definition: flclass.h:341
void MsgSelfFloat(MsgBundle *mb, int n, float f) const
Send float to self (inlet n)
Definition: flclass.h:365
void MsgSelfSymbol(MsgBundle *mb, int n, const t_symbol *s) const
Send symbol to self (inlet n)
Definition: flclass.h:377
void MsgAddAnything(MsgBundle *mb, int n, const AtomAnything &any) const
Output anything (index n starts with 0)
Definition: flclass.h:360
void MsgSelfAtom(MsgBundle *mb, int n, const t_atom &at) const
Output atom (index n starts with 0)
Definition: flclass.h:382
void MsgSelfBang(MsgBundle *mb, int n) const
Definition: flclass.h:362
void MsgSelfBool(MsgBundle *mb, int n, bool f) const
Send boolean to self (inlet n)
Definition: flclass.h:371
void MsgAddList(MsgBundle *mb, int n, const AtomList &list) const
Output list (index n starts with 0)
Definition: flclass.h:355
void AddInFloat(int m=1)
Add inlet(s) for floats.
Definition: flclass.h:122
void AddOutList(const char *desc, int m=1)
Add outlet(s) for lists (with description)
Definition: flclass.h:165
void AddInSymbol(int m=1)
Add inlet(s) for symbols.
Definition: flclass.h:130
bool SetupInOut()
Definition: flclass.h:168
void AddOutAnything(const char *desc, int m=1)
Add outlet(s) for anythings (with description)
Definition: flclass.h:145
void AddOutSymbol(const char *desc, int m=1)
Add outlet(s) for symbols (with description)
Definition: flclass.h:157
void AddInBang(const char *desc, int m=1)
Add inlet(s) for bangs (with description)
Definition: flclass.h:136
void AddOutInt(int m=1)
Add outlet(s) for integers.
Definition: flclass.h:151
void AddInAnything(const char *desc, int m=1)
Add inlet(s) for anythings (with description)
Definition: flclass.h:120
void AddInInt(int m=1)
Add inlet(s) for integers.
Definition: flclass.h:126
void AddInSymbol(const char *desc, int m=1)
Add inlet(s) for symbol (with description)
Definition: flclass.h:132
void AddOutSymbol(int m=1)
Add outlet(s) for symbols.
Definition: flclass.h:155
void AddInList(int m=1)
Add inlet(s) for lists.
Definition: flclass.h:138
void AddOutAnything(int m=1)
Add outlet(s) for anythings.
Definition: flclass.h:143
void AddOutInt(const char *desc, int m=1)
Add outlet(s) for integers (with description)
Definition: flclass.h:153
void AddInBang(int m=1)
Add inlet(s) for bang.
Definition: flclass.h:134
void AddOutFloat(const char *desc, int m=1)
Add outlet(s) for floats (with description)
Definition: flclass.h:149
void AddInFloat(const char *desc, int m=1)
Add inlet(s) for floats (with description)
Definition: flclass.h:124
void AddOutFloat(int m=1)
Add outlet(s) for floats.
Definition: flclass.h:147
void AddInList(const char *desc, int m=1)
Add inlet(s) for lists (with description)
Definition: flclass.h:140
void AddOutBang(const char *desc, int m=1)
Add outlet(s) for bangs (with description)
Definition: flclass.h:161
void AddInInt(const char *desc, int m=1)
Add inlet(s) for integers (with description)
Definition: flclass.h:128
void AddOutList(int m=1)
Add outlet(s) for lists.
Definition: flclass.h:163
void AddOutBang(int m=1)
Add outlet(s) for bangs.
Definition: flclass.h:159
int GetOutAttr() const
Definition: flclass.h:194
int CntIn() const
Get number of inlets.
Definition: flclass.h:177
static const t_symbol * thisTag()
Retrieve currently processed message tag (NULL if no message processing)
Definition: flclass.h:187
int CntInSig() const
Get number of signal inlets.
Definition: flclass.h:181
int CntOut() const
Get number of outlets.
Definition: flclass.h:179
outlet * GetOut(int ix) const
Get pointer to outlet (not in the constructor!)
Definition: flclass.h:192
int CntOutSig() const
Get number of signal outlets.
Definition: flclass.h:183
void ToOutAnything(int n, const t_symbol *s, const AtomList &list) const
Output anything (index n starts with 0)
Definition: flclass.h:237
void ToOutAnything(int n, const AtomAnything &any) const
Output anything (index n starts with 0)
Definition: flclass.h:235
void ToOutString(int n, const char *s) const
Output string aka symbol (index n starts with 0)
Definition: flclass.h:222
void ToOutBool(int n, bool f) const
Output boolean (index n starts with 0)
Definition: flclass.h:214
void ToOutList(int n, const AtomList &list) const
Output list (index n starts with 0)
Definition: flclass.h:230
void ToOutDouble(int n, double d) const
Output double (index n starts with 0)
Definition: flclass.h:217
void ToQueueDouble(int n, double d) const
Output double (index n starts with 0)
Definition: flclass.h:258
void ToQueueBool(int n, bool f) const
Output low priority boolean (index n starts with 0)
Definition: flclass.h:255
void ToQueueList(int n, const AtomList &list) const
Output low priority list (index n starts with 0)
Definition: flclass.h:271
void ToQueueAnything(int n, const AtomAnything &any) const
Output low priority anything (index n starts with 0)
Definition: flclass.h:276
void ToQueueString(int n, const char *s) const
Output low priority string aka symbol (to appointed outlet)
Definition: flclass.h:263
void ToSelfList(int n, const AtomList &list) const
Send list to self (inlet n)
Definition: flclass.h:311
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 ToSelfAnything(int n, const AtomAnything &any) const
Send anything to self (inlet n)
Definition: flclass.h:316
void ToSelfFloat(int n, float f) const
Send float to self (inlet n)
Definition: flclass.h:289
void ToSelfString(int n, const char *s) const
Send string aka symbol to self (inlet 0)
Definition: flclass.h:303
void ToSelfBang(int n) const
Send bang to self (inlet n)
Definition: flclass.h:286
void ToSelfAtom(int n, const t_atom &at) const
Output atom (index n starts with 0)
Definition: flclass.h:306
void ToSelfBool(int n, bool f) const
Send boolean to self (inlet n)
Definition: flclass.h:295
void ToSelfInt(int n, int f) const
Send integer to self (inlet n)
Definition: flclass.h:292
void ToSelfSymbol(int n, const t_symbol *s) const
Send symbol to self (inlet n)
Definition: flclass.h:301
void ToSelfList(int n, int argc, const t_atom *argv) const
Send list to self (inlet n)
Definition: flclass.h:309
void ToSelfDouble(int n, double d) const
Send double to self (index n starts with 0)
Definition: flclass.h:298
bool StartThread(void(*meth)(thr_params *p), thr_params *p, const char *=NULL)
Start a thread for this object.
Definition: flclass.h:574
#define FLEXT_HEADER_S(NEW_CLASS, PARENT_CLASS, SETUPFUN)
Flext class header with setup function.
Definition: fldefs_hdr.h:47
Definition: flclass.h:1026
int index
Definition: flclass.h:1029
flext_base * base
Definition: flclass.h:1028
t_object obj
Definition: flclass.h:1027
void init(flext_base *b, int ix)
Definition: flclass.h:1031
The obligatory PD or Max/MSP object header.
Definition: flbase.h:39
Definition: flclass.h:936
int it
Definition: flclass.h:938
const t_symbol * st
Definition: flclass.h:940
void * vt
Definition: flclass.h:944
bool bt
Definition: flclass.h:939
t_gpointer * pt
Definition: flclass.h:942
float ft
Definition: flclass.h:937