diff options
author | Thomas Grill <xovo@users.sourceforge.net> | 2004-10-27 18:19:51 +0000 |
---|---|---|
committer | Thomas Grill <xovo@users.sourceforge.net> | 2004-10-27 18:19:51 +0000 |
commit | 1471f1a6b3cf6169c6aae49f2cef643bc3c3c872 (patch) | |
tree | 50ae6f3e94d60b611cfd9f6cdad98b7eed180645 /externals/grill/dyn/dyn_proxy.h | |
parent | 89ca5ec0c49ae8923a206668ef9284257c56a104 (diff) |
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
Diffstat (limited to 'externals/grill/dyn/dyn_proxy.h')
-rw-r--r-- | externals/grill/dyn/dyn_proxy.h | 74 |
1 files changed, 74 insertions, 0 deletions
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 <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 |