File: flatom_part.cpp

package info (click to toggle)
pd-flext 0.6.0%2Bgit20161101.1.01318a94-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 6,212 kB
  • ctags: 1,846
  • sloc: cpp: 13,015; makefile: 735; sh: 85
file content (44 lines) | stat: -rw-r--r-- 972 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
flext - C++ layer for Max and Pure Data externals

Copyright (c) 2001-2015 Thomas Grill (gr@grrrr.org)
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.
*/
 
#ifndef __FLEXT_ATOM_PART_CPP
#define __FLEXT_ATOM_PART_CPP

#include "flext.h"

#include "flpushns.h"

FLEXT_TEMPIMPL(int FLEXT_CLASSDEF(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_TEMPIMPL(void FLEXT_CLASSDEF(flext))::AtomList::GetPart(int offs,int len,AtomList &ret) const
{
    if(offs+len > Count()) {
        len = Count()-offs;
        if(len < 0) len = 0;
    }

    ret(len,Atoms()+offs);
}

#include "flpopns.h"

#endif // __FLEXT_ATOM_PART_CPP