[PD-cvs] externals/grill/dyn dyn.h,NONE,1.1 dyn_api.cpp,NONE,1.1 dyn_base.cpp,NONE,1.1 dyn_conn.cpp,NONE,1.1 dyn_create.cpp,NONE,1.1 dyn_data.h,NONE,1.1 dyn_listen.cpp,NONE,1.1 dyn_main.cpp,NONE,1.1 dyn_message.cpp,NONE,1.1 dyn_object.cpp,NONE,1.1 dyn_patchable.cpp,NONE,1.1 dyn_patcher.cpp,NONE,1.1 dyn_pd.h,NONE,1.1 dyn_proto.h,NONE,1.1 dyn_proxy.cpp,NONE,1.1 dyn_proxy.h,NONE,1.1 dyn_send.cpp,NONE,1.1 dyn_text.cpp,NONE,1.1 todo.txt,NONE,1.1 build-pd-darwin.sh,1.1,1.2 config-pd-darwin.txt,1.3,1.4 dyn.vcproj,1.4,1.5 make-files.txt,1.2,1.3 makefile.pd-darwin,1.4,1.5 build-pd-linux.sh,1.3,NONE build-pd-msvc.bat,1.1,NONE config-pd-linux.txt,1.5,NONE config-pd-msvc.txt,1.2,NONE dyn.vcproj.vspscc,1.1,NONE gpl.txt,1.1,NONE license.txt,1.1,NONE makefile.pd-linux,1.3,NONE makefile.pd-msvc,1.2,NONE readme.txt,1.10,NONE

Thomas Grill xovo at users.sourceforge.net
Wed Oct 27 20:19:54 CEST 2004


Update of /cvsroot/pure-data/externals/grill/dyn
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8239

Modified Files:
	build-pd-darwin.sh config-pd-darwin.txt dyn.vcproj 
	make-files.txt makefile.pd-darwin 
Added Files:
	dyn.h dyn_api.cpp dyn_base.cpp dyn_conn.cpp dyn_create.cpp 
	dyn_data.h dyn_listen.cpp dyn_main.cpp dyn_message.cpp 
	dyn_object.cpp dyn_patchable.cpp dyn_patcher.cpp dyn_pd.h 
	dyn_proto.h dyn_proxy.cpp dyn_proxy.h dyn_send.cpp 
	dyn_text.cpp todo.txt 
Removed Files:
	build-pd-linux.sh build-pd-msvc.bat config-pd-linux.txt 
	config-pd-msvc.txt dyn.vcproj.vspscc gpl.txt license.txt 
	makefile.pd-linux makefile.pd-msvc readme.txt 
Log Message:
fixes for dsp and abstraction inlets
 a few fixes
 dyn documentation
 more functionality
 only one dyn_id type for clarity
 better interface for listeners
 dyn_Finish instead of dyn_Flush
 all the major things are working in dyn!
 OSX checkin
 name changes for svn repository
 small fixes
 doesn't really work, but should compile
 dyn python module checkin
 now able to have real root patchers
 initial coding
 a few more things
 deleted test/mar patches (moved to /doc branch)
 dyn SWIG module
 dyn additions
 a _few_ changes in UIUI, establishing node groups
 made API headers monolithic
 first working dyn!
 updated todo list


--- NEW FILE: todo.txt ---
TODO:
- PD could destroy present connections of objects connected to a sub-patcher when deleting inlet objects therein.
    -> how to deal with that?

- what happens if an error occurs during object creation (as it is only scheduled, not immediately executed).... callback with error message?

- define search path for objects/abstractions


--- NEW FILE: dyn_send.cpp ---
/* 
dyn - dynamical object management

Copyright (c)2003-2004 Thomas Grill (gr at grrrr.org)
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.  
*/

#include "dyn_proto.h"

DYN_EXPORT int dyn_Send(int sched,dyn_id oid,int inlet,const t_symbol *sym,int argc,const t_atom *argv)
{
    ASSERT(oid);
    dyn_patchable *obj = oid->Patchable();

    if(obj) {
        /*
            It seems that we need connections (and proxy objects) for all inlets.
            Sending typed messages to the 0-inlet doesn't work for abstractions.
        */

        proxyin *px = obj->GetProxyIn(inlet);
        if(!px) {
            dyn_patcher *patcher = obj->owner;
            ASSERT(patcher);

            px = (proxyin *)NewPDObject(DYN_TYPE_OBJECT,patcher->glist(),sym_dynpxin);
            if(px) {
                px->init(obj);

//                    sys_lock();

//                    canvas_setcurrent(patcher->glist());
                //  connect to associated object
                if(obj_connect(&px->pdobj,0,(t_object *)obj->pdobj,inlet)) {
                    obj->AddProxyIn(inlet,px);
                }
                else {
                    glist_delete(patcher->glist(),(t_gobj *)px);
                    px = NULL;

                    // could not connect
                    post("Couldn't connect proxy object");
                }
//                    canvas_unsetcurrent(patcher->glist());
//                    sys_unlock();
            }
        }

        if(px) {
//                sys_lock();
            px->Message(sym,argc,argv);
//                sys_unlock();
            return DYN_ERROR_NONE;
        }
        else
            return DYN_ERROR_GENERAL;
    }
    else
        return DYN_ERROR_TYPEMISMATCH;
}

DYN_EXPORT int dyn_SendStr(int sched,dyn_id id,int inlet,const char *msg)
{
    t_binbuf *b = binbuf_new();
    binbuf_text(b,(char *)msg,strlen(msg));
    int argc = binbuf_getnatom(b);
    t_atom *argv = binbuf_getvec(b);
    int ret;
    if(argc) {
        t_symbol *sym;
        if(argv->a_type == A_SYMBOL) { sym = atom_getsymbol(argv); argc--,argv++; }
        else sym = &s_list;
        ret = dyn_Send(sched,id,inlet,sym,argc,argv);
    }
    else
        ret = DYN_ERROR_PARAMS;
    binbuf_free(b);
    return ret;
}

--- NEW FILE: dyn_data.h ---
/* 
dyn - dynamical object management

Copyright (c)2003-2004 Thomas Grill (gr at grrrr.org)
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.  
*/

#ifndef __DYN_DATA_H
#define __DYN_DATA_H

#include "dyn_proxy.h"

#include <map>
#include <set>


class dyn_patcher;
class dyn_conn;


class dyn_base
{
public:
    dyn_base(dyn_id id);

    dyn_id ident;

    friend void Destroy(dyn_base *b);
protected:
    virtual ~dyn_base();
};


typedef std::set<dyn_base *> Objects;
typedef std::set<dyn_conn *> Connections;
typedef std::map<int,proxy *> Proxies;


class dyn_patchable:
    public dyn_base
{
public:
    dyn_patchable(dyn_id id,dyn_patcher *o,t_gobj *obj);

    void AddProxyIn(int inlet,proxyin *o) { pxin[inlet] = o; }
    void RmvProxyIn(int inlet) { pxin.erase(inlet); }
    proxyin *GetProxyIn(int inlet) { Proxies::iterator it = pxin.find(inlet); return it != pxin.end()?(proxyin *)it->second:NULL; }
    void AddProxyOut(int outlet,proxyout *o) { pxout[outlet] = o; }
    void RmvProxyOut(int outlet) { pxout.erase(outlet); }
    proxyout *GetProxyOut(int outlet) { Proxies::iterator it = pxout.find(outlet); return it != pxout.end()?(proxyout *)it->second:NULL; }

    int GetInletCount() const { return obj_ninlets((t_object *)pdobj); }
    int GetOutletCount() const { return obj_noutlets((t_object *)pdobj); }
    int GetInletType(int ix) const { return obj_issignalinlet((t_object *)pdobj,ix)?DYN_INOUT_SIGNAL:DYN_INOUT_MESSAGE; }
    int GetOutletType(int ix) const { return obj_issignaloutlet((t_object *)pdobj,ix)?DYN_INOUT_SIGNAL:DYN_INOUT_MESSAGE; }

    void AddInlet(dyn_conn *o);
    void RmvInlet(dyn_conn *o);
    void AddOutlet(dyn_conn *o);
    void RmvOutlet(dyn_conn *o);

    void EnumInlet(int ix,dyn_enumfun fun,void *data);
    void EnumOutlet(int ix,dyn_enumfun fun,void *data);

    t_gobj *pdobj; // PD object
    dyn_patcher *owner; // patcher

protected:
    virtual ~dyn_patchable();

    Proxies pxin,pxout;
    Connections inconns,outconns;
};

class dyn_patcher:
    public dyn_patchable
{
public:
    dyn_patcher(dyn_id id,dyn_patcher *o,t_glist *obj): dyn_patchable(id,o,(t_gobj *)obj) {}
    virtual ~dyn_patcher();

    t_glist *glist() { return (t_glist *)pdobj; }

    void Add(dyn_base *o) { objs.insert(o); }
    void Remove(dyn_base *o) { objs.erase(o); }

    void Enumerate(dyn_enumfun fun,void *data);

protected:
    Objects objs;
};

class dyn_object:
    public dyn_patchable
{
public:
    dyn_object(dyn_id id,dyn_patcher *o,t_gobj *obj): dyn_patchable(id,o,obj) {}
};

class dyn_message:
    public dyn_patchable
{
public:
    dyn_message(dyn_id id,dyn_patcher *o,t_gobj *obj): dyn_patchable(id,o,obj) {}
};

class dyn_text:
    public dyn_patchable
{
public:
    dyn_text(dyn_id id,dyn_patcher *o,t_gobj *obj): dyn_patchable(id,o,obj) {}
};


class dyn_conn:
    public dyn_base
{
public:
    dyn_conn(dyn_id id,dyn_id s,int six,dyn_id d,int dix)
        : dyn_base(id)
        , src(s),slet(six),dst(d),dlet(dix) 
    {}

    dyn_id src,dst; // connected objects
    int slet,dlet;

protected:
    virtual ~dyn_conn();
};

class dyn_listen:
    public dyn_base
{
public:
    dyn_listen(dyn_id id,proxyout *p,dyn_listener cb,void *dt)
        : dyn_base(id),px(p) 
        , callback(cb),userdata(dt)
    {}

    void Callback(int outlet,const t_symbol *sym,int argc,const t_atom *argv) 
    { 
        if(callback) callback(ident,px->object->ident,outlet,sym,argc,argv,userdata); 
    }

    proxyout *px;
    dyn_listener *callback;
    void *userdata;
protected:
    virtual ~dyn_listen();
};


