LiVES 3.2.0
osc.h
Go to the documentation of this file.
1// osc.h
2// LiVES (lives-exe)
3// (c) G. Finch 2003 - 2012
4// Released under the GPL 3 or later
5// see file ../COPYING for licensing details
6
7
8/* some portions of this file based on libOSC
9 Written by Adrian Freed, The Center for New Music and Audio Technologies,
10 University of California, Berkeley. Copyright (c) 1992,93,94,95,96,97,98,99,2000,01,02,03,04
11 The Regents of the University of California (Regents).
12
13 Permission to use, copy, modify, distribute, and distribute modified versions
14 of this software and its documentation without fee and without a signed
15 licensing agreement, is hereby granted, provided that the above copyright
16 notice, this paragraph and the following two paragraphs appear in all copies,
17 modifications, and distributions.
18
19 IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
20 SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
21 OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
22 BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
24 REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
25 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
26 PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
27 HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
28 MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
29
30
31 The OSC webpage is http://cnmat.cnmat.berkeley.edu/OpenSoundControl
32*/
33
34#ifdef ENABLE_OSC
35#ifndef HAS_LIVES_OSC_H
36#define HAS_LIVES_OSC_H
37
38#ifndef Boolean
39#define Boolean boolean
40#endif
41
42#ifdef __cplusplus
43extern "C" {
44#endif
45
46#include <libOSC/libosc.h>
47#include <libOSC/OSC-client.h>
48
49#ifdef __cplusplus
50}
51#endif
52
53#define OSC_CONSTLEN 8
54#define OSC_STRING_SIZE 256
55
56#define DEF_OSC_LISTEN_PORT 49999
57
58typedef struct osc_arg_t {
59 int a;
60 int b;
61 int c;
62} osc_arg;
63
64typedef struct lives_osc_t {
65 struct OSCAddressSpaceMemoryTuner t;
66 struct OSCReceiveMemoryTuner rt;
67 struct OSCContainerQueryResponseInfoStruct cqinfo;
68 struct OSCMethodQueryResponseInfoStruct ris;
69 struct sockaddr_in cl_addr;
70 int sockfd;
71 int clilen;
72 fd_set readfds;
73 OSCcontainer container;
74 OSCcontainer *leaves;
75 OSCPacketBuffer packet;
76 osc_arg *osc_args;
77} lives_osc;
78
79void lives_osc_free(lives_osc *o);
80void lives_osc_dump();
81
82boolean lives_osc_act(OSCbuf *msg);
83
84boolean lives_osc_init(uint32_t osc_udp_port);
85boolean lives_osc_poll(livespointer data);
86void lives_osc_end(void);
87boolean lives_osc_notify(int msgtype, const char *msgstring);
88boolean lives_osc_notify_success(const char *msg);
89boolean lives_osc_notify_failure(void) WARN_UNUSED;
90void lives_osc_notify_cancel(void);
91
92#endif //HAS_LIVES_OSC_H
93#endif //ENABLE_OSC
#define WARN_UNUSED
Definition: main.h:77