2 oscpack -- Open Sound Control packet manipulation library
3 http://www.audiomulch.com/~rossb/oscpack
5 Copyright (c) 2004-2005 Ross Bencina <rossb@audiomulch.com>
7 Permission is hereby granted, free of charge, to any person obtaining
8 a copy of this software and associated documentation files
9 (the "Software"), to deal in the Software without restriction,
10 including without limitation the rights to use, copy, modify, merge,
11 publish, distribute, sublicense, and/or sell copies of the Software,
12 and to permit persons to whom the Software is furnished to do so,
13 subject to the following conditions:
15 The above copyright notice and this permission notice shall be
16 included in all copies or substantial portions of the Software.
18 Any person wishing to distribute modifications to the Software is
19 requested to send the modifications to the original developer so that
20 they can be incorporated into the canonical version.
22 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
25 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
26 ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
27 CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 #ifndef INCLUDED_OSCTYPES_H
31 #define INCLUDED_OSCTYPES_H
38 #if defined(__BORLANDC__) || defined(_MSC_VER)
40 typedef __int64 int64
;
41 typedef unsigned __int64 uint64
;
45 typedef long long int64
;
46 typedef unsigned long long uint64
;
54 typedef signed int int32
;
55 typedef unsigned int uint32
;
59 typedef signed long int32
;
60 typedef unsigned long uint32
;
70 INFINITUM_TYPE_TAG
= 'I',
74 RGBA_COLOR_TYPE_TAG
= 'r',
75 MIDI_MESSAGE_TYPE_TAG
= 'm',
77 TIME_TAG_TYPE_TAG
= 't',
78 DOUBLE_TYPE_TAG
= 'd',
79 STRING_TYPE_TAG
= 's',
80 SYMBOL_TYPE_TAG
= 'S',
86 // i/o manipulators used for streaming interfaces
88 struct BundleInitiator
{
89 explicit BundleInitiator( uint64 timeTag_
) : timeTag( timeTag_
) {}
93 extern BundleInitiator BeginBundleImmediate
;
95 inline BundleInitiator
BeginBundle( uint64 timeTag
=1 )
97 return BundleInitiator(timeTag
);
101 struct BundleTerminator
{
104 extern BundleTerminator EndBundle
;
107 explicit BeginMessage( const char *addressPattern_
) : addressPattern( addressPattern_
) {}
108 const char *addressPattern
;
111 struct MessageTerminator
{
114 extern MessageTerminator EndMessage
;
117 // osc specific types. they are defined as structs so they can be used
118 // as separately identifiable types with the streaming operators.
126 struct InfinitumType
{
129 extern InfinitumType Infinitum
;
133 explicit RgbaColor( uint32 value_
) : value( value_
) {}
136 operator uint32() const { return value
; }
142 explicit MidiMessage( uint32 value_
) : value( value_
) {}
145 operator uint32() const { return value
; }
151 explicit TimeTag( uint64 value_
) : value( value_
) {}
154 operator uint64() const { return value
; }
160 explicit Symbol( const char* value_
) : value( value_
) {}
163 operator const char *() const { return value
; }
169 explicit Blob( const void* data_
, unsigned long size_
)
170 : data( data_
), size( size_
) {}
178 #endif /* INCLUDED_OSCTYPES_H */