From fc3d3c0a4f110a23335398c327ac0a4fc949d5cb Mon Sep 17 00:00:00 2001 From: Guenter Geiger Date: Mon, 17 Jun 2002 10:13:57 +0000 Subject: This commit was generated by cvs2svn to compensate for changes in r12, which included commits to RCS files with non-trunk default branches. svn path=/trunk/externals/ggee/; revision=13 --- control/osctl | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100755 control/osctl (limited to 'control/osctl') diff --git a/control/osctl b/control/osctl new file mode 100755 index 0000000..a6ab246 --- /dev/null +++ b/control/osctl @@ -0,0 +1,66 @@ +#include +#include +#include +#ifdef NT +#pragma warning( disable : 4244 ) +#pragma warning( disable : 4305 ) +#endif + +/* ------------------------ osctl ----------------------------- */ +#ifndef M_PI +#define M_PI 3.141593f +#endif + +void InitOSCReceive() { + struct OSCReceiveMemoryTuner rt; + Boolean result; + + rt.InitTimeMemoryAllocator = MyInitTimeMalloc; + rt.RealTimeMemoryAllocator = MyRealTimeMalloc; + rt.receiveBufferSize = 1000; + rt.numReceiveBuffers = 100; + rt.numQueuedObjects = 200; + rt.numCallbackListNodes = 100; + + result = OSCInitReceive(&rt); + + if (result == FALSE) { + fatal_error("OSCInitReceive returned FALSE!\n"); + } +} + + + +static t_class *osctl_class; + + +typedef struct _osctl +{ + t_object x_obj; +} t_osctl; + + +void osctl_bang(t_osctl *x) +{ + outlet_float(x->x_obj.ob_outlet, x->x_osctl); +} + +static void *osctl_new(t_symbol* s) +{ + t_osctl *x = (t_osctl *)pd_new(osctl_class); + + InitOSCReceive(); + + + outlet_new(&x->x_obj, &s_float); + return (x); +} + +void osctl_setup(void) +{ + osctl_class = class_new(gensym("osctl"), (t_newmethod)osctl_new, 0, + sizeof(t_osctl), 0,0); + class_addbang(osctl_class,osctl_bang); +} + + -- cgit v1.2.1