| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
#ifndef INCLUDED_OSCTYPES_H |
|---|
| 31 |
#define INCLUDED_OSCTYPES_H |
|---|
| 32 |
|
|---|
| 33 |
|
|---|
| 34 |
namespace osc{ |
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 |
#if defined(__BORLANDC__) || defined(_MSC_VER) |
|---|
| 39 |
|
|---|
| 40 |
typedef __int64 int64; |
|---|
| 41 |
typedef unsigned __int64 uint64; |
|---|
| 42 |
|
|---|
| 43 |
#else |
|---|
| 44 |
|
|---|
| 45 |
typedef long long int64; |
|---|
| 46 |
typedef unsigned long long uint64; |
|---|
| 47 |
|
|---|
| 48 |
#endif |
|---|
| 49 |
|
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 |
#ifdef x86_64 |
|---|
| 53 |
|
|---|
| 54 |
typedef signed int int32; |
|---|
| 55 |
typedef unsigned int uint32; |
|---|
| 56 |
|
|---|
| 57 |
#else |
|---|
| 58 |
|
|---|
| 59 |
typedef signed long int32; |
|---|
| 60 |
typedef unsigned long uint32; |
|---|
| 61 |
|
|---|
| 62 |
#endif |
|---|
| 63 |
|
|---|
| 64 |
|
|---|
| 65 |
|
|---|
| 66 |
enum TypeTagValues { |
|---|
| 67 |
TRUE_TYPE_TAG = 'T', |
|---|
| 68 |
FALSE_TYPE_TAG = 'F', |
|---|
| 69 |
NIL_TYPE_TAG = 'N', |
|---|
| 70 |
INFINITUM_TYPE_TAG = 'I', |
|---|
| 71 |
INT32_TYPE_TAG = 'i', |
|---|
| 72 |
FLOAT_TYPE_TAG = 'f', |
|---|
| 73 |
CHAR_TYPE_TAG = 'c', |
|---|
| 74 |
RGBA_COLOR_TYPE_TAG = 'r', |
|---|
| 75 |
MIDI_MESSAGE_TYPE_TAG = 'm', |
|---|
| 76 |
INT64_TYPE_TAG = 'h', |
|---|
| 77 |
TIME_TAG_TYPE_TAG = 't', |
|---|
| 78 |
DOUBLE_TYPE_TAG = 'd', |
|---|
| 79 |
STRING_TYPE_TAG = 's', |
|---|
| 80 |
SYMBOL_TYPE_TAG = 'S', |
|---|
| 81 |
BLOB_TYPE_TAG = 'b' |
|---|
| 82 |
}; |
|---|
| 83 |
|
|---|
| 84 |
|
|---|
| 85 |
|
|---|
| 86 |
|
|---|
| 87 |
|
|---|
| 88 |
struct BundleInitiator{ |
|---|
| 89 |
explicit BundleInitiator( uint64 timeTag_ ) : timeTag( timeTag_ ) {} |
|---|
| 90 |
uint64 timeTag; |
|---|
| 91 |
}; |
|---|
| 92 |
|
|---|
| 93 |
extern BundleInitiator BeginBundleImmediate; |
|---|
| 94 |
|
|---|
| 95 |
inline BundleInitiator BeginBundle( uint64 timeTag=1 ) |
|---|
| 96 |
{ |
|---|
| 97 |
return BundleInitiator(timeTag); |
|---|
| 98 |
} |
|---|
| 99 |
|
|---|
| 100 |
|
|---|
| 101 |
struct BundleTerminator{ |
|---|
| 102 |
}; |
|---|
| 103 |
|
|---|
| 104 |
extern BundleTerminator EndBundle; |
|---|
| 105 |
|
|---|
| 106 |
struct BeginMessage{ |
|---|
| 107 |
explicit BeginMessage( const char *addressPattern_ ) : addressPattern( addressPattern_ ) {} |
|---|
| 108 |
const char *addressPattern; |
|---|
| 109 |
}; |
|---|
| 110 |
|
|---|
| 111 |
struct MessageTerminator{ |
|---|
| 112 |
}; |
|---|
| 113 |
|
|---|
| 114 |
extern MessageTerminator EndMessage; |
|---|
| 115 |
|
|---|
| 116 |
|
|---|
| 117 |
|
|---|
| 118 |
|
|---|
| 119 |
|
|---|
| 120 |
struct NilType{ |
|---|
| 121 |
}; |
|---|
| 122 |
|
|---|
| 123 |
extern NilType Nil; |
|---|
| 124 |
|
|---|
| 125 |
|
|---|
| 126 |
struct InfinitumType{ |
|---|
| 127 |
}; |
|---|
| 128 |
|
|---|
| 129 |
extern InfinitumType Infinitum; |
|---|
| 130 |
|
|---|
| 131 |
struct RgbaColor{ |
|---|
| 132 |
RgbaColor() {} |
|---|
| 133 |
explicit RgbaColor( uint32 value_ ) : value( value_ ) {} |
|---|
| 134 |
uint32 value; |
|---|
| 135 |
|
|---|
| 136 |
operator uint32() const { return value; } |
|---|
| 137 |
}; |
|---|
| 138 |
|
|---|
| 139 |
|
|---|
| 140 |
struct MidiMessage{ |
|---|
| 141 |
MidiMessage() {} |
|---|
| 142 |
explicit MidiMessage( uint32 value_ ) : value( value_ ) {} |
|---|
| 143 |
uint32 value; |
|---|
| 144 |
|
|---|
| 145 |
operator uint32() const { return value; } |
|---|
| 146 |
}; |
|---|
| 147 |
|
|---|
| 148 |
|
|---|
| 149 |
struct TimeTag{ |
|---|
| 150 |
TimeTag() {} |
|---|
| 151 |
explicit TimeTag( uint64 value_ ) : value( value_ ) {} |
|---|
| 152 |
uint64 value; |
|---|
| 153 |
|
|---|
| 154 |
operator uint64() const { return value; } |
|---|
| 155 |
}; |
|---|
| 156 |
|
|---|
| 157 |
|
|---|
| 158 |
struct Symbol{ |
|---|
| 159 |
Symbol() {} |
|---|
| 160 |
explicit Symbol( const char* value_ ) : value( value_ ) {} |
|---|
| 161 |
const char* value; |
|---|
| 162 |
|
|---|
| 163 |
operator const char *() const { return value; } |
|---|
| 164 |
}; |
|---|
| 165 |
|
|---|
| 166 |
|
|---|
| 167 |
struct Blob{ |
|---|
| 168 |
Blob() {} |
|---|
| 169 |
explicit Blob( const void* data_, unsigned long size_ ) |
|---|
| 170 |
: data( data_ ), size( size_ ) {} |
|---|
| 171 |
const void* data; |
|---|
| 172 |
unsigned long size; |
|---|
| 173 |
}; |
|---|
| 174 |
|
|---|
| 175 |
} |
|---|
| 176 |
|
|---|
| 177 |
|
|---|
| 178 |
#endif |
|---|