struct dyn_ident
{
    dyn_ident(int tp,dyn_callback cb,void *dt = NULL):
        type(tp),data(NULL),
        callback(cb),userdata(dt)
    {}

    ~dyn_ident()
    {
        // data should already have been cleared by the objects
        ASSERT(!data);
    }

    void Set(dyn_base *obj) { data = obj; }

    void Callback(int signal) { if(callback) callback(this,signal,userdata); }

    dyn_patcher *Patcher() { return dynamic_cast<dyn_patcher *>(data); }
    dyn_object *Object() { return dynamic_cast<dyn_object *>(data); }
    dyn_message *Message() { return dynamic_cast<dyn_message *>(data); }
    dyn_text *Text() { return dynamic_cast<dyn_text *>(data); }
    dyn_conn *Conn() { return dynamic_cast<dyn_conn *>(data); }
    dyn_patchable *Patchable() { return dynamic_cast<dyn_patchable *>(data); }
    dyn_listen *Listen() { return dynamic_cast<dyn_listen *>(data); }

    int type;
    dyn_base *data;

    dyn_callback *callback;
    void *userdata;
};

inline void Destroy(dyn_base *b)
{
    b->ident->data = NULL;
    delete b;
}

#endif

--- config-pd-msvc.txt DELETED ---

--- NEW FILE: dyn_patchable.cpp ---
/* 
dyn - dynamical object management

Copyright (c)2003-2004 Thomas Grill (gr at grrrr.org)
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.  
*/

#include "dyn_proto.h"

dyn_patchable::dyn_patchable(dyn_id id,dyn_patcher *o,t_gobj *obj)
    : dyn_base(id)
    , pdobj(obj),owner(o)
{
    if(owner) owner->Add(this);
}

dyn_patchable::~dyn_patchable()
{
    if(owner) {
        // if no owner, it must be a "root" patcher, which is not connectable

        owner->Remove(this);

        t_glist *glist = owner->glist();

    //	canvas_setcurrent(glist); 

        // delete object itself
        glist_delete(glist,pdobj);

        // delete proxies
        for(Proxies::iterator iit = pxin.begin(); iit != pxin.end(); ++iit) {
            proxyin *px = (proxyin *)iit->second;
            glist_delete(glist,(t_gobj *)px);
        }

        for(Proxies::iterator oit = pxout.begin(); oit != pxout.end(); ++oit) {
            proxyout *px = (proxyout *)oit->second;
            glist_delete(glist,(t_gobj *)px);
        }

    //	canvas_unsetcurrent(glist); 

        // invalidate all associated connection objects
        // the connection objects will not be deleted here!
        Connections::iterator cit;
        for(cit = inconns.begin(); cit != inconns.end(); ++cit)
            Destroy(*cit);

        for(cit = outconns.begin(); cit != outconns.end(); ++cit)
            Destroy(*cit);
    }
    else {
        dyn_patcher *p = dynamic_cast<dyn_patcher *>(this);
        ASSERT(p);

        // delete "root"-patcher
        canvas_free(p->glist());
    }
}

void dyn_patchable::AddInlet(dyn_conn *o)
{
    ASSERT(inconns.find(o) == inconns.end());
    inconns.insert(o);
}

void dyn_patchable::RmvInlet(dyn_conn *o)
{
    ASSERT(inconns.find(o) != inconns.end());
    inconns.erase(o);
}

void dyn_patchable::AddOutlet(dyn_conn *o)
{
    ASSERT(outconns.find(o) == outconns.end());
    outconns.insert(o);
}

void dyn_patchable::RmvOutlet(dyn_conn *o)
{
    ASSERT(outconns.find(o) != outconns.end());
    outconns.erase(o);
}

void dyn_patchable::EnumInlet(int ix,dyn_enumfun fun,void *data)
{
    for(Connections::const_iterator it = inconns.begin(); it != inconns.end(); ++it) {
        const dyn_conn *c = *it;
        if(c->dlet == ix && !fun(c->ident,data)) break;
    }
}

void dyn_patchable::EnumOutlet(int ix,dyn_enumfun fun,void *data)
{
    for(Connections::const_iterator it = outconns.begin(); it != outconns.end(); ++it) {
        const dyn_conn *c = *it;
        if(c->slet == ix && !fun(c->ident,data)) break;
    }
}

--- NEW FILE: dyn_conn.cpp ---
/* 
dyn - dynamical object management

Copyright (c)2003-2004 Thomas Grill (gr at grrrr.org)
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.  
*/

#include "dyn_proto.h"

dyn_conn::~dyn_conn()
{
    dyn_patchable *sobj = NULL,*dobj = NULL;
    if(src != DYN_ID_NONE && (sobj = src->Patchable()))
        sobj->RmvOutlet(this);

    if(dst != DYN_ID_NONE && (dobj = dst->Patchable()))
        dobj->RmvInlet(this);

    if(sobj || dobj) {
        src = dst = DYN_ID_NONE; 
        ident->Callback(DYN_SIGNAL_DISCONN);
    }

    if(sobj && dobj) {
//        sys_lock();
        obj_disconnect((t_object *)sobj->pdobj,slet,(t_object *)dobj->pdobj,dlet);
//        sys_unlock();
    }
}

/*
void dyn_conn::Invalidate() 
{ 
    if(src != DYN_ID_NONE || dst != DYN_ID_NONE) {
        src = dst = DYN_ID_NONE; 
        ident->Callback(DYN_SIGNAL_DISCONN);
    }
}
*/
Index: makefile.pd-darwin
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/dyn/makefile.pd-darwin,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** makefile.pd-darwin	23 Sep 2004 04:10:33 -0000	1.4
--- makefile.pd-darwin	27 Oct 2004 18:19:51 -0000	1.5
***************
*** 1,11 ****
! # dyn~ - dynamic object management for PD
  # 
- # Copyright (c)Thomas Grill (xovo at gmx.net)
- # For information on usage and redistribution, and for a DISCLAIMER OF ALL
- # WARRANTIES, see the file, "license.txt," in this distribution.  
- #
- #
- # Makefile for gcc @ darwin (OSX)
- #
  # usage:
  # to build run "make -f makefile.pd-darwin"
--- 1,4 ----
! # Makefile for gcc @ darwin
  # 
  # usage:
  # to build run "make -f makefile.pd-darwin"
***************
*** 15,42 ****
  CONFIG=config-pd-darwin.txt
  
! include $(CONFIG)
  
! # compiler+linker stuff	
! INCLUDES=$(PDPATH) 
! LIBPATH=
! FLAGS=-DFLEXT_SYS=2 
! CFLAGS=-O2 ${UFLAGS} -Wno-unused -Wno-parentheses -Wno-switch -Wstrict-prototypes
! LIBS=m
! FRAMEWORKS=vecLib
! LDFLAGS+=-Wl,-x -Wl,-S -bundle -bundle_loader $(PD)
  
! ifdef FLEXT_SHARED
! CFLAGS+=-DFLEXT_SHARED
! LDFLAGS+=-L$(FLEXTPATH)
! FLEXTLIB=-lflext
  
! else
  
! FLEXTLIB=$(FLEXTPATH)/libflext.a
  
! endif
  
  
! # ---------------------------------------------
  # the rest can stay untouched
  # ----------------------------------------------
--- 8,31 ----
  CONFIG=config-pd-darwin.txt
  
! include ${CONFIG}
  
! # compiler+linker stuff 
! INCLUDES=${PDPATH}
! FLAGS=${UFLAGS}
  
! # compiler flags for optimized build
! CFLAGS=-O2
  
! # compiler flags for debug build
! CFLAGS_D=-g
  
! # flags for shared linking
! LSHFLAGS= -dylib -dynamic -flat_namespace -undefined suppress
  
! # frameworks
! #FRAMEWORKS=Carbon veclib
  
  
! # ----------------------------------------------
  # the rest can stay untouched
  # ----------------------------------------------
***************
*** 45,86 ****
  include make-files.txt
  
! TARGET=$(TARGDIR)/$(NAME).pd_darwin
  
! # default target
! all: $(TARGDIR) $(TARGET)
  
! $(patsubst %,$(DIR)/%,$(SRCS)): $(patsubst %,$(DIR)/%,$(HDRS)) $(CONFIG)
! 	touch $@
  
  $(TARGDIR):
  	mkdir $(TARGDIR)
  
! $(TARGDIR)/%.o : $(DIR)/%.cpp
! 	$(CXX) -c $(CFLAGS) $(FLAGS) $(patsubst %,-I%,$(INCLUDES) $(FLEXTPATH)) $< -o $@
  
! $(TARGET) : $(patsubst %.cpp,$(TARGDIR)/%.o,$(SRCS)) 
! 	$(CXX) $(LDFLAGS) $^ $(patsubst %,-L%,$(LIBPATH)) $(patsubst %,-l%,$(LIBS)) $(patsubst %,-framework %,$(FRAMEWORKS)) $(FLEXTLIB) -o $@ 
! 	chmod 755 $@
  
! $(INSTPATH):
! 	mkdir $(INSTPATH)
  
! install:: $(INSTPATH)
  
! install:: $(TARGET)
! 	cp $^ $(INSTPATH)
! #	chown root.root  $(patsubst %,$(INSTPATH)/%,$(notdir $^))
! #	chmod 755 $(patsubst %,$(INSTPATH)/%,$(notdir $^))
  
- .PHONY: clean
  clean:
