liblo  0.29
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 #ifdef _MSC_VER
26 #ifndef UINTSDEFINED
27 #define UINTSDEFINED
28 #define int32_t __int32
29 #define int64_t __int64
30 #define uint32_t unsigned __int32
31 #define uint64_t unsigned __int64
32 #define uint8_t unsigned __int8
33 #endif
34 #else
35 #include <stdint.h>
36 #endif
37 
46 typedef struct {
48  uint32_t sec;
51  uint32_t frac;
52 } lo_timetag;
53 
59 typedef enum {
65 
72 typedef enum {
73 /* basic OSC types */
75  LO_INT32 = 'i',
77  LO_FLOAT = 'f',
79  LO_STRING = 's',
81  LO_BLOB = 'b',
82 
83 /* extended OSC types */
85  LO_INT64 = 'h',
87  LO_TIMETAG = 't',
89  LO_DOUBLE = 'd',
92  LO_SYMBOL = 'S',
94  LO_CHAR = 'c',
96  LO_MIDI = 'm',
98  LO_TRUE = 'T',
100  LO_FALSE = 'F',
102  LO_NIL = 'N',
105 } lo_type;
106 
107 
115 typedef union {
117  int32_t i;
119  int32_t i32;
121  int64_t h;
123  int64_t i64;
125  float f;
127  float f32;
129  double d;
131  double f64;
133  char s;
136  char S;
138  unsigned char c;
140  uint8_t m[4];
144  struct {
145  int32_t size;
146  char data;
147  } blob;
148 } lo_arg;
149 
150 /* Note: No struct literals in MSVC */
151 #ifdef _MSC_VER
152 #ifndef USE_ANSI_C
153 #define USE_ANSI_C
154 #endif
155 #endif
156 
158 #if defined(USE_ANSI_C) || defined(DLL_EXPORT)
159 lo_timetag lo_get_tt_immediate();
160 #define LO_TT_IMMEDIATE lo_get_tt_immediate()
161 #else // !USE_ANSI_C
162 #define LO_TT_IMMEDIATE ((lo_timetag){0U,1U})
163 #endif // USE_ANSI_C
164 
167 #endif
Union used to read values from incoming messages.
Definition: lo_osc_types.h:115
lo_element_type
An enumeration of bundle element types liblo can handle.
Definition: lo_osc_types.h:59
A structure to store OSC TimeTag values.
Definition: lo_osc_types.h:46
float f
Definition: lo_osc_types.h:125
lo_timetag t
Definition: lo_osc_types.h:142
double f64
Definition: lo_osc_types.h:131
uint32_t sec
Definition: lo_osc_types.h:48
int64_t i64
Definition: lo_osc_types.h:123
char s
Definition: lo_osc_types.h:133
int32_t i
Definition: lo_osc_types.h:117
char S
Definition: lo_osc_types.h:136
double d
Definition: lo_osc_types.h:129
float f32
Definition: lo_osc_types.h:127
unsigned char c
Definition: lo_osc_types.h:138
uint32_t frac
Definition: lo_osc_types.h:51
int64_t h
Definition: lo_osc_types.h:121
int32_t i32
Definition: lo_osc_types.h:119
lo_type
An enumeration of the OSC types liblo can send and receive.
Definition: lo_osc_types.h:72