liblo  0.32
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 {
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'
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];
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_element_type
An enumeration of bundle element types liblo can handle.
Definition: lo_osc_types.h:48
lo_type
An enumeration of the OSC types liblo can send and receive.
Definition: lo_osc_types.h:61
@ LO_ELEMENT_BUNDLE
Definition: lo_osc_types.h:52
@ LO_ELEMENT_MESSAGE
Definition: lo_osc_types.h:50
@ LO_TIMETAG
Definition: lo_osc_types.h:76
@ LO_DOUBLE
Definition: lo_osc_types.h:78
@ LO_BLOB
Definition: lo_osc_types.h:70
@ LO_SYMBOL
Definition: lo_osc_types.h:81
@ LO_INT32
Definition: lo_osc_types.h:64
@ LO_STRING
Definition: lo_osc_types.h:68
@ LO_NIL
Definition: lo_osc_types.h:91
@ LO_INFINITUM
Definition: lo_osc_types.h:93
@ LO_FLOAT
Definition: lo_osc_types.h:66
@ LO_TRUE
Definition: lo_osc_types.h:87
@ LO_INT64
Definition: lo_osc_types.h:74
@ LO_MIDI
Definition: lo_osc_types.h:85
@ LO_FALSE
Definition: lo_osc_types.h:89
@ LO_CHAR
Definition: lo_osc_types.h:83
A structure to store OSC TimeTag values.
Definition: lo_osc_types.h:35
uint32_t frac
Definition: lo_osc_types.h:40
uint32_t sec
Definition: lo_osc_types.h:37
Union used to read values from incoming messages.
Definition: lo_osc_types.h:104
int32_t i32
Definition: lo_osc_types.h:108
char s
Definition: lo_osc_types.h:122
int64_t h
Definition: lo_osc_types.h:110
float f32
Definition: lo_osc_types.h:116
double d
Definition: lo_osc_types.h:118
int32_t i
Definition: lo_osc_types.h:106
unsigned char c
Definition: lo_osc_types.h:127
char S
Definition: lo_osc_types.h:125
double f64
Definition: lo_osc_types.h:120
float f
Definition: lo_osc_types.h:114
lo_timetag t
Definition: lo_osc_types.h:131
int64_t i64
Definition: lo_osc_types.h:112