! 	rm -f $(TARGDIR)/*.o $(TARGET)
  	
  
  
! 
! 
! 
! 
! 
  
--- 34,76 ----
  include make-files.txt
  
! MAKEFILE=makefile.pd-darwin
  
! TARGET=$(TARGDIR)/lib$(NAME).dylib
! TARGET_D=$(TARGDIR)/lib$(NAME)_d.dylib
! HDRS=$(PHDRS) $(IHDRS)
  
! 
! all: $(TARGDIR) $(TARGET) $(TARGET_D)
  
  $(TARGDIR):
  	mkdir $(TARGDIR)
  
! $(patsubst %,$(SRCDIR)/%,$(SRCS)): $(patsubst %,$(SRCDIR)/%,$(HDRS)) $(patsubst %,$(SRCDIR)/%,$(IHDRS)) $(MAKEFILE) $(CONFIG)
! 	touch $@
  
! $(TARGDIR)/%.o : $(SRCDIR)/%.cpp
! 	$(CXX) -c -dynamic $(CFLAGS) $(CFLAGS_T)  $(CFLAGS_S) $(FLAGS) $(patsubst %,-I%,$(INCLUDES) $(SRCDIR)) $(patsubst %,-F%,$(FRAMEWORKS)) $< -o $@
  
! $(TARGDIR)/%.do : $(SRCDIR)/%.cpp 
! 	$(CXX) -c -dynamic $(CFLAGS_D) $(CFLAGS_T)  $(CFLAGS_S) $(FLAGS) $(patsubst %,-I%,$(INCLUDES) $(SRCDIR)) $(patsubst %,-F%,$(FRAMEWORKS)) $< -o $@
  
! $(TARGET) : $(patsubst %.cpp,$(TARGDIR)/%.o,$(SRCS))
! 	ld $(LSHFLAGS) -o $@ $^ -ldylib1.o -lgcc -lstdc++ $(patsubst %,-framework %,$(FRAMEWORKS)) 
  
! $(TARGET_D) : $(patsubst %.cpp,$(TARGDIR)/%.do,$(SRCS))
! 	ld $(LSHFLAGS) -o $@ $^ -ldylib1.o -lgcc -lstdc++ $(patsubst %,-framework %,$(FRAMEWORKS)) 
! 
! .PHONY: clean install
  
  clean:
! 	rm -f $(TARGDIR)/*.{o,do} $(TARGET) $(TARGET_D)
  	
+ ifdef PREFIX
  
+ install:: $(PREFIX)
+ endif
  
! install:: $(TARGET) $(TARGET_D)
! #	cp $(patsubst %,$(SRCDIR)/%,$(PHDRS)) $(PREFIX)/include
! 	cp $(TARGDIR)/lib*.dylib $(PREFIX)/lib
  

--- NEW FILE: dyn_main.cpp ---
/* 
dyn - dynamical object management

Copyright (c)2003-2004 Thomas Grill (gr at grrrr.org)
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.  
*/

#include "dyn_proto.h"

t_class *pxin_class,*pxout_class;
t_class *pxins_class,*pxouts_class;

static t_object *pxin_new() { return (t_object *)pd_new(pxin_class); }
static t_object *pxins_new() { return (t_object *)pd_new(pxins_class); }
static t_object *pxout_new() { return (t_object *)pd_new(pxout_class); }
static t_object *pxouts_new() { return (t_object *)pd_new(pxouts_class); }


const t_symbol *sym_dyncanvas = gensym(" dyn canvas ");
const t_symbol *sym_dynsxin = gensym(" dyn in~ ");
const t_symbol *sym_dynsxout = gensym(" dyn out~ ");
const t_symbol *sym_dynpxin = gensym(" dyn in ");
const t_symbol *sym_dynpxout = gensym(" dyn out ");

static const t_symbol *sym_dsp = gensym("dsp");


static bool dyn_init()
{
	// set up proxy class for inbound messages
    pxin_class = class_new(const_cast<t_symbol *>(sym_dynpxin),(t_newmethod)pxin_new,(t_method)proxy::px_exit,sizeof(proxyin),0, A_NULL);
	class_addanything(pxin_class,proxyin::px_method); 

	// set up proxy class for inbound signals
	pxins_class = class_new(const_cast<t_symbol *>(sym_dynsxin),(t_newmethod)pxins_new,(t_method)proxy::px_exit,sizeof(proxyin),0, A_NULL);
    class_addmethod(pxins_class,(t_method)proxyin::dsp,const_cast<t_symbol *>(sym_dsp),A_NULL);
    CLASS_MAINSIGNALIN(pxins_class,proxyin,defsig);

	// set up proxy class for outbound messages
	pxout_class = class_new(const_cast<t_symbol *>(sym_dynpxout),(t_newmethod)pxout_new,(t_method)proxy::px_exit,sizeof(proxyout),0, A_NULL);
	class_addanything(pxout_class,proxyout::px_method); 

	// set up proxy class for outbound signals
	pxouts_class = class_new(const_cast<t_symbol *>(sym_dynsxout),(t_newmethod)pxouts_new,(t_method)proxy::px_exit,sizeof(proxyout),0, A_NULL);
    class_addmethod(pxouts_class,(t_method)proxyout::dsp,const_cast<t_symbol *>(sym_dsp),A_NULL);
    CLASS_MAINSIGNALIN(pxouts_class,proxyout,defsig);

    return true;
}

// static variables are hopefully initialized in order of appearance
// dyn_init depends on the symbols above
static bool init = dyn_init();


DYN_EXPORT int dyn_Version()
{
    return DYN_VERSION;
}

// \todo Implement
DYN_EXPORT int dyn_Lock()
{
    return DYN_ERROR_GENERAL;
}

// \todo Implement
DYN_EXPORT int dyn_Unlock()
{
    return DYN_ERROR_GENERAL;
}

// \todo Implement
DYN_EXPORT int dyn_Pending()
{
    return 0;
}

// \todo Implement
DYN_EXPORT int dyn_Finish()
{
    return DYN_ERROR_GENERAL;
}


--- makefile.pd-msvc DELETED ---

--- NEW FILE: dyn_proxy.h ---
/* 
dyn - dynamical object management

Copyright (c)2003-2004 Thomas Grill (gr at grrrr.org)
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.  
*/

#ifndef __DYN_PROXY_H
#define __DYN_PROXY_H

#include "dyn.h"
#include "dyn_pd.h"

#include <set>

class dyn_patchable;
class dyn_listen;

// attention... no virtual table allowed!
class proxy
{ 
public:
	t_object pdobj; // must be first
    dyn_patchable *object;
	int n;
	t_sample *buf;
	t_sample defsig;

	void init(dyn_patchable *o) { object = o,n = 0,buf = NULL,defsig = 0; }

    static void px_exit(proxy *px);
};

// proxy for inbound messages
class proxyin:
	public proxy
{ 
public:
	t_outlet *outlet;

	void Message(const t_symbol *s,int argc,const t_atom *argv) 
	{
		typedmess((t_pd *)&pdobj,(t_symbol *)s,argc,(t_atom *)argv);
	}

	void init(dyn_patchable *obj,bool s = false);
    void exit() { outlet = NULL; }

	static void px_method(proxyin *obj,const t_symbol *s,int argc,const t_atom *argv);
    static void dsp(proxyin *x, t_signal **sp);
};

typedef std::set<dyn_listen *> Listeners;

// proxy for outbound messages
class proxyout:
	public proxy
{ 
public:
	int outlet;
    Listeners *listeners; // this is initialized in init

    static void Add(proxyout *px,dyn_listen *l) { px->listeners->insert(l); }
    static void Rmv(proxyout *px,dyn_listen *l);

	void init(dyn_patchable *obj,int o,bool s = false);
    void exit();

	static void px_method(proxyout *obj,const t_symbol *s,int argc,const t_atom *argv);
	static void dsp(proxyout *x, t_signal **sp);
};

#endif

--- config-pd-linux.txt DELETED ---

--- build-pd-msvc.bat DELETED ---

--- makefile.pd-linux DELETED ---

--- NEW FILE: dyn_proxy.cpp ---
/* 
dyn - dynamical object management

Copyright (c)2003-2004 Thomas Grill (gr at grrrr.org)
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.  
*/

#include "dyn_proto.h"

// proxy

void proxy::px_exit(proxy *px) 
{ 
    if(px->buf) FreeAligned(px->buf); 
}


// proxyin

void proxyin::init(dyn_patchable *obj,bool s)
{
    proxy::init(obj);
    outlet = outlet_new(&pdobj,s?&s_signal:&s_anything); 
}

void proxyin::px_method(proxyin *th,const t_symbol *s,int argc,const t_atom *argv)
{
    // send to connected object
	outlet_anything(th->outlet,(t_symbol *)s,argc,(t_atom *)argv);
}

void proxyin::dsp(proxyin *x, t_signal **sp) 
{
	int n = sp[0]->s_n;
	if(n != x->n) {
		// if vector size has changed make new buffer
		if(x->buf) FreeAligned(x->buf);
		x->buf = (t_sample *)NewAligned(sizeof(t_sample)*(x->n = n));
	}
	dsp_add_copy(x->buf,sp[0]->s_vec,n);
}


// proxyout

void proxyout::init(dyn_patchable *obj,int o,bool s)
{
    proxy::init(obj);
    listeners = new Listeners;
    outlet = o;
    if(s) outlet_new(&pdobj,&s_signal); 
}

void proxyout::exit()
{
    // invalidate all listeners
    for(Listeners::const_iterator it = listeners->begin(); it != listeners->end(); ++it)
        Destroy(*it);
    // delete container
    delete listeners;
}

void proxyout::Rmv(proxyout *px,dyn_listen *l) 
{ 
    px->listeners->erase(l);

    // if there are no more listeners we can delete the object!
    if(px->listeners->empty()) {
        dyn_patcher *p = px->object->owner;

        // remove reference
        px->object->RmvProxyOut(px->outlet);

        // delete PD object
        glist_delete(p->glist(),(t_gobj *)px);
    }
}

void proxyout::px_method(proxyout *th,const t_symbol *s,int argc,const t_atom *argv)
{
    // call attached responders
    for(Listeners::const_iterator it = th->listeners->begin(); it != th->listeners->end(); ++it)
        (*it)->Callback(th->outlet,s,argc,argv);
}

void proxyout::dsp(proxyout *x, t_signal **sp)
{
	int n = sp[0]->s_n;
	if(n != x->n) {
		// if vector size has changed make new buffer
		if(x->buf) FreeAligned(x->buf);
		x->buf = (t_sample *)NewAligned(sizeof(t_sample)*(x->n = n));
	}
	dsp_add_copy(sp[0]->s_vec,x->buf,n);
}

--- NEW FILE: dyn_base.cpp ---
/* 
dyn - dynamical object management

Copyright (c)2003-2004 Thomas Grill (gr at grrrr.org)
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.  
*/

#include "dyn_proto.h"

dyn_base::dyn_base(dyn_id id)
    : ident(id) 
{
    ident->Callback(DYN_SIGNAL_NEW);
}

dyn_base::~dyn_base() 
{
    // ident should already have been anonymized...
    ASSERT(!ident->data);

    ident->Callback(DYN_SIGNAL_FREE);
}

--- build-pd-linux.sh DELETED ---

Index: config-pd-darwin.txt
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/dyn/config-pd-darwin.txt,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** config-pd-darwin.txt	23 Sep 2004 04:10:33 -0000	1.3
--- config-pd-darwin.txt	27 Oct 2004 18:19:50 -0000	1.4
***************
*** 1,35 ****
- # dyn~ - dynamic object management for PD
- # 
- # Copyright (c)Thomas Grill (xovo at gmx.net)
- # For information on usage and redistribution, and for a DISCLAIMER OF ALL
- # WARRANTIES, see the file, "license.txt," in this distribution.  
- #
  
