aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/flext/source/flattr_ed.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'externals/grill/flext/source/flattr_ed.cpp')
-rw-r--r--externals/grill/flext/source/flattr_ed.cpp59
1 files changed, 43 insertions, 16 deletions
diff --git a/externals/grill/flext/source/flattr_ed.cpp b/externals/grill/flext/source/flattr_ed.cpp
index 16a418a3..d8883005 100644
--- a/externals/grill/flext/source/flattr_ed.cpp
+++ b/externals/grill/flext/source/flattr_ed.cpp
@@ -494,7 +494,7 @@ void flext_base::cb_GfxProperties(t_gobj *c, t_glist *)
PrintList(argc,argv,buf,sizeof(buf));
sys_vgui("%s } {\n",buf);
- AtomList la;
+ AtomListStatic<32> la;
th->ListAttrib(la);
int cnt = la.Count();
@@ -509,18 +509,20 @@ void flext_base::cb_GfxProperties(t_gobj *c, t_glist *)
// get flags
int sv;
const AtomList *initdata;
- AttrDataCont::iterator it = th->attrdata->find(sym);
- if(it == th->attrdata->end())
+ const AttrData *a = th->attrdata->find(sym);
+// AttrDataCont::iterator it = th->attrdata->find(sym);
+// if(it == th->attrdata->end())
+ if(!a)
sv = 0,initdata = NULL;
else {
- const AttrData &a = *it.data();
- if(a.IsSaved())
+// const AttrData &a = *it.data();
+ if(a->IsSaved())
sv = 2;
- else if(a.IsInit())
+ else if(a->IsInit())
sv = 1;
else
sv = 0;
- initdata = a.IsInitValue()?&a.GetInitValue():NULL;
+ initdata = a->IsInitValue()?&a->GetInitValue():NULL;
}
// get attribute type
@@ -540,7 +542,7 @@ void flext_base::cb_GfxProperties(t_gobj *c, t_glist *)
sys_vgui(const_cast<char *>(list?"%s {":"%s "),GetString(sym));
- AtomList lv;
+ AtomListStatic<32> lv;
if(gattr) { // gettable attribute is present
// Retrieve attribute value
th->GetAttrib(sym,gattr,lv);
@@ -561,7 +563,7 @@ void flext_base::cb_GfxProperties(t_gobj *c, t_glist *)
if(pattr) {
// if there is initialization data take this, otherwise take the current data
- const AtomList &lp = initdata?*initdata:lv;
+ const AtomList &lp = initdata?*initdata:static_cast<const AtomList &>(lv);
char *b = buf; *b = 0;
for(int i = 0; i < lp.Count(); ++i) {
@@ -702,10 +704,13 @@ bool flext_base::cb_AttrDialog(flext_base *th,int argc,const t_atom *argv)
bool ret = th->SetAttrib(aname,attr,ccnt,argv+coffs);
FLEXT_ASSERT(ret);
- AttrDataCont::iterator it = th->attrdata->find(aname);
+// AttrDataCont::iterator it = th->attrdata->find(aname);
+ AttrData *a = th->attrdata->find(aname);
if(sv >= 1) {
// if data not present create it
+
+/*
if(it == th->attrdata->end()) {
AttrDataCont::pair pair;
pair.key() = aname;
@@ -717,8 +722,16 @@ bool flext_base::cb_AttrDialog(flext_base *th,int argc,const t_atom *argv)
a.SetSave(sv == 2);
a.SetInit(true);
a.SetInitValue(icnt,argv+ioffs);
+*/
+ if(!a)
+ th->attrdata->insert(aname,a = new AttrData);
+
+ a->SetSave(sv == 2);
+ a->SetInit(true);
+ a->SetInitValue(icnt,argv+ioffs);
}
else {
+/*
if(it != th->attrdata->end()) {
AttrData &a = *it.data();
// if data is present reset flags
@@ -727,6 +740,14 @@ bool flext_base::cb_AttrDialog(flext_base *th,int argc,const t_atom *argv)
// let init data as is
}
+*/
+ if(a) {
+ // if data is present reset flags
+ a->SetSave(false);
+ a->SetInit(false);
+
+ // let init data as is
+ }
}
}
else {
@@ -765,21 +786,26 @@ void flext_base::BinbufArgs(t_binbuf *b,t_binbuf *args,bool withname,bool transd
void flext_base::BinbufAttr(t_binbuf *b,bool transdoll)
{
// process the attributes
- AtomList la;
+ AtomListStatic<32> la,lv;
ListAttrib(la);
int i,cnt = la.Count();
for(i = 0; i < cnt; ++i) {
const t_symbol *sym = GetSymbol(la[i]);
- AtomList lv;
const AtomList *lref = NULL;
+/*
AttrDataCont::iterator it = attrdata->find(sym);
-
if(it != attrdata->end()) {
const AttrData &a = *it.data();
if(a.IsInit() && a.IsInitValue()) {
lref = &a.GetInitValue();
-/*
+*/
+ AttrData *a = attrdata->find(sym);
+ if(a) {
+ if(a->IsInit() && a->IsInitValue()) {
+ lref = &a->GetInitValue();
+
+#if 0 /////////////////////////////////////////////////////////////
// check for $-parameters
lv = lref->Count();
for(int j = 0; j < lref->Count(); ++j) {
@@ -795,9 +821,10 @@ void flext_base::BinbufAttr(t_binbuf *b,bool transdoll)
}
lref = &lv;
-*/
+#endif /////////////////////////////////////////////////////////////
}
- else if(a.IsSaved()) {
+// else if(a.IsSaved()) {
+ else if(a->IsSaved()) {
AttrItem *attr = FindAttrib(sym,true);
// attribute must be gettable (so that the data can be retrieved) and puttable (so that the data can be inited)