rob@76
|
1 oscpack -- Open Sound Control packet manipulation library
|
rob@76
|
2 A simple C++ library for packing and unpacking OSC packets.
|
rob@76
|
3 http://www.rossbencina.com/code/oscpack
|
rob@76
|
4
|
rob@76
|
5 Copyright (c) 2004-2013 Ross Bencina <rossb@audiomulch.com>
|
rob@76
|
6
|
rob@76
|
7
|
rob@76
|
8 Oscpack is simply a set of C++ classes for packing and unpacking OSC packets.
|
rob@76
|
9 Oscpack includes a minimal set of UDP networking classes for Windows and POSIX.
|
rob@76
|
10 The networking classes are sufficient for writing many OSC applications and servers,
|
rob@76
|
11 but you are encouraged to use another networking framework if it better suits your needs.
|
rob@76
|
12 Oscpack is not an OSC application framework. It doesn't include infrastructure for
|
rob@76
|
13 constructing or routing OSC namespaces, just classes for easily constructing,
|
rob@76
|
14 sending, receiving and parsing OSC packets. The library should also be easy to use
|
rob@76
|
15 for other transport methods (e.g. serial).
|
rob@76
|
16
|
rob@76
|
17 The key goals of the oscpack library are:
|
rob@76
|
18
|
rob@76
|
19 - Be a simple and complete implementation of OSC
|
rob@76
|
20 - Be portable to a wide variety of platforms
|
rob@76
|
21 - Allow easy development of robust OSC applications
|
rob@76
|
22 (for example it should be impossible to crash a server
|
rob@76
|
23 by sending it malformed packets, and difficult to create
|
rob@76
|
24 malformed packets.)
|
rob@76
|
25
|
rob@76
|
26 Here's a quick run down of the key files:
|
rob@76
|
27
|
rob@76
|
28 osc/OscReceivedElements -- classes for parsing a packet
|
rob@76
|
29 osc/OscPrintRecievedElements -- iostream << operators for printing packet elements
|
rob@76
|
30 osc/OscOutboundPacketStream -- a class for packing messages into a packet
|
rob@76
|
31 osc/OscPacketListener -- base class for listening to OSC packets on a UdpSocket
|
rob@76
|
32 ip/IpEndpointName -- class that represents an IP address and port number
|
rob@76
|
33 ip/UdpSocket -- classes for UDP transmission and listening sockets
|
rob@76
|
34 tests/OscUnitTests -- unit test program for the OSC modules
|
rob@76
|
35 tests/OscSendTests -- examples of how to send messages
|
rob@76
|
36 tests/OscReceiveTest -- example of how to receive the messages sent by OSCSendTests
|
rob@76
|
37 examples/OscDump -- a program that prints received OSC packets
|
rob@76
|
38 examples/SimpleSend -- a minimal program to send an OSC message
|
rob@76
|
39 examples/SimpleReceive -- a minimal program to receive an OSC message
|
rob@76
|
40
|
rob@76
|
41 osc/ contains all of the OSC related classes
|
rob@76
|
42 ip/ contains the networking classes
|
rob@76
|
43
|
rob@76
|
44 ip/windows contains the Windows implementation of the networking classes
|
rob@76
|
45 ip/posix contains the POSIX implementation of the networking classes
|
rob@76
|
46
|
rob@76
|
47
|
rob@76
|
48 Building
|
rob@76
|
49 --------
|
rob@76
|
50
|
rob@76
|
51 The idea is that you will embed this source code in your projects as you
|
rob@76
|
52 see fit. The Makefile has an install rule for building a shared library and
|
rob@76
|
53 installing headers in usr/local. It can also build a static library.
|
rob@76
|
54 There is a CMakeLists.txt for building with cmake.
|
rob@76
|
55
|
rob@76
|
56 Makefile builds
|
rob@76
|
57 ...............
|
rob@76
|
58
|
rob@76
|
59 The Makefile works for Linux and Max OS X. It should also work on other platforms
|
rob@76
|
60 that have make. Just run:
|
rob@76
|
61
|
rob@76
|
62 $ make
|
rob@76
|
63
|
rob@76
|
64 You can run "make install" if you like.
|
rob@76
|
65
|
rob@76
|
66
|
rob@76
|
67 Cmake builds
|
rob@76
|
68 ............
|
rob@76
|
69
|
rob@76
|
70 There is a CMakeLists.txt file which has been tested with cmake on
|
rob@76
|
71 Windows and Linux. It should work on other platforms too.
|
rob@76
|
72 For example, to generate a Visual Studio 10 project, run cmake
|
rob@76
|
73 like this:
|
rob@76
|
74
|
rob@76
|
75 > cmake -G "Visual Studio 10"
|
rob@76
|
76
|
rob@76
|
77 Run cmake without any parameters to get a list of available generators.
|
rob@76
|
78
|
rob@76
|
79
|
rob@76
|
80 Mingw build batch file
|
rob@76
|
81 ......................
|
rob@76
|
82
|
rob@76
|
83 For Windows there is a batch file for doing a simple test build with
|
rob@76
|
84 MinGW gcc called make.MinGW32.bat. This will build the test executables
|
rob@76
|
85 and oscdump in ./bin and run the unit tests.
|
rob@76
|
86
|
rob@76
|
87
|
rob@76
|
88 Note:
|
rob@76
|
89
|
rob@76
|
90 In some rare instances you may need to edit the Makefile or
|
rob@76
|
91 osc/OscHostEndianness.h to configure oscpack for the endianness of your
|
rob@76
|
92 processor (see the comments at the top of the Makefile for details).
|
rob@76
|
93
|
rob@76
|
94
|
rob@76
|
95
|
rob@76
|
96 Verification test
|
rob@76
|
97 -----------------
|
rob@76
|
98
|
rob@76
|
99 To run the unit tests:
|
rob@76
|
100
|
rob@76
|
101 $ ./bin/OscUnitTests
|
rob@76
|
102
|
rob@76
|
103 To run the send and receive tests. Open two terminals. In one run:
|
rob@76
|
104
|
rob@76
|
105 $ ./bin/OscReceiveTest
|
rob@76
|
106
|
rob@76
|
107 Then in the other terminal run:
|
rob@76
|
108
|
rob@76
|
109 $./bin/OscSendTests
|
rob@76
|
110
|
rob@76
|
111
|
rob@76
|
112 You should see an indication that the messages were received
|
rob@76
|
113 in the first terminal.
|
rob@76
|
114
|
rob@76
|
115 Note that OscSendTests intentionally sends some unexpected
|
rob@76
|
116 message parameters to test exception handling in the receiver.
|
rob@76
|
117 You will see some "error while parsing message" messages printed.
|
rob@76
|
118
|
rob@76
|
119 You can use ./bin/OscDump to print out OSC messages received
|
rob@76
|
120 from any program, including the test programs.
|
rob@76
|
121
|
rob@76
|
122
|
rob@76
|
123 --
|
rob@76
|
124
|
rob@76
|
125
|
rob@76
|
126 If you fix anything or write a set of TCP send/receive classes
|
rob@76
|
127 please consider sending me a patch. My email address is
|
rob@76
|
128 rossb@audiomulch.com. Thanks :)
|
rob@76
|
129
|
rob@76
|
130 For more information about Open Sound Control, see:
|
rob@76
|
131 http://opensoundcontrol.org/
|
rob@76
|
132
|
rob@76
|
133 Thanks to Till Bovermann for helping with POSIX networking code and
|
rob@76
|
134 Mac compatibility, and to Martin Kaltenbrunner and the rest of the
|
rob@76
|
135 reacTable team for giving me a reason to finish this library. Thanks
|
rob@76
|
136 to Merlijn Blaauw for reviewing the interfaces. Thanks to Xavier Oliver
|
rob@76
|
137 for additional help with Linux builds and POSIX implementation details.
|
rob@76
|
138
|
rob@76
|
139 Portions developed at the Music Technology Group, Audiovisual Institute,
|
rob@76
|
140 University Pompeu Fabra, Barcelona, during my stay as a visiting
|
rob@76
|
141 researcher, November 2004 - September 2005.
|
rob@76
|
142
|
rob@76
|
143 Thanks to Syneme at the University of Calgary for providing financial
|
rob@76
|
144 support for the 1.1.0 update, December 2012 - March 2013.
|
rob@76
|
145
|
rob@76
|
146 See the file CHANGES for information about recent updates.
|
rob@76
|
147
|
rob@76
|
148 See the file LICENSE for information about distributing and using this code.
|
rob@76
|
149
|
rob@76
|
150 ###
|