! # your c++ compiler (define only if not g++)
! # CXX=gcc-3.3
! 
! # where are the PD header files?
! # leave it blank if it is a system directory (like /usr/local/include), 
! # 	since gcc 3.2 complains about it
! PDPATH=../../../pd/src
! 
! # where is the PD executable?
! PD=/usr/local/bin/pd
  
! # where do the flext libraries reside?
! FLEXTPATH=/usr/local/lib/pd/flext
  
  # where should flext libraries be built?
  TARGDIR=./pd-darwin
  
! # where should dyn be installed?
  # (leave blank to omit installation)
! INSTPATH=/usr/local/lib/pd/extra
  
  # additional compiler flags
  # (check if they fit for your system!)
  UFLAGS=-malign-power -maltivec -faltivec
- 
- # build with a shared flext library
- FLEXT_SHARED=1
- 
--- 1,17 ----
  
! # your c++ compiler (define only if it's different than g++)
! # CXX=g++-3.3
  
! # where are the PD header files? (m_pd.h, m_imp.h, g_canvas.h)
! PDPATH=/Volumes/Daten/Prog/pd-0.37-4/src
  
  # where should flext libraries be built?
  TARGDIR=./pd-darwin
  
! # where should the dyn library and header be installed?
  # (leave blank to omit installation)
! PREFIX=/usr/local
  
  # additional compiler flags
  # (check if they fit for your system!)
  UFLAGS=-malign-power -maltivec -faltivec

Index: make-files.txt
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/dyn/make-files.txt,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** make-files.txt	23 Sep 2004 04:10:33 -0000	1.2
--- make-files.txt	27 Oct 2004 18:19:51 -0000	1.3
***************
*** 1,8 ****
! NAME=dyn~
! 
! # all the source files from the package
! DIR=src
! 
! SRCS= main.cpp
! HDRS= 
  
--- 1,10 ----
! NAME=dyn
! SRCDIR=.
  
+ SRCS= \
+ 	dyn_api.cpp dyn_base.cpp dyn_conn.cpp dyn_create.cpp \
+ 	dyn_listen.cpp dyn_main.cpp dyn_message.cpp dyn_object.cpp \
+ 	dyn_patchable.cpp dyn_patcher.cpp dyn_proxy.cpp dyn_send.cpp \
+ 	dyn_text.cpp
+ PHDRS=	dyn.h
+ IHDRS= dyn_data.h dyn_pd.h dyn_proto.h dyn_proxy.h

--- readme.txt DELETED ---

--- NEW FILE: dyn_proto.h ---
/* 
dyn - dynamical object management

Copyright (c)2003-2004 Thomas Grill (gr at grrrr.org)
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.  
*/

#ifndef __DYN_PROTO_H
#define __DYN_PROTO_H

#include "dyn_data.h"

// \todo really align..
inline void *NewAligned(int n) { return new char[n]; }
inline void FreeAligned(void *b) { delete[] (char *)b; }

extern t_class *pxin_class,*pxout_class;
extern t_class *pxins_class,*pxouts_class;

extern const t_symbol *sym_dyncanvas;
extern const t_symbol *sym_dynsxin,*sym_dynsxout,*sym_dynpxin,*sym_dynpxout;


void *NewPDObject(int type,t_glist *glist,const t_symbol *hdr,int argc = 0,const t_atom *argv = NULL);
dyn_ident *NewObject(int type,dyn_callback cb,dyn_ident *owner,const t_symbol *hdr,int argc = 0,const t_atom *argv = NULL);
void DelObject(dyn_ident *obj);

#endif

--- gpl.txt DELETED ---

--- NEW FILE: dyn_text.cpp ---
/* 
dyn - dynamical object management

Copyright (c)2003-2004 Thomas Grill (gr at grrrr.org)
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.  
*/

#include "dyn_proto.h"

--- dyn.vcproj.vspscc DELETED ---

--- NEW FILE: dyn_object.cpp ---
/* 
dyn - dynamical object management

Copyright (c)2003-2004 Thomas Grill (gr at grrrr.org)
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.  
*/

#include "dyn_proto.h"

--- NEW FILE: dyn_message.cpp ---
/* 
dyn - dynamical object management

Copyright (c)2003-2004 Thomas Grill (gr at grrrr.org)
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.  
*/

#include "dyn_proto.h"


Index: build-pd-darwin.sh
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/dyn/build-pd-darwin.sh,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** build-pd-darwin.sh	30 Jan 2003 17:12:58 -0000	1.1
--- build-pd-darwin.sh	27 Oct 2004 18:19:50 -0000	1.2
***************
*** 5,9 ****
  make -f makefile.pd-darwin &&
  { 
! 	if [ $INSTPATH != "" ]; then
  		echo Now install as root
  		sudo make -f makefile.pd-darwin install
--- 5,9 ----
  make -f makefile.pd-darwin &&
  { 
! 	if [ $INSTDIR != "" ]; then
  		echo Now install as root
  		sudo make -f makefile.pd-darwin install

--- NEW FILE: dyn_patcher.cpp ---
/* 
dyn - dynamical object management

Copyright (c)2003-2004 Thomas Grill (gr at grrrr.org)
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.  
*/

#include "dyn_proto.h"

dyn_patcher::~dyn_patcher()
{
    // delete sub-objects
    while(!objs.empty()) {
        // objects delete themselves from the container!
        Destroy(*objs.begin()); 
    }
}

void dyn_patcher::Enumerate(dyn_enumfun fun,void *data)
{
    for(Objects::const_iterator it = objs.begin(); it != objs.end(); ++it)
        if(fun((*it)->ident,data)) break;
}

--- NEW FILE: dyn_listen.cpp ---
/* 
dyn - dynamical object management

Copyright (c)2003-2004 Thomas Grill (gr at grrrr.org)
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.  
*/

#include "dyn_proto.h"

DYN_EXPORT int dyn_Listen(int sched,dyn_id *id,dyn_id oid,int outlet,dyn_listener cb,void *data)
{
    ASSERT(id);

    if(oid == DYN_ID_NONE) return DYN_ERROR_NOTFOUND;

    dyn_patchable *obj = oid->Patchable();
    if(obj) {
        proxyout *px = obj->GetProxyOut(outlet);
        if(!px) {
            dyn_patcher *patcher = obj->owner;
            ASSERT(patcher);

            // put proxy on the same canvas as this object for it can be connected to it!
            px = (proxyout *)NewPDObject(DYN_TYPE_OBJECT,patcher->glist(),sym_dynpxout);
            if(px) {
                px->init(obj,outlet);

//                sys_lock();

//                canvas_setcurrent(patcher->glist());
                //  connect to associated object
                if(obj_connect((t_object *)obj->pdobj,outlet,&px->pdobj,0)) {
                    obj->AddProxyOut(outlet,px);
                }
                else {
                    // delete object;
                    glist_delete(patcher->glist(),(t_gobj *)px);
                    px = NULL;

                    // could not connect
                    post("Couldn't connect proxy object");
                }
//                canvas_unsetcurrent(patcher->glist());

//                sys_unlock();
            }
        }

        if(px) {
            dyn_ident *nid = new dyn_ident(DYN_TYPE_LISTENER,oid->callback,data);
            dyn_listen *l = new dyn_listen(nid,px,cb,data);
            proxyout::Add(px,l);
            nid->Set(l);
            *id = nid;
            return DYN_ERROR_NONE;
        }
        else
            return DYN_ERROR_GENERAL;
    }
    else
        return DYN_ERROR_TYPEMISMATCH;
}

dyn_listen::~dyn_listen()
{
    proxyout::Rmv(px,this);
}

--- NEW FILE: dyn_create.cpp ---
/* 
dyn - dynamical object management

Copyright (c)2003-2004 Thomas Grill (gr at grrrr.org)
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.  
*/

#include "dyn_proto.h"
#include <list>

static const t_symbol *k_obj = gensym("obj");
static const t_symbol *k_msg = gensym("msg");
static const t_symbol *k_text = gensym("text");

static const t_symbol *sym_vis = gensym("vis");
static const t_symbol *sym_loadbang = gensym("loadbang");
static const t_symbol *sym_pd = gensym("pd");
static const t_symbol *sym_dsp = gensym("dsp");

static const t_symbol *sym_dyn = gensym("dyn");
static const t_symbol *sym_dot = gensym(".");


static t_gobj *getlast(t_glist *gl)
{
    t_gobj *go = gl->gl_list;
    if(go)
        while(go->g_next) go = go->g_next;
    return go;
}


void *NewPDObject(int type,t_glist *glist,const t_symbol *hdr,int _argc_,const t_atom *_argv_)
{
//    sys_lock();

    const t_symbol *kind;
    switch(type) {
        case DYN_TYPE_PATCHER:
            hdr = sym_pd;
            // fall through
        case DYN_TYPE_OBJECT:
            kind = k_obj;
            break;
        case DYN_TYPE_MESSAGE:
            kind = k_msg;
            ASSERT(hdr == NULL);
            break;
        case DYN_TYPE_TEXT:
            kind = k_text;
            ASSERT(hdr == NULL);
            break;
    }

    void *newest = NULL;
    t_gobj *last = NULL;

    if(type == DYN_TYPE_PATCHER && !glist) {
        /* 
            For a dyn root canvas we can not simply put a [pd] into canvas_getcurrent 
            because the [pd] would be visible in this canvas then.

            On the other hand, we can also not simply create a new canvas with 
            canvas_getcurrent active because it would not be on the list of root dsp canvases
            then.

            Hence, we have to pop all current canvases to be at the root, create our canvas
            to be a real root canvas and then push back all the canvases.
        */

        /* 
            remember current directory -
            abstractions residing in the directory of the current canvas
            (which normally is the one hosting dyn) will be found
        */
        t_symbol *dir;
        if(canvas_getcurrent()) dir = canvas_getcurrentdir();
        else dir = const_cast<t_symbol *>(sym_dot);

        // pop current canvases
        std::list<t_glist *> glstack;
        for(;;) {
            t_glist *gl = canvas_getcurrent();
            if(!gl) break;
            glstack.push_front(gl);
            canvas_unsetcurrent(gl);
        }

        // set canvas environment
        // this must be done manually if there is no owner
        glob_setfilename(NULL,const_cast<t_symbol *>(sym_dyn),dir);

        t_atom arg[6];
	    SETFLOAT(arg+0,0);	// xpos
	    SETFLOAT(arg+1,0);	// ypos
	    SETFLOAT(arg+2,1000);	// xwidth 
	    SETFLOAT(arg+3,1000);	// xwidth 
	    SETSYMBOL(arg+4,const_cast<t_symbol *>(sym_dyncanvas));	// canvas name
	    SETFLOAT(arg+5,0);	// invisible

	    t_glist *canvas = canvas_new(NULL,NULL,6,arg);
        /* or, alternatively - but this needs some message processing
        pd_typedmess(&pd_canvasmaker,gensym("canvas"),6,arg);
	    t_glist *canvas = canvas_getcurrent();
        */

        // must do that....
	    canvas_unsetcurrent(canvas);

        // push back all the canvases
        for(std::list<t_glist *>::iterator it = glstack.begin(); it != glstack.end(); ++it)
            canvas_setcurrent(*it);

        // clear environment
        glob_setfilename(NULL,&s_,&s_);

        newest = canvas;
    }
    else {
        ASSERT(glist);

        int argc = _argc_+(hdr?3:2);
        t_atom *argv = new t_atom[argc];

	    // position x/y = 0/0
        t_atom *a = argv;
	    SETFLOAT(a,0); a++;
        SETFLOAT(a,0); a++;
        if(hdr) { SETSYMBOL(a,const_cast<t_symbol *>(hdr)); a++; }
        memcpy(a,_argv_,_argc_*sizeof(t_atom));

        last = getlast(glist);

	    // set selected canvas as current
        pd_typedmess((t_pd *)glist,(t_symbol *)kind,argc,argv);
//        canvas_obj(glist,(t_symbol *)kind,argc,argv);
        newest = getlast(glist);

        delete[] argv;
    }

    if(kind == k_obj && glist) {
        // check for created objects and abstractions

        t_object *o = (t_object *)pd_newest();

        if(!o) {
            // PD creates a text object when the intended object could not be created
            t_gobj *trash = getlast(glist);

            // Test for newly created object....
            if(trash && last != trash) {
                // Delete it!
                glist_delete(glist,trash);
            }
            newest = NULL;
        }
        else
            newest = &o->te_g;
    }

	// look for latest created object
	if(newest) {
//	    if(glist) canvas_setcurrent(glist); 

		// send loadbang (if it is an abstraction)
		if(pd_class(&((t_gobj *)newest)->g_pd) == canvas_class) {
			// hide the sub-canvas
			pd_vmess((t_pd *)newest,const_cast<t_symbol *>(sym_vis),"i",0);

            // loadbang the abstraction
			pd_vmess((t_pd *)newest,const_cast<t_symbol *>(sym_loadbang),"");
        }

		// restart dsp - that's necessary because ToCanvas is called manually
		canvas_update_dsp();

    	// pop the current canvas 
//	    if(glist) canvas_unsetcurrent(glist); 
    }

//    sys_unlock();

    return newest;
}

dyn_patcher *root = NULL;

dyn_ident *NewObject(int type,dyn_callback cb,dyn_ident *owner,const t_symbol *hdr,int argc,const t_atom *argv)
{
    int err = DYN_ERROR_NONE;
    dyn_ident *ret = NULL;

    dyn_patcher *p;
    if(owner == DYN_ID_NONE) {
        if(!root) {
            void *newobj = NewPDObject(DYN_TYPE_PATCHER,NULL,NULL);
            dyn_ident *id = new dyn_ident(DYN_TYPE_PATCHER,NULL);
            root = new dyn_patcher(id,NULL,(t_glist *)newobj);
        }
        p = root;
    }
    else
        p = owner->Patcher();

    if(p) {
        void *newobj = NewPDObject(type,p->glist(),hdr,argc,argv);
        if(newobj) {
            ret = new dyn_ident(type,cb);

            switch(type) {
                case DYN_TYPE_PATCHER:
                    ret->Set(new dyn_patcher(ret,p,(t_glist *)newobj));
                    break;
                case DYN_TYPE_OBJECT:
                    ret->Set(new dyn_object(ret,p,(t_gobj *)newobj));
                    break;
                case DYN_TYPE_MESSAGE:
                    ret->Set(new dyn_message(ret,p,(t_gobj *)newobj));
                    break;
                case DYN_TYPE_TEXT:
                    ret->Set(new dyn_text(ret,p,(t_gobj *)newobj));
                    break;
            }
        }
        else
            err = DYN_ERROR_NOTCREATED;
    }
    else
        err = DYN_ERROR_NOSUB;

    if(err != DYN_ERROR_NONE) {
        if(ret) delete ret;
        throw err;
    }
    else
        return ret;
}

void DelObject(dyn_ident *obj)
{
    ASSERT(obj);
    if(obj->data) Destroy(obj->data); // delete database object
    delete obj; // delete ID
}

--- NEW FILE: dyn_pd.h ---
/* 
dyn - dynamical object management

Copyright (c)2003-2004 Thomas Grill (gr at grrrr.org)
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.  
*/

#ifndef __DYN_PD_H
#define __DYN_PD_H

#include "dyn.h"

#ifdef _MSC_VER
#pragma warning(disable: 4091 4244)
#endif
extern "C" {
#include "m_imp.h"
#include "g_canvas.h"
}

#include <assert.h>
#ifdef _MSC_VER
#include <crtdbg.h>
#define ASSERT _ASSERTE
#else
#define ASSERT assert
#endif

#endif
--- NEW FILE: dyn_api.cpp ---
/* 
dyn - dynamical object management

Copyright (c)2003-2004 Thomas Grill (gr at grrrr.org)
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.  
*/

#include "dyn_proto.h"

DYN_EXPORT int dyn_EnumObjects(dyn_id id,dyn_enumfun fun,void *data)
{
    dyn_patcher *p;
    if(id && (p = id->Patcher())) {
        p->Enumerate(fun,data);
        return DYN_ERROR_NONE;
    }
    else
        return DYN_ERROR_NOTFOUND;
}

DYN_EXPORT int dyn_NewPatcher(int sched,dyn_id *sid,dyn_callback cb,dyn_id psid /*,const char *name*/)
{
    try {
        ASSERT(sid);
        *sid = NewObject(DYN_TYPE_PATCHER,cb,psid,NULL);
        return *sid?DYN_ERROR_NONE:DYN_ERROR_GENERAL;
    }
    catch(int err) { return err; }
}

DYN_EXPORT int dyn_NewObject(int sched,dyn_id *oid,dyn_callback cb,dyn_id sid,const t_symbol *obj,int argc,const t_atom *argv)
{
    try {
        ASSERT(oid);
        *oid = NewObject(DYN_TYPE_OBJECT,cb,sid,obj,argc,argv);      
        return *oid?DYN_ERROR_NONE:DYN_ERROR_GENERAL;
    }
    catch(int err) { return err; }
}

DYN_EXPORT int dyn_NewObjectStr(int sched,dyn_id *oid,dyn_callback cb,dyn_id sid,const char *args)
{
    t_binbuf *b = binbuf_new();
    binbuf_text(b,(char *)args,strlen(args));
    int argc = binbuf_getnatom(b);
    t_atom *argv = binbuf_getvec(b);
    int ret;
    if(argc) {
        t_symbol *sym;
        if(argv->a_type == A_SYMBOL) { sym = atom_getsymbol(argv); argc--,argv++; }
        else sym = &s_list;
        ret = dyn_NewObject(sched,oid,cb,sid,sym,argc,argv);
    }
    else
        ret = DYN_ERROR_PARAMS;
    binbuf_free(b);
    return ret;
}

DYN_EXPORT int dyn_NewMessage(int sched,dyn_id *oid,dyn_callback cb,dyn_id sid,int argc,t_atom *argv)
{
    try {
        ASSERT(oid);
        *oid = NewObject(DYN_TYPE_MESSAGE,cb,sid,NULL,argc,argv);
        return *oid?DYN_ERROR_NONE:DYN_ERROR_GENERAL;
    }
    catch(int err) { return err; }
}

DYN_EXPORT int dyn_NewMessageStr(int sched,dyn_id *oid,dyn_callback cb,dyn_id sid,const char *msg)
{
    t_binbuf *b = binbuf_new();
    binbuf_text(b,(char *)msg,strlen(msg));
    int argc = binbuf_getnatom(b);
    t_atom *argv = binbuf_getvec(b);
    int ret = dyn_NewMessage(sched,oid,cb,sid,argc,argv);
    binbuf_free(b);
    return ret;
}

DYN_EXPORT int dyn_NewConnection(int sched,dyn_id *cid,dyn_callback cb,dyn_id soid,int outlet,dyn_id doid,int inlet)
{
    ASSERT(cid);
    ASSERT(soid && inlet >= 0);
    ASSERT(doid && outlet >= 0);

    dyn_patchable *sobj = soid->Patchable();
    dyn_patchable *dobj = doid->Patchable();

    int ret = DYN_ERROR_NONE;
    dyn_id conn = DYN_ID_NONE;

    if(!sobj || !dobj) {
	    ret = DYN_ERROR_TYPEMISMATCH;
        goto error;
    }

    if(sobj->owner != dobj->owner) {
	    ret = DYN_ERROR_CONN_PATCHER;
        goto error;
    }

	{
		dyn_patcher *patcher = sobj->owner;
		ASSERT(patcher);
	
	//    sys_lock();
	
		canvas_setcurrent(patcher->glist());
		bool ok = 
			!canvas_isconnected(patcher->glist(),(t_text *)sobj->pdobj,outlet,(t_text *)dobj->pdobj,inlet) &&
			obj_connect((t_object *)sobj->pdobj, outlet,(t_object *)dobj->pdobj,inlet);
		canvas_unsetcurrent(patcher->glist());
	//    sys_unlock();
	
		if(!ok) {
			ret = DYN_ERROR_CONN_GENERAL;
			goto error;
		}
	}

    conn = new dyn_ident(DYN_TYPE_CONN,cb);
    conn->Set(new dyn_conn(conn,soid,outlet,doid,inlet));

    // add connection to object lists
    sobj->AddOutlet(conn->Conn());
    dobj->AddInlet(conn->Conn());

    *cid = conn;
    return ret;

error:
    if(conn != DYN_ID_NONE) delete conn;
    return ret;
}

DYN_EXPORT int dyn_Free(int sched,dyn_id oid)
{
    try {
        DelObject(oid);
        return DYN_ERROR_NONE;
    }
    catch(int err) { return err; }
}

// NOT IMPLEMENTED
DYN_EXPORT int dyn_Reset()
{
    return DYN_ERROR_GENERAL;
}


DYN_EXPORT int dyn_SetData(dyn_id oid,void *data)
{
    if(oid) {
        oid->userdata = data;
        return DYN_ERROR_NONE;
    }
    else
        return DYN_ERROR_NOTFOUND;
}

DYN_EXPORT int dyn_GetData(dyn_id oid,void **data)
{
    ASSERT(data);
    if(oid) {
        *data = oid->userdata;
        return DYN_ERROR_NONE;
    }
    else
        return DYN_ERROR_NOTFOUND;
}


DYN_EXPORT int dyn_GetType(dyn_id oid)
{
    if(oid)
        return oid->type;
    else
        return DYN_ERROR_NOTFOUND;
}


DYN_EXPORT int dyn_GetInletCount(dyn_id id)
{
    dyn_patchable *p;
    if(id && (p = id->Patchable()))
        return p->GetInletCount();
    else
        return DYN_ERROR_NOTFOUND;
}

DYN_EXPORT int dyn_GetOutletCount(dyn_id id)
{
    dyn_patchable *p;
    if(id && (p = id->Patchable()))
        return p->GetOutletCount();
    else
        return DYN_ERROR_NOTFOUND;
}

DYN_EXPORT int dyn_GetInletType(dyn_id id,int inlet)
{
    dyn_patchable *p;
    if(id && (p = id->Patchable()))
        return p->GetInletType(inlet);
    else
        return DYN_ERROR_NOTFOUND;
}

DYN_EXPORT int dyn_GetOutletType(dyn_id id,int outlet)
{
    dyn_patchable *p;
    if(id && (p = id->Patchable()))
        return p->GetOutletType(outlet);
    else
        return DYN_ERROR_NOTFOUND;
}


DYN_EXPORT int dyn_GetConnectionSource(dyn_id cid,dyn_id *soid,int *outlet)
{
    ASSERT(soid && outlet);
    dyn_conn *c;
    if(cid && (c = cid->Conn())) {
        *soid = c->src;
        *outlet = c->slet;
        return DYN_ERROR_NONE;
    }
    else
        return DYN_ERROR_NOTFOUND;
}

DYN_EXPORT int dyn_GetConnectionDrain(dyn_id cid,dyn_id *doid,int *inlet)
{
    ASSERT(doid && inlet);
    dyn_conn *c;
    if(cid && (c = cid->Conn())) {
        *doid = c->dst;
        *inlet = c->dlet;
        return DYN_ERROR_NONE;
    }
    else
        return DYN_ERROR_NOTFOUND;
}


DYN_EXPORT int dyn_EnumInletConnections(dyn_id id,int inlet,dyn_enumfun fun,void *data)
{
    dyn_patchable *p;
    if(id && (p = id->Patchable())) {
        p->EnumInlet(inlet,fun,data);
        return DYN_ERROR_NONE;
    }
    else
        return DYN_ERROR_NOTFOUND;
}

DYN_EXPORT int dyn_EnumOutletConnections(dyn_id id,int outlet,dyn_enumfun fun,void *data)
{
    dyn_patchable *p;
    if(id && (p = id->Patchable())) {
        p->EnumOutlet(outlet,fun,data);
        return DYN_ERROR_NONE;
    }
    else
        return DYN_ERROR_NOTFOUND;
}

--- NEW FILE: dyn.h ---
/* 
dyn - dynamical object management

Copyright (c)2003-2004 Thomas Grill (gr at grrrr.org)
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.  
*/

#ifndef __DYN_H
#define __DYN_H


#define DYN_VERSION_MAJOR 0
#define DYN_VERSION_MINOR 2

#define DYN_VERSION (DYN_VERSION_MAJOR*100+DYN_VERSION_MINOR)


#ifdef _MSC_VER
    #ifdef DYN_EXPORTS
        #define DYN_EXPORT __declspec(dllexport)
    #else
        #define DYN_EXPORT __declspec(dllimport)
    #endif
#else
    #define DYN_EXPORT extern
#endif


#ifdef __cplusplus
extern "C" {
#endif

/* include PD public header for some type definitions */
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable: 4091 4244)
#endif
#include "m_pd.h"
#ifdef _MSC_VER
#pragma warning(pop)
#endif


#define DYN_ID_NONE 0


/* error codes */
#define DYN_ERROR_NONE 0  /* no error -> OK! */

#define DYN_ERROR_GENERAL -1
#define DYN_ERROR_TYPEMISMATCH -2
#define DYN_ERROR_NOTFOUND -3
#define DYN_ERROR_NOTCREATED -4  /* error creating object */

#define DYN_ERROR_PARAMS -101  /* wrong parameters */
#define DYN_ERROR_NOOBJ -102  /* object not found */
#define DYN_ERROR_NOSUB -103  /* sub-patcher not found */
#define DYN_ERROR_NOIN -104  /* inlet out of range */
#define DYN_ERROR_NOOUT -105  /* outlet out of range */

#define DYN_ERROR_CONN_GENERAL -200 /* could not connect/disconnect */
#define DYN_ERROR_CONN_PATCHER -201 /* objects to connect have different owners */


/*! Constants for message scheduling */
#define DYN_SCHED_AUTO -1
#define DYN_SCHED_NOW 1
#define DYN_SCHED_QUEUE 0


/* object types */
#define DYN_TYPE_PATCHER 1  /* object is a (sub-)patcher */
#define DYN_TYPE_OBJECT 2  /* object is a real object */
#define DYN_TYPE_MESSAGE 3  /* object is a message object */
#define DYN_TYPE_TEXT 4  /* object is text comment */
#define DYN_TYPE_CONN 5  /* object is a connection */
#define DYN_TYPE_LISTENER 6  /* object is a listener to an outlet */


/* inlet/outlet types */
#define DYN_INOUT_MESSAGE 0  /* message inlet/outlet */
#define DYN_INOUT_SIGNAL 1	/* signal inlet/outlet */

/* callback signals */
#define DYN_SIGNAL_NEW 0    /* object has been created */
#define DYN_SIGNAL_FREE 1   /* object has been destroyed */
#define DYN_SIGNAL_DISCONN 2   /* object has been disconnected */


/*! Type definition for any dyn object identifier */
struct dyn_ident;
typedef dyn_ident *dyn_id;


/*! Type of an object enumeration function 
    \param id Object ID
    \return 0 -> stop enumeration, != 0 -> go on
*/
typedef int dyn_enumfun(dyn_id id,void *data);

/* Type of an object callback function
    \param id Object id
    \param signal Type of signal (DYN_SIGNAL_* constant)
    \param data User defined data, passed at object creation
*/
typedef void dyn_callback(dyn_id id,int signal,void *data);

/* Type of a listener function
    \param lid Listener object ID
    \param id Object ID
    \param outlet Outlet index
    \param sym Message tag
    \param argc Message atom count
    \param argv Message atom list
*/
typedef void dyn_listener(dyn_id lid,dyn_id id,int outlet,const t_symbol *sym,int argc,const t_atom *argv,void *data);



/*! Get dyn version number
    \return version number major*100+minor
*/
DYN_EXPORT int dyn_Version();

/*! Restrict dyn operation to the calling thread
    \return ok = 0, error code < 0
*/
DYN_EXPORT int dyn_Lock();

/*! Unrestrict dyn operation
    \return ok = 0, error code < 0
*/
DYN_EXPORT int dyn_Unlock();


/*! Get number of pending scheduled operations
    \return number of commands, error code < 0
*/
DYN_EXPORT int dyn_Pending();


/*! Wait for all pending operations to finish
    \return ok = 0, error code < 0
*/
DYN_EXPORT int dyn_Finish();


/*! Clear all objects
    \return ok = 0, error code < 0
*/
DYN_EXPORT int dyn_Reset();


/*! Enumerate all objects in a patcher
    \param pid Patcher object ID
    \param fun Enumeration function
    \param data User defined data
    \return ok = 0, error code < 0
*/
DYN_EXPORT int dyn_EnumObjects(dyn_id pid,dyn_enumfun fun,void *data);


/*! Create a new sub-patcher 
    \param sched Scheduling constant (DYN_SCHED_*)
    \param id Pointer to new object id (returned on success)
    \param cb Callback function
    \param pid Pointer to parent patcher where the new object shall be created
    \return ok = 0, error code < 0

    \note If this command is queued, the object may not have been created on function return 
*/
DYN_EXPORT int dyn_NewPatcher(int sched,dyn_id *id,dyn_callback cb,dyn_id pid);


/*! Create a new object
    \param sched Scheduling constant (DYN_SCHED_*)
    \param id Pointer to new object id (returned on success)
    \param cb Callback function
    \param pid Pointer to parent patcher where the new object shall be created
    \param obj Object name (symbol tag)
    \param argc Number of argument atoms
    \param argv Array of atoms
    \return ok = 0, error code < 0

    \note If this command is queued, the object may not have been created on function return 
*/
DYN_EXPORT int dyn_NewObject(int sched,dyn_id *id,dyn_callback cb,dyn_id pid,const t_symbol *obj,int argc,const t_atom *argv);

/*! Create a new object (with string command line)
    \param sched Scheduling constant (DYN_SCHED_*)
    \param id Pointer to new object id (returned on success)
    \param cb Callback function
    \param pid Pointer to parent patcher where the new object shall be created
    \param args String of object name and arguments
    \return ok = 0, error code < 0

    \note If this command is queued, the object may not have been created on function return 
*/
DYN_EXPORT int dyn_NewObjectStr(int sched,dyn_id *id,dyn_callback cb,dyn_id pid,const char *args);


/*! Create a new message object
    \param sched Scheduling constant (DYN_SCHED_*)
    \param id Pointer to new object id (returned on success)
    \param cb Callback function
    \param pid Pointer to parent patcher where the new object shall be created
    \param argc Number of argument atoms
    \param argv Array of atoms
    \return ok = 0, error code < 0

    \note If this command is queued, the object may not have been created on function return 
*/
DYN_EXPORT int dyn_NewMessage(int sched,dyn_id *id,dyn_callback cb,dyn_id pid,int argc,t_atom *argv);

/*! Create a new message object (with string message)
    \param sched Scheduling constant (DYN_SCHED_*)
    \param id Pointer to new object id (returned on success)
    \param cb Callback function
    \param pid Pointer to parent patcher where the new object shall be created
    \param msg String of message text
    \return ok = 0, error code < 0

    \note If this command is queued, the object may not have been created on function return 
*/
DYN_EXPORT int dyn_NewMessageStr(int sched,dyn_id *id,dyn_callback cb,dyn_id pid,const char *msg);


/*! Connect two dyn objects
    \param sched Scheduling constant (DYN_SCHED_*)
    \param id return pointer to newly created connection object
    \param cb Callback function
    \param sid Source Object id (already present in dyn)
    \param outlet Source outlet index
    \param did Drain Object id (already present in dyn)
    \param outlet Drain inlet index
    \return ok = 0, error code < 0

    \note If this command is queued, the object may not have been created on function return 
*/
DYN_EXPORT int dyn_NewConnection(int sched,dyn_id *id,dyn_callback cb,dyn_id sid,int outlet,dyn_id did,int inlet);


/*! Delete a formerly created dyn object
    \note This can be any dyn object of type DYN_TYPE_*
    \note The ID will become invalid at function call

    \param sched Scheduling constant (DYN_SCHED_*)
    \param id Object id (already present in dyn)
    \return ok = 0, error code < 0
*/
DYN_EXPORT int dyn_Free(int sched,dyn_id id);


/*! Attach a data packet to a dyn object
    \param id Object ID (already present and valid)
    \param data Pointer to data packet 
	\return ok = 0, error code < 0

    \note This is executed immediately without scheduling
*/
DYN_EXPORT int dyn_SetData(dyn_id id,void *data);


/*! Retrieve a data packet from a dyn object
    \param id Object ID (already present and valid)
    \param data Pointer to data packet 
	\return ok = 0, error code < 0

    \note This is executed immediately without scheduling
*/
DYN_EXPORT int dyn_GetData(dyn_id id,void **data);


/*! Retrieve the object type
    \param id Object ID (already present and valid)
	\return object type (DYN_TYPE_*) >= 0, error code < 0

    \note This is executed immediately without scheduling
*/
DYN_EXPORT int dyn_GetType(dyn_id id);


/*! Get number of inlets 
    \param id Object ID (already present and valid)
	\return Number of inlets >= 0, error code < 0
    \note This is executed immediately without scheduling
*/
DYN_EXPORT int dyn_GetInletCount(dyn_id id);

/*! Get number of outlets 
    \param id Object ID (already present and valid)
	\return Number of outlets >= 0, error code < 0
    \note This is executed immediately without scheduling
*/
DYN_EXPORT int dyn_GetOutletCount(dyn_id id);


/*! Get inlet type
    \param id Object ID (already present and valid)
    \param inlet Inlet index
	\return Inlet type >= 0 (DYN_INOUT_MESSAGE or DYN_INOUT_SIGNAL), error code < 0
    \note This is executed immediately without scheduling
*/
DYN_EXPORT int dyn_GetInletType(dyn_id id,int inlet);

/*! Get outlet type
    \param id Object ID (already present and valid)
    \param outlet Outlet index
	\return Outlet type >= 0 (DYN_INOUT_MESSAGE or DYN_INOUT_SIGNAL), error code < 0
    \note This is executed immediately without scheduling
*/
DYN_EXPORT int dyn_GetOutletType(dyn_id id,int outlet);


/*! Enumerate connections to inlet
    \param id Object ID (already present and valid)
    \param inlet Inlet index
    \param fun Enumeration function
    \param data User data
	\return ok = 0, error code < 0
    \note This is executed immediately without scheduling
*/
DYN_EXPORT int dyn_EnumInletConnections(dyn_id id,int inlet,dyn_enumfun fun,void *data);

/*! Enumerate connections from outlet
    \param id Object ID (already present and valid)
    \param outlet Outlet index
    \param fun Enumeration function
    \param data User data
	\return ok = 0, error code < 0
    \note This is executed immediately without scheduling
*/
DYN_EXPORT int dyn_EnumOutletConnections(dyn_id id,int outlet,dyn_enumfun fun,void *data);


/*! Get source object of a connection
    \param cid Connection object ID
    \param oid Return pointer for connected object ID (may be NULL if not needed)
    \param outlet Return int for outlet index (may be NULL if not needed)
	\return ok = 0, error code < 0
    \note This is executed immediately without scheduling
*/
DYN_EXPORT int dyn_GetConnectionSource(dyn_id cid,dyn_id *oid,int *outlet);

/*! Get drain object of a connection
    \param cid Connection object ID
    \param oid Return pointer for connected object ID (may be NULL if not needed)
    \param inlet Return int for inlet index (may be NULL if not needed)
	\return ok = 0, error code < 0
    \note This is executed immediately without scheduling
*/
DYN_EXPORT int dyn_GetConnectionDrain(dyn_id cid,dyn_id *oid,int *inlet);


/*! Send a message to a dyn object
    \remark This often avoids the need for a connection to the respective object

    \param sched Scheduling constant (DYN_SCHED_*)
    \param id Object ID
    \param inlet Inlet index to send message to
    \param sym Message tag
    \param argc Message atom count
    \param argv Message atom list
	\return ok = 0, error code < 0
*/
DYN_EXPORT int dyn_Send(int sched,dyn_id id,int inlet,const t_symbol *sym,int argc,const t_atom *argv);

/*! Send a message (as a string) to a dyn object
    \remark This often avoids the need for a connection to the respective object

    \param sched Scheduling constant (DYN_SCHED_*)
    \param id Object ID
    \param inlet Inlet index to send message to
    \param msg Message string
	\return ok = 0, error code < 0
*/
DYN_EXPORT int dyn_SendStr(int sched,dyn_id id,int inlet,const char *msg);

/*! Listen to the outlet of a dyn object
    \remark This often avoids the need for a connection to the respective object

    \param sched Scheduling constant (DYN_SCHED_*)
    \param id Backpointer to created listener object ID
    \param oid Object ID to listen to
    \param outlet Outlet index to listen to
    \param cb Listener callback function
    \param data User data
	\return ok = 0, error code < 0
*/
DYN_EXPORT int dyn_Listen(int sched,dyn_id *id,dyn_id oid,int outlet,dyn_listener cb,void *data);


#ifdef __cplusplus
}
#endif


#endif /* __DYN_H */

Index: dyn.vcproj
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/dyn/dyn.vcproj,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** dyn.vcproj	12 Sep 2004 04:12:08 -0000	1.4
--- dyn.vcproj	27 Oct 2004 18:19:51 -0000	1.5
***************
*** 4,11 ****
  	Version="7.10"
  	Name="dyn"
! 	SccProjectName="dyn"
! 	SccAuxPath=""
! 	SccLocalPath="."
! 	SccProvider="MSSCCI:Jalindi Igloo">
  	<Platforms>
  		<Platform
--- 4,8 ----
  	Version="7.10"
  	Name="dyn"
! 	ProjectGUID="{0176D72E-797E-4221-BB4A-0A37BB0860AC}">
  	<Platforms>
  		<Platform
***************
*** 14,20 ****
  	<Configurations>
  		<Configuration
! 			Name="Debug|Win32"
! 			OutputDirectory=".\pd-msvc/d"
! 			IntermediateDirectory=".\pd-msvc/d"
  			ConfigurationType="2"
  			UseOfMFC="0"
--- 11,17 ----
  	<Configurations>
  		<Configuration
! 			Name="PD Debug|Win32"
! 			OutputDirectory=".\Debug"
! 			IntermediateDirectory=".\Debug"
  			ConfigurationType="2"
  			UseOfMFC="0"
***************
*** 24,53 ****
  				Name="VCCLCompilerTool"
  				Optimization="0"
! 				AdditionalIncludeDirectories="c:\programme\audio\pd\src,f:\prog\max\flext\source"
! 				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;PD"
  				BasicRuntimeChecks="3"
! 				RuntimeLibrary="5"
  				UsePrecompiledHeader="2"
! 				PrecompiledHeaderFile=".\pd-msvc/d/dyn.pch"
! 				AssemblerListingLocation=".\pd-msvc/d/"
! 				ObjectFile=".\pd-msvc/d/"
! 				ProgramDataBaseFileName=".\pd-msvc/d/"
! 				BrowseInformation="1"
  				WarningLevel="3"
  				SuppressStartupBanner="TRUE"
! 				DebugInformationFormat="4"
! 				CompileAs="0"/>
  			<Tool
  				Name="VCCustomBuildTool"/>
  			<Tool
  				Name="VCLinkerTool"
! 				AdditionalDependencies="pd.lib flext_d-pdwin.lib pthreadVC.lib"
! 				OutputFile="$(outdir)/dyn~.dll"
  				LinkIncremental="1"
  				SuppressStartupBanner="TRUE"
- 				AdditionalLibraryDirectories="c:\programme\audio\pd/bin,..\flext\pd-msvc"
  				GenerateDebugInformation="TRUE"
! 				ProgramDatabaseFile=".\pd-msvc/d/dyn~.pdb"
! 				ImportLibrary=".\pd-msvc/d/dyn~.lib"
  				TargetMachine="1"/>
  			<Tool
--- 21,47 ----
  				Name="VCCLCompilerTool"
  				Optimization="0"
! 				AdditionalIncludeDirectories="f:\prog\pd\pd-cvs\src"
! 				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;DYN_EXPORTS;NT;PD"
  				BasicRuntimeChecks="3"
! 				RuntimeLibrary="3"
! 				RuntimeTypeInfo="TRUE"
  				UsePrecompiledHeader="2"
! 				PrecompiledHeaderFile=".\Debug/dyn.pch"
! 				AssemblerListingLocation=".\Debug/"
! 				ObjectFile=".\Debug/"
! 				ProgramDataBaseFileName=".\Debug/"
  				WarningLevel="3"
  				SuppressStartupBanner="TRUE"
! 				DebugInformationFormat="4"/>
  			<Tool
  				Name="VCCustomBuildTool"/>
  			<Tool
  				Name="VCLinkerTool"
! 				OutputFile="../../debug/dyn.dll"
  				LinkIncremental="1"
  				SuppressStartupBanner="TRUE"
  				GenerateDebugInformation="TRUE"
! 				ProgramDatabaseFile=".\Debug/dyn.pdb"
! 				ImportLibrary=".\Debug/dyn.lib"
  				TargetMachine="1"/>
  			<Tool
***************
*** 57,61 ****
  				SuppressStartupBanner="TRUE"
  				TargetEnvironment="1"
! 				TypeLibraryName=".\pd-msvc/d/dyn.tlb"
  				HeaderFileName=""/>
  			<Tool
--- 51,55 ----
  				SuppressStartupBanner="TRUE"
  				TargetEnvironment="1"
! 				TypeLibraryName=".\Debug/dyn.tlb"
  				HeaderFileName=""/>
  			<Tool
***************
*** 81,87 ****
  		</Configuration>
  		<Configuration
! 			Name="Release|Win32"
! 			OutputDirectory=".\pd-msvc/r"
! 			IntermediateDirectory=".\pd-msvc/r"
  			ConfigurationType="2"
  			UseOfMFC="0"
--- 75,81 ----
  		</Configuration>
  		<Configuration
! 			Name="PD Release|Win32"
! 			OutputDirectory=".\Release"
! 			IntermediateDirectory=".\Release"
  			ConfigurationType="2"
  			UseOfMFC="0"
***************
*** 92,173 ****
  				Optimization="2"
  				InlineFunctionExpansion="1"
! 				AdditionalIncludeDirectories="c:\programme\audio\pd\src,f:\prog\max\flext\source"
! 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PD"
! 				StringPooling="TRUE"
! 				RuntimeLibrary="4"
! 				EnableFunctionLevelLinking="TRUE"
! 				UsePrecompiledHeader="2"
! 				PrecompiledHeaderFile=".\pd-msvc/r/dyn.pch"
! 				AssemblerListingLocation=".\pd-msvc/r/"
! 				ObjectFile=".\pd-msvc/r/"
! 				ProgramDataBaseFileName=".\pd-msvc/r/"
! 				WarningLevel="3"
! 				SuppressStartupBanner="TRUE"
! 				CompileAs="0"/>
! 			<Tool
! 				Name="VCCustomBuildTool"/>
! 			<Tool
! 				Name="VCLinkerTool"
! 				AdditionalDependencies="pd.lib flext-pdwin.lib pthreadVC.lib"
! 				OutputFile="pd-msvc/dyn~.dll"
! 				LinkIncremental="1"
! 				SuppressStartupBanner="TRUE"
! 				AdditionalLibraryDirectories="c:\programme\audio\pd/bin,..\flext\pd-msvc"
! 				ProgramDatabaseFile=".\pd-msvc/r/dyn~.pdb"
! 				ImportLibrary=".\pd-msvc/r/dyn~.lib"
! 				TargetMachine="1"/>
! 			<Tool
! 				Name="VCMIDLTool"
! 				PreprocessorDefinitions="NDEBUG"
! 				MkTypLibCompatible="TRUE"
! 				SuppressStartupBanner="TRUE"
! 				TargetEnvironment="1"
! 				TypeLibraryName=".\pd-msvc/r/dyn.tlb"
! 				HeaderFileName=""/>
! 			<Tool
! 				Name="VCPostBuildEventTool"/>
! 			<Tool
! 				Name="VCPreBuildEventTool"/>
! 			<Tool
! 				Name="VCPreLinkEventTool"/>
! 			<Tool
! 				Name="VCResourceCompilerTool"
! 				PreprocessorDefinitions="NDEBUG"
! 				Culture="3079"/>
! 			<Tool
! 				Name="VCWebServiceProxyGeneratorTool"/>
! 			<Tool
! 				Name="VCXMLDataGeneratorTool"/>
! 			<Tool
! 				Name="VCWebDeploymentTool"/>
! 			<Tool
! 				Name="VCManagedWrapperGeneratorTool"/>
! 			<Tool
! 				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
! 		</Configuration>
! 		<Configuration
! 			Name="PD Shared Release|Win32"
! 			OutputDirectory="./pd-msvc/sr"
! 			IntermediateDirectory="./pd-msvc/sr"
! 			ConfigurationType="2"
! 			UseOfMFC="0"
! 			ATLMinimizesCRunTimeLibraryUsage="FALSE"
! 			CharacterSet="2">
! 			<Tool
! 				Name="VCCLCompilerTool"
! 				Optimization="3"
! 				GlobalOptimizations="TRUE"
! 				InlineFunctionExpansion="2"
! 				FavorSizeOrSpeed="2"
! 				OmitFramePointers="TRUE"
! 				OptimizeForProcessor="3"
! 				AdditionalIncludeDirectories="f:\prog\pd\pd-cvs\src,f:\prog\max\flext\source;f:\prog\packs\pthreads"
! 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;FLEXT_SYS=2;FLEXT_SHARED"
  				StringPooling="TRUE"
  				RuntimeLibrary="2"
  				EnableFunctionLevelLinking="TRUE"
! 				EnableEnhancedInstructionSet="1"
  				UsePrecompiledHeader="2"
! 				PrecompiledHeaderFile="$(outdir)/dyn.pch"
  				WarningLevel="3"
  				SuppressStartupBanner="TRUE"/>
--- 86,100 ----
  				Optimization="2"
  				InlineFunctionExpansion="1"
! 				AdditionalIncludeDirectories="f:\prog\pd\pd-cvs\src"
! 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;DYN_EXPORTS,PD,NT"
  				StringPooling="TRUE"
  				RuntimeLibrary="2"
  				EnableFunctionLevelLinking="TRUE"
! 				RuntimeTypeInfo="TRUE"
  				UsePrecompiledHeader="2"
! 				PrecompiledHeaderFile=".\Release/dyn.pch"
! 				AssemblerListingLocation=".\Release/"
! 				ObjectFile=".\Release/"
! 				ProgramDataBaseFileName=".\Release/"
  				WarningLevel="3"
  				SuppressStartupBanner="TRUE"/>
***************
*** 176,186 ****
  			<Tool
  				Name="VCLinkerTool"
! 				AdditionalDependencies="pd.lib pthreadVC.lib"
! 				OutputFile="$(outdir)/dyn~.dll"
  				LinkIncremental="1"
  				SuppressStartupBanner="TRUE"
! 				AdditionalLibraryDirectories="f:\prog\pd\pd-cvs/bin,..\flext\pd-msvc,f:\prog\packs\pthreads"
! 				ProgramDatabaseFile="$(outdir)/dyn~.pdb"
! 				ImportLibrary="$(outdir)/dyn~.lib"
  				TargetMachine="1"/>
  			<Tool
--- 103,113 ----
  			<Tool
  				Name="VCLinkerTool"
! 				AdditionalDependencies="pd.lib"
! 				OutputFile="../../Release/dyn.dll"
  				LinkIncremental="1"
  				SuppressStartupBanner="TRUE"
! 				AdditionalLibraryDirectories="../..\api\lib"
! 				ProgramDatabaseFile=".\Release/dyn.pdb"
! 				ImportLibrary="..\..\api\lib\dyn.lib"
  				TargetMachine="1"/>
  			<Tool
***************
*** 190,197 ****
  				SuppressStartupBanner="TRUE"
  				TargetEnvironment="1"
! 				TypeLibraryName=".\pd-msvc/r/dyn.tlb"
  				HeaderFileName=""/>
  			<Tool
! 				Name="VCPostBuildEventTool"/>
  			<Tool
  				Name="VCPreBuildEventTool"/>
--- 117,128 ----
  				SuppressStartupBanner="TRUE"
  				TargetEnvironment="1"
! 				TypeLibraryName=".\Release/dyn.tlb"
  				HeaderFileName=""/>
  			<Tool
! 				Name="VCPostBuildEventTool"
! 				Description="copy API"
! 				CommandLine="
! copy dyn.h ..\..\api\include
! "/>
  			<Tool
  				Name="VCPreBuildEventTool"/>
***************
*** 218,257 ****
  	<Files>
  		<Filter
! 			Name="doc"
  			Filter="">
  			<File
! 				RelativePath="make-files.txt">
  			</File>
  			<File
! 				RelativePath="readme.txt">
  			</File>
  		</Filter>
  		<File
! 			RelativePath="src\main.cpp">
! 			<FileConfiguration
! 				Name="Debug|Win32">
! 				<Tool
! 					Name="VCCLCompilerTool"
! 					Optimization="0"
! 					AdditionalIncludeDirectories=""
! 					PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;PD;$(NoInherit)"
! 					BasicRuntimeChecks="3"
! 					BrowseInformation="1"/>
! 			</FileConfiguration>
! 			<FileConfiguration
! 				Name="Release|Win32">
! 				<Tool
! 					Name="VCCLCompilerTool"
! 					Optimization="2"
! 					AdditionalIncludeDirectories=""
! 					PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;PD;$(NoInherit)"/>
! 			</FileConfiguration>
! 			<FileConfiguration
! 				Name="PD Shared Release|Win32">
! 				<Tool
! 					Name="VCCLCompilerTool"
! 					Optimization="2"
! 					AdditionalIncludeDirectories=""/>
! 			</FileConfiguration>
  		</File>
  	</Files>
--- 149,212 ----
  	<Files>
  		<Filter
! 			Name="objects"
  			Filter="">
  			<File
! 				RelativePath=".\dyn_base.cpp">
  			</File>
  			<File
! 				RelativePath=".\dyn_conn.cpp">
! 			</File>
! 			<File
! 				RelativePath=".\dyn_message.cpp">
! 			</File>
! 			<File
! 				RelativePath=".\dyn_object.cpp">
! 			</File>
! 			<File
! 				RelativePath=".\dyn_patchable.cpp">
! 			</File>
! 			<File
! 				RelativePath=".\dyn_patcher.cpp">
! 			</File>
! 			<File
! 				RelativePath=".\dyn_text.cpp">
! 			</File>
! 		</Filter>
! 		<Filter
! 			Name="io"
! 			Filter="">
! 			<File
! 				RelativePath=".\dyn_create.cpp">
! 			</File>
! 			<File
! 				RelativePath=".\dyn_listen.cpp">
! 			</File>
! 			<File
! 				RelativePath=".\dyn_proxy.cpp">
! 			</File>
! 			<File
! 				RelativePath=".\dyn_proxy.h">
! 			</File>
! 			<File
! 				RelativePath=".\dyn_send.cpp">
  			</File>
  		</Filter>
  		<File
! 			RelativePath="dyn.h">
! 		</File>
! 		<File
! 			RelativePath=".\dyn_api.cpp">
! 		</File>
! 		<File
! 			RelativePath=".\dyn_data.h">
! 		</File>
! 		<File
! 			RelativePath=".\dyn_main.cpp">
! 		</File>
! 		<File
! 			RelativePath=".\dyn_pd.h">
! 		</File>
! 		<File
! 			RelativePath=".\dyn_proto.h">
  		</File>
  	</Files>

--- license.txt DELETED ---





More information about the Pd-cvs mailing list