Commit 58deb167 authored by thomas's avatar thomas
Browse files

no message


git-svn-id: https://svn.grrrr.org/ext/trunk@365 4d9ac71a-51e6-0310-8455-cad1006bcd31
parent 68f33eab
......@@ -29,7 +29,7 @@ flext::AtomList::AtomList(const AtomList &a):
flext::AtomList::~AtomList() { Clear(); }
flext::AtomList &flext::AtomList::Set(int argc,const t_atom *argv)
flext::AtomList &flext::AtomList::Set(int argc,const t_atom *argv,int offs)
{
if(lst && cnt != argc) { delete[] lst; lst = NULL; cnt = 0; }
......@@ -38,7 +38,7 @@ flext::AtomList &flext::AtomList::Set(int argc,const t_atom *argv)
lst = new t_atom[cnt];
if(argv) {
for(int i = 0; i < argc; ++i) SetAtom(lst[i],argv[i]);
for(int i = 0; i < argc; ++i) SetAtom(lst[offs+i],argv[i]);
}
}
return *this;
......
......@@ -118,6 +118,13 @@ bool flext_base::SetAttrib(const t_symbol *tag,int argc,const t_atom *argv)
}
else ok = false;
break;
case a_bool:
if(argc == 1 && CanbeBool(argv[0])) {
any.bt = GetABool(argv[0]);
((methfun_1)a->sfun)(this,any);
}
else ok = false;
break;
case a_symbol:
if(argc == 1 && IsSymbol(argv[0])) {
any.st = GetSymbol(argv[0]);
......@@ -169,6 +176,12 @@ bool flext_base::GetAttrib(const t_symbol *tag,int argc,const t_atom *argv)
SetInt(la[0],any.it);
break;
}
case a_bool: {
((methfun_1)a->gfun)(this,any);
la(1);
SetInt(la[0],any.bt);
break;
}
case a_symbol: {
((methfun_1)a->gfun)(this,any);
la(1);
......
......@@ -301,7 +301,7 @@ public:
enum metharg {
a_null = 0,
a_float,a_int,
a_float,a_int,a_bool,
a_symbol,a_pointer,
a_list,a_any,
a_LIST,a_ANY
......@@ -509,7 +509,7 @@ protected:
struct xlet {
enum type {
tp_none = 0,
tp_float,tp_int,tp_sym,tp_list,tp_any,
tp_float,tp_int,tp_bool,tp_sym,tp_list,tp_any,
tp_LIST,tp_ANY, // use AtomList and AtomAnything
tp_sig
};
......@@ -528,7 +528,7 @@ protected:
void AddAttrib(const char *attr,bool (*get)(flext_base *,float &),bool (*set)(flext_base *,float &)) { AddAttrib(attr,a_float,(methfun)get,(methfun)set); }
void AddAttrib(const char *attr,bool (*get)(flext_base *,int &),bool (*set)(flext_base *,int &)) { AddAttrib(attr,a_int,(methfun)get,(methfun)set); }
void AddAttrib(const char *attr,bool (*get)(flext_base *,bool &),bool (*set)(flext_base *,bool &)) { AddAttrib(attr,a_int,(methfun)get,(methfun)set); }
void AddAttrib(const char *attr,bool (*get)(flext_base *,bool &),bool (*set)(flext_base *,bool &)) { AddAttrib(attr,a_bool,(methfun)get,(methfun)set); }
void AddAttrib(const char *attr,bool (*get)(flext_base *,const t_symbol *&),bool (*set)(flext_base *,const t_symbol *&)) { AddAttrib(attr,a_symbol,(methfun)get,(methfun)set); }
void AddAttrib(const char *attr,bool (*get)(flext_base *,t_symbol *&),bool (*set)(flext_base *,t_symbol *&)) { AddAttrib(attr,a_symbol,(methfun)get,(methfun)set); }
void AddAttrib(const char *attr,bool (*get)(flext_base *,AtomList *&),bool (*set)(flext_base *,AtomList *&)) { AddAttrib(attr,a_LIST,(methfun)get,(methfun)set); }
......@@ -617,6 +617,7 @@ private:
union t_any {
float ft;
int it;
bool bt;
t_symbol *st;
#ifdef PD
t_gpointer *pt;
......
......@@ -280,7 +280,7 @@ public:
AtomList &Clear() { return operator()(); }
//! Set list
AtomList &Set(int argc,const t_atom *argv);
AtomList &Set(int argc,const t_atom *argv,int offs = 0);
//! Get list
int Get(t_atom *argv,int mxsz = -1) const;
......
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