Commit 59ed832d authored by thomas's avatar thomas
Browse files

no message


git-svn-id: https://svn.grrrr.org/ext/trunk@78 4d9ac71a-51e6-0310-8455-cad1006bcd31
parent 9fb60aad
......@@ -66,8 +66,9 @@ Version history:
- uses PD's or Max's memory allocation functions (for safety in Max's overdrive)
- added outlets for anythings
- better graphics update behavior for PD
- changed "enable" message for DSP objects to "dspon" (enable is reserved in Max/MSP)
- changed "enable" message for DSP objects to "dspon" ("enable" is reserved in Max/MSP)
- proxy objects for any non-leftmost inlets
- improved behavior for invalid/undefined buffers/arrays
0.1.1:
- documentation for flext.h
......@@ -118,7 +119,7 @@ general:
- where to put flext source/lib in linux: /usr/local/lib,/usr/local/include ?
bugs:
none known
no unfixed known
tests:
- test loadbang upon object creation in Max/MSP
......
......@@ -467,7 +467,7 @@ FLEXT_EXT void FLEXT_MAIN(NEW_CLASS ## SETUP_FUNCTION)() \
#if defined(MAXMSP)
// determine if it is the default inlet
#define ISDEFIN(o) (((flext_hdr *)o->x_obj)->curinlet) != 0)
#define ISDEFIN(o) ((((flext_hdr *)o->x_obj)->curinlet) != 0)
#else
#define ISDEFIN(o) true
#endif
......
......@@ -38,6 +38,7 @@ flext_base::buffer::~buffer()
I flext_base::buffer::Set(t_symbol *s,BL nameonly)
{
I ret = 0;
BL valid = data != NULL; // valid now? (before change)
if(s && sym != s) {
ret = -1;
......@@ -48,7 +49,10 @@ I flext_base::buffer::Set(t_symbol *s,BL nameonly)
if(s && *s->s_name) sym = s;
if(sym && !nameonly) {
if(!sym) {
if(valid) ret = -1;
}
else if(!nameonly) {
#ifdef PD
I frames1;
F *data1;
......@@ -56,17 +60,16 @@ I flext_base::buffer::Set(t_symbol *s,BL nameonly)
t_garray *a = (t_garray *)pd_findbyclass(sym, garray_class);
if(!a)
{
if (*sym->s_name)
error("buffer: no such array '%s'",sym->s_name);
if (*sym->s_name) error("buffer: no such array '%s'",sym->s_name);
sym = NULL;
ret = -1;
if(valid) ret = -1;
}
else if (!garray_getfloatarray(a, &frames1, &data1))
{
error("buffer: bad template '%s'", sym->s_name);
error("buffer: bad template '%s'", sym->s_name);
data = NULL;
frames = 0;
ret = -1;
if(valid) ret = -1;
}
else {
garray_usedindsp(a);
......@@ -79,8 +82,8 @@ I flext_base::buffer::Set(t_symbol *s,BL nameonly)
const _buffer *p = (const _buffer *)sym->s_thing;
if(NOGOOD(p)) {
post("buffer: buffer object '%s' no good",sym->s_name);
ret = -1;
post("buffer: buffer object '%s' no good",sym->s_name);
if(valid) ret = -1;
}
else {
#ifdef DEBUG
......@@ -92,12 +95,11 @@ I flext_base::buffer::Set(t_symbol *s,BL nameonly)
}
}
else {
error("buffer: symbol '%s' not defined", sym->s_name);
ret = -1;
error("buffer: symbol '%s' not defined", sym->s_name);
if(valid) ret = -1;
}
#endif
}
else ret = -1;
return ret;
}
......
No preview for this file type
......@@ -23,23 +23,23 @@ struct flext_base::px_object // no virtual table!
I index;
V init(flext_base *b,I ix) { base = b; index = ix; }
static V px_method(px_object *c,t_symbol *s,I argc,t_atom *argv);
static V px_method(px_object *c,const t_symbol *s,I argc,t_atom *argv);
};
V flext_base::px_object::px_method(px_object *obj,t_symbol *s,I argc,t_atom *argv)
V flext_base::px_object::px_method(px_object *obj,const t_symbol *s,I argc,t_atom *argv)
{
obj->base->m_methodmain(obj->index,s,argc,argv);
}
V flext_base::cb_px_anything(V *c,t_symbol *s,I argc,t_atom *argv)
V flext_base::cb_px_anything(V *c,const t_symbol *s,I argc,t_atom *argv)
{
thisObject(c)->m_methodmain(0,s,argc,argv);
}
#elif defined(MAXMSP)
V flext_base::cb_px_anything(V *c,t_symbol *s,I argc,t_atom *argv)
V flext_base::cb_px_anything(V *c,const t_symbol *s,I argc,t_atom *argv)
{
// check if inlet allows anything (or list)
flext_base *o = thisObject(c);
......@@ -49,7 +49,7 @@ V flext_base::cb_px_anything(V *c,t_symbol *s,I argc,t_atom *argv)
V flext_base::cb_px_int(V *c,I v)
{
static const t_symbol = *sym_int = gensym("int");
static const t_symbol *sym_int = gensym("int");
// check if inlet allows int type
t_atom atom;
......@@ -59,7 +59,7 @@ V flext_base::cb_px_int(V *c,I v)
V flext_base::cb_px_float(V *c,F v)
{
static const t_symbol = *sym_float = gensym("float");
static const t_symbol *sym_float = gensym("float");
// check if inlet allows float type
t_atom atom;
......@@ -69,7 +69,7 @@ V flext_base::cb_px_float(V *c,F v)
V flext_base::cb_px_bang(V *c)
{
static const t_symbol = *sym_bang = gensym("bang");
static const t_symbol *sym_bang = gensym("bang");
// check if inlet allows bang
cb_px_anything(c,sym_bang,0,NULL);
......@@ -361,7 +361,7 @@ V flext_base::m_help()
post("%s (using flext) - compiled on %s %s",thisName(),__DATE__,__TIME__);
}
V flext_base::m_methodmain(I inlet,t_symbol *s,I argc,t_atom *argv)
V flext_base::m_methodmain(I inlet,const t_symbol *s,I argc,t_atom *argv)
{
......
......@@ -199,7 +199,7 @@ protected:
#endif
virtual V m_methodmain(I inlet,t_symbol *s,I argc,t_atom *argv);
virtual V m_methodmain(I inlet,const t_symbol *s,I argc,t_atom *argv);
private:
......@@ -213,10 +213,10 @@ private:
// proxy object (for additional inlets) stuff
struct px_object;
friend struct px_object;
static V cb_px_anything(V *c,t_symbol *s,I argc,t_atom *argv);
static V cb_px_anything(V *c,const t_symbol *s,I argc,t_atom *argv);
#elif defined(MAXMSP)
typedef object px_object;
static V cb_px_anything(V *c,t_symbol *s,I argc,t_atom *argv);
static V cb_px_anything(V *c,const t_symbol *s,I argc,t_atom *argv);
static V cb_px_int(V *c,I v);
static V cb_px_float(V *c,F f);
static V cb_px_bang(V *c);
......
......@@ -110,7 +110,7 @@ typedef _outlet t_outlet;
#define atom_getflintarg atom_getintarg
#define atom_getsymbolarg atom_getsymarg
#define SETFLINT(atom,value) SETINT(atom,(int)(value))
#define ISINT(atom) ((atom)->a_type == A_INT)
#define ISINT(atom) ((atom).a_type == A_INT)
#define ISFLINT(atom) ISINT(atom)
#define add_dsp(clss,meth) addmess((method)meth,"dsp",A_CANT,A_NOTHING)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment