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