liblo 0.31

lo_osc_types.h
Go to the documentation of this file.
1 /*
2 * Copyright (C) 2014 Steve Harris et al. (see AUTHORS)
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public License
6 * as published by the Free Software Foundation; either version 2.1
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
13 *
14 * $Id$
15 */
16
17 #ifndef LO_OSC_TYPES_H
18 #define LO_OSC_TYPES_H
19
25 #include <stdint.h>
26
35 typedef struct {
37 uint32_t sec;
40 uint32_t frac;
41 } lo_timetag;
42
48 typedef enum {
50 LO_ELEMENT_MESSAGE = 1,
52 LO_ELEMENT_BUNDLE = 2
53 } lo_element_type;
54
61 typedef enum {
62 /* basic OSC types */
64 LO_INT32 = 'i',
66 LO_FLOAT = 'f',
68 LO_STRING = 's',
70 LO_BLOB = 'b',
71
72 /* extended OSC types */
74 LO_INT64 = 'h',
76 LO_TIMETAG = 't',
78 LO_DOUBLE = 'd',
81 LO_SYMBOL = 'S',
83 LO_CHAR = 'c',
85 LO_MIDI = 'm',
87 LO_TRUE = 'T',
89 LO_FALSE = 'F',
91 LO_NIL = 'N',
93 LO_INFINITUM = 'I'
94 } lo_type;
95
96
104 typedef union {
106 int32_t i;
108 int32_t i32;
110 int64_t h;
112 int64_t i64;
114 float f;
116 float f32;
118 double d;
120 double f64;
122 char s;
125 char S;
127 unsigned char c;
129 uint8_t m[4];
131 lo_timetag t;
133 struct {
134 int32_t size;
135 char data;
136 } blob;
137 } lo_arg;
138
139 /* Note: No struct literals in MSVC */
140 #ifdef _MSC_VER
141 #ifndef USE_ANSI_C
142 #define USE_ANSI_C
143 #endif
144 #endif
145
147 #if defined(USE_ANSI_C) || defined(DLL_EXPORT)
148 lo_timetag lo_get_tt_immediate();
149 #define LO_TT_IMMEDIATE lo_get_tt_immediate()
150 #else // !USE_ANSI_C
151 #define LO_TT_IMMEDIATE ((lo_timetag){0U,1U})
152 #endif // USE_ANSI_C
153
156 #endif
lo_arg::i32
int32_t i32
Definition: lo_osc_types.h:108
lo_arg::i64
int64_t i64
Definition: lo_osc_types.h:112
lo_timetag::sec
uint32_t sec
Definition: lo_osc_types.h:37
LO_ELEMENT_BUNDLE
@ LO_ELEMENT_BUNDLE
Definition: lo_osc_types.h:52
lo_arg::h
int64_t h
Definition: lo_osc_types.h:110
lo_arg::t
lo_timetag t
Definition: lo_osc_types.h:131
lo_arg::f32
float f32
Definition: lo_osc_types.h:116
LO_NIL
@ LO_NIL
Definition: lo_osc_types.h:91
lo_timetag
A structure to store OSC TimeTag values.
Definition: lo_osc_types.h:35
LO_ELEMENT_MESSAGE
@ LO_ELEMENT_MESSAGE
Definition: lo_osc_types.h:50
lo_arg::c
unsigned char c
Definition: lo_osc_types.h:127
LO_CHAR
@ LO_CHAR
Definition: lo_osc_types.h:83
lo_arg::i
int32_t i
Definition: lo_osc_types.h:106
LO_TRUE
@ LO_TRUE
Definition: lo_osc_types.h:87
LO_SYMBOL
@ LO_SYMBOL
Definition: lo_osc_types.h:81
LO_INT64
@ LO_INT64
Definition: lo_osc_types.h:74
lo_arg::f64
double f64
Definition: lo_osc_types.h:120
LO_TIMETAG
@ LO_TIMETAG
Definition: lo_osc_types.h:76
lo_arg::S
char S
Definition: lo_osc_types.h:125
LO_FALSE
@ LO_FALSE
Definition: lo_osc_types.h:89
LO_BLOB
@ LO_BLOB
Definition: lo_osc_types.h:70
lo_arg::d
double d
Definition: lo_osc_types.h:118
LO_DOUBLE
@ LO_DOUBLE
Definition: lo_osc_types.h:78
LO_FLOAT
@ LO_FLOAT
Definition: lo_osc_types.h:66
LO_INFINITUM
@ LO_INFINITUM
Definition: lo_osc_types.h:93
lo_arg
Union used to read values from incoming messages.
Definition: lo_osc_types.h:104
lo_type
lo_type
An enumeration of the OSC types liblo can send and receive.
Definition: lo_osc_types.h:61
LO_STRING
@ LO_STRING
Definition: lo_osc_types.h:68
lo_element_type
lo_element_type
An enumeration of bundle element types liblo can handle.
Definition: lo_osc_types.h:48
LO_INT32
@ LO_INT32
Definition: lo_osc_types.h:64
lo_arg::s
char s
Definition: lo_osc_types.h:122
lo_arg::f
float f
Definition: lo_osc_types.h:114
LO_MIDI
@ LO_MIDI
Definition: lo_osc_types.h:85
lo_timetag::frac
uint32_t frac
Definition: lo_osc_types.h:40