aboutsummaryrefslogtreecommitdiff
path: root/src/OSC.c
blob: 70bf84abc44206b55eceb8fbd7a2b48cb74a6b4b (plain)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
	OpenSoundControl for PD
	-------------
	   -- init jdl at xdv dot org
		-- tweaks for Win32    www.zeggz.com/raf	13-April-2002
		-- smoothed out build, clean up for Darwin  <hans@at.or.at> 2004.04.04
		-- shoutz: miller and the others
		-- Windows-ification by Piotr Majdak <piotr@majdak.com> 30.08.2005
*/

#if HAVE_CONFIG_H 
#include <config.h> 
#endif

#include <m_pd.h>
#include "OSC-common.h"

#define VERSION "0.3"

/* this is for when building with non-Microsoft compilers */
#ifndef OSC_API 
#define OSC_API
#endif

typedef struct _OSC
{
     t_object x_obj;
} t_OSC;


OSC_API void OSC_setup(void);
OSC_API void OSC_version(t_OSC*);

OSC_API void sendOSC_setup(void);
OSC_API void dumpOSC_setup(void);
OSC_API void OSCroute_setup(void);


static t_class* OSC_class;


static void* OSC_new(t_symbol* s) {
    t_OSC *x = (t_OSC *)pd_new(OSC_class);
    return (x);
}


OSC_API void OSC_version (t_OSC *x) { 

  post("OSC4PD Version " VERSION "\n"
       "  Original code by matt wright. pd-fication jdl@xdv.org\n"
       "  Win32-port raf@interaccess.com   unified versions hans@at.or.at\n"
	   "  Adaptations for Windows: piotr@majdak.com\n"
	   "  Compiled: "__DATE__);
}

OSC_API void OSC_setup(void) { 
  OSC_class = class_new(gensym("OSC"), (t_newmethod)OSC_new, 0,
			  sizeof(t_OSC), 0,0);
  class_addmethod(OSC_class, (t_method)OSC_version, gensym("version"), A_NULL, 0, 0);

  sendOSC_setup();
  dumpOSC_setup();
  OSCroute_setup();
  
  post("O  : Open Sound Control 4 PD, http://www.cnmat.berkeley.edu/OSC");
  post(" S : original code by matt wright, pd hakcs cxc, Win32-port raf@interaccess.com");
  post("  C: ver: "VERSION ", compiled: "__DATE__ " -- adapted by piotr@majdak.com");
}