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
35typedef struct {
37 uint32_t sec;
40 uint32_t frac;
42
48typedef enum {
54
61typedef 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',
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'
95
96
104typedef 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];
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)
148lo_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_element_type
An enumeration of bundle element types liblo can handle.
lo_type
An enumeration of the OSC types liblo can send and receive.
@ LO_ELEMENT_BUNDLE
@ LO_ELEMENT_MESSAGE
@ LO_TIMETAG
@ LO_DOUBLE
@ LO_BLOB
@ LO_SYMBOL
@ LO_INT32
@ LO_STRING
@ LO_NIL
@ LO_INFINITUM
@ LO_FLOAT
@ LO_TRUE
@ LO_INT64
@ LO_MIDI
@ LO_FALSE
@ LO_CHAR
A structure to store OSC TimeTag values.
uint32_t frac
uint32_t sec
Union used to read values from incoming messages.
int32_t i32
int64_t h
float f32
double d
int32_t i
unsigned char c
double f64
float f
lo_timetag t
int64_t i64