From 562dcc336797951b2a8707413aa44177484c9f2a Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Sat, 28 Dec 2002 04:37:42 +0000 Subject: "" svn path=/trunk/; revision=309 --- externals/grill/flext/source/flatom_part.cpp | 37 ++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 externals/grill/flext/source/flatom_part.cpp (limited to 'externals/grill/flext/source/flatom_part.cpp') diff --git a/externals/grill/flext/source/flatom_part.cpp b/externals/grill/flext/source/flatom_part.cpp new file mode 100755 index 00000000..b736666a --- /dev/null +++ b/externals/grill/flext/source/flatom_part.cpp @@ -0,0 +1,37 @@ +/* + +flext - C++ layer for Max/MSP and pd (pure data) externals + +Copyright (c) 2001,2002 Thomas Grill (xovo@gmx.net) +For information on usage and redistribution, and for a DISCLAIMER OF ALL +WARRANTIES, see the file, "license.txt," in this distribution. + +*/ + +/*! \file flatom_part.cpp + \brief Definitions for handling the t_atom type and lists thereof. +*/ + +#include "flext.h" + +int flext::AtomList::Get(t_atom *argv,int mxsz) const +{ + int argc = Count(); + if(mxsz >= 0 && argc > mxsz) argc = mxsz; + + for(int i = 0; i < argc; ++i) SetAtom(argv[i],lst[i]); + + return argc; +} + + +flext::AtomList flext::AtomList::GetPart(int offs,int len) const +{ + if(offs+len > Count()) { + len = Count()-offs; + if(len < 0) len = 0; + } + + return AtomList(len,Atoms()+offs); +} + -- cgit v1.2.1