aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/flext/source/flout.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'externals/grill/flext/source/flout.cpp')
-rw-r--r--externals/grill/flext/source/flout.cpp38
1 files changed, 17 insertions, 21 deletions
diff --git a/externals/grill/flext/source/flout.cpp b/externals/grill/flext/source/flout.cpp
index 67ab40c0..3933d5f1 100644
--- a/externals/grill/flext/source/flout.cpp
+++ b/externals/grill/flext/source/flout.cpp
@@ -2,7 +2,7 @@
flext - C++ layer for Max/MSP and pd (pure data) externals
-Copyright (c) 2001-2005 Thomas Grill (gr@grrrr.org)
+Copyright (c) 2001-2006 Thomas Grill (gr@grrrr.org)
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.
@@ -119,23 +119,17 @@ bool flext_base::InitInlets()
switch(xi.tp) {
case xlet_float:
case xlet_int: {
- inlets[ix-1] = NULL;
- char sym[] = "ft??";
- if(ix >= 10) {
- if(compatibility) {
- // Max allows max. 9 inlets
- post("%s: Only 9 float/int inlets allowed in compatibility mode",thisName());
- ok = false;
- }
- else {
- if(ix > 99)
- post("%s: Inlet index > 99 not allowed for float/int inlets",thisName());
- sym[2] = '0'+ix/10,sym[3] = '0'+ix%10;
- }
+ if(ix > 9) {
+ // proxy inlet needed
+ (inlets[ix-1] = (px_object *)pd_new(px_class))->init(this,ix); // proxy for 2nd inlet messages
+ in = inlet_new(&x_obj->obj,&inlets[ix-1]->obj.ob_pd, (t_symbol *)sym_float, (t_symbol *)sym_float);
+ }
+ else {
+ inlets[ix-1] = NULL;
+ static char sym[] = " ft ?";
+ sym[4] = '0'+ix;
+ in = inlet_new(&x_obj->obj, &x_obj->obj.ob_pd, (t_symbol *)sym_float, gensym(sym));
}
- else
- sym[2] = '0'+ix,sym[3] = 0;
- if(ok) in = inlet_new(&x_obj->obj, &x_obj->obj.ob_pd, (t_symbol *)sym_float, gensym(sym));
break;
}
case xlet_sym:
@@ -152,13 +146,15 @@ bool flext_base::InitInlets()
break;
case xlet_sig:
inlets[ix-1] = NULL;
- if(compatibility && inlist[ix-1].tp != xlet_sig) {
+#ifdef FLEXT_COMPATIBLE
+ if(inlist[ix-1].tp != xlet_sig) {
post("%s: All signal inlets must be left-aligned in compatibility mode",thisName());
ok = false;
}
- else {
- // pd doesn't seem to be able to handle signals and messages into the same inlet...
-
+ else
+#endif
+ {
+ // pd is not able to handle signals and messages into the same inlet...
in = inlet_new(&x_obj->obj, &x_obj->obj.ob_pd, (t_symbol *)sym_signal, (t_symbol *)sym_signal);
++insigs;
}