From 1471f1a6b3cf6169c6aae49f2cef643bc3c3c872 Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Wed, 27 Oct 2004 18:19:51 +0000 Subject: 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 svn path=/trunk/; revision=2173 --- externals/grill/dyn/dyn_proxy.h | 74 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 externals/grill/dyn/dyn_proxy.h (limited to 'externals/grill/dyn/dyn_proxy.h') diff --git a/externals/grill/dyn/dyn_proxy.h b/externals/grill/dyn/dyn_proxy.h new file mode 100644 index 00000000..9430d390 --- /dev/null +++ b/externals/grill/dyn/dyn_proxy.h @@ -0,0 +1,74 @@ +/* +dyn - dynamical object management + +Copyright (c)2003-2004 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. +*/ + +#ifndef __DYN_PROXY_H +#define __DYN_PROXY_H + +#include "dyn.h" +#include "dyn_pd.h" + +#include + +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 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 -- cgit v1.2.1