Commit 4c1c21c1 authored by thomas's avatar thomas
Browse files

no message


git-svn-id: https://svn.grrrr.org/ext/trunk@299 4d9ac71a-51e6-0310-8455-cad1006bcd31
parent b1e9565e
......@@ -78,6 +78,11 @@ see flext.h, fldefs.h and flclass.h for the documented base definitions and clas
Version history:
0.3.4:
- SndObj interface now also available for cygwin and BCC
- added Makefiles for OSX/darwin (originally done by Adam T. Lindsay)
- added prepend and append functions to AtomList class
0.3.3:
- PD: fixed bug for DSP objects having no signal inlets
- revisited priority stuff for detached threads
......
......@@ -37,7 +37,9 @@ flext_base::AtomList &flext_base::AtomList::operator()(int argc,const t_atom *ar
lst = new t_atom[cnt];
if(argv) {
for(int i = 0; i < argc; ++i) {
for(int i = 0; i < argc; ++i) SetAtom(lst[i],argv[i]);
/*
{
switch(lst[i].a_type = argv[i].a_type) {
case A_FLOAT:
lst[i].a_w.w_float = argv[i].a_w.w_float;
......@@ -61,10 +63,64 @@ flext_base::AtomList &flext_base::AtomList::operator()(int argc,const t_atom *ar
break;
}
}
*/
}
}
return *this;
}
flext_base::AtomList &flext_base::AtomList::Append(const t_atom &a)
{
t_atom *nlst = new t_atom[cnt+1];
for(int i = 0; i < cnt; ++i) SetAtom(nlst[i],lst[i]);
SetAtom(nlst[cnt],a);
lst = nlst;
++cnt;
delete[] lst;
return *this;
}
flext_base::AtomList &flext_base::AtomList::Append(const AtomList &a)
{
t_atom *nlst = new t_atom[cnt+a.Count()];
int i;
for(i = 0; i < cnt; ++i) SetAtom(nlst[i],lst[i]);
for(i = 0; i < a.Count(); ++i) SetAtom(nlst[cnt+i],a.Atoms()[i]);
lst = nlst;
cnt += a.Count();
delete[] lst;
return *this;
}
flext_base::AtomList &flext_base::AtomList::Prepend(const t_atom &a)
{
t_atom *nlst = new t_atom[cnt+1];
for(int i = 0; i < cnt; ++i) SetAtom(nlst[i+1],lst[i]);
SetAtom(nlst[0],a);
lst = nlst;
++cnt;
delete[] lst;
return *this;
}
flext_base::AtomList &flext_base::AtomList::Prepend(const AtomList &a)
{
t_atom *nlst = new t_atom[cnt+a.Count()];
int i;
for(i = 0; i < a.Count(); ++i) SetAtom(nlst[i],a.Atoms()[i]);
for(i = 0; i < cnt; ++i) SetAtom(nlst[a.Count()+i],lst[i]);
lst = nlst;
cnt += a.Count();
delete[] lst;
return *this;
}
......@@ -626,7 +626,16 @@ public:
t_atom *Atoms() { return lst; }
//! Get a pointer to the list of atoms
const t_atom *Atoms() const { return lst; }
//! Append an atom to the list
AtomList &Append(const t_atom &a);
//! Append an atom list to the list
AtomList &Append(const AtomList &a);
//! Prepend an atom to the list
AtomList &Prepend(const t_atom &a);
//! Prepend an atom list to the list
AtomList &Prepend(const AtomList &a);
protected:
int cnt;
t_atom *lst;
......@@ -688,6 +697,7 @@ public:
//! Copy an atom
static void CopyAtom(t_atom *dst,const t_atom *src) { *dst = *src; }
//! Copy a list of atoms
static t_atom *CopyList(int argc,const t_atom *argv);
//! Copy a memory region
......
......@@ -23,10 +23,10 @@ WARRANTIES, see the file, "license.txt," in this distribution.
*/
//! \brief flext version number
#define FLEXT_VERSION 303
#define FLEXT_VERSION 304
//! \brief flext version string
#define FLEXT_VERSTR "0.3.3"
#define FLEXT_VERSTR "0.3.4pre"
//! @}
......
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