rob@76: oscpack -- Open Sound Control packet manipulation library rob@76: A simple C++ library for packing and unpacking OSC packets. rob@76: http://www.rossbencina.com/code/oscpack rob@76: rob@76: Copyright (c) 2004-2013 Ross Bencina rob@76: rob@76: rob@76: Oscpack is simply a set of C++ classes for packing and unpacking OSC packets. rob@76: Oscpack includes a minimal set of UDP networking classes for Windows and POSIX. rob@76: The networking classes are sufficient for writing many OSC applications and servers, rob@76: but you are encouraged to use another networking framework if it better suits your needs. rob@76: Oscpack is not an OSC application framework. It doesn't include infrastructure for rob@76: constructing or routing OSC namespaces, just classes for easily constructing, rob@76: sending, receiving and parsing OSC packets. The library should also be easy to use rob@76: for other transport methods (e.g. serial). rob@76: rob@76: The key goals of the oscpack library are: rob@76: rob@76: - Be a simple and complete implementation of OSC rob@76: - Be portable to a wide variety of platforms rob@76: - Allow easy development of robust OSC applications rob@76: (for example it should be impossible to crash a server rob@76: by sending it malformed packets, and difficult to create rob@76: malformed packets.) rob@76: rob@76: Here's a quick run down of the key files: rob@76: rob@76: osc/OscReceivedElements -- classes for parsing a packet rob@76: osc/OscPrintRecievedElements -- iostream << operators for printing packet elements rob@76: osc/OscOutboundPacketStream -- a class for packing messages into a packet rob@76: osc/OscPacketListener -- base class for listening to OSC packets on a UdpSocket rob@76: ip/IpEndpointName -- class that represents an IP address and port number rob@76: ip/UdpSocket -- classes for UDP transmission and listening sockets rob@76: tests/OscUnitTests -- unit test program for the OSC modules rob@76: tests/OscSendTests -- examples of how to send messages rob@76: tests/OscReceiveTest -- example of how to receive the messages sent by OSCSendTests rob@76: examples/OscDump -- a program that prints received OSC packets rob@76: examples/SimpleSend -- a minimal program to send an OSC message rob@76: examples/SimpleReceive -- a minimal program to receive an OSC message rob@76: rob@76: osc/ contains all of the OSC related classes rob@76: ip/ contains the networking classes rob@76: rob@76: ip/windows contains the Windows implementation of the networking classes rob@76: ip/posix contains the POSIX implementation of the networking classes rob@76: rob@76: rob@76: Building rob@76: -------- rob@76: rob@76: The idea is that you will embed this source code in your projects as you rob@76: see fit. The Makefile has an install rule for building a shared library and rob@76: installing headers in usr/local. It can also build a static library. rob@76: There is a CMakeLists.txt for building with cmake. rob@76: rob@76: Makefile builds rob@76: ............... rob@76: rob@76: The Makefile works for Linux and Max OS X. It should also work on other platforms rob@76: that have make. Just run: rob@76: rob@76: $ make rob@76: rob@76: You can run "make install" if you like. rob@76: rob@76: rob@76: Cmake builds rob@76: ............ rob@76: rob@76: There is a CMakeLists.txt file which has been tested with cmake on rob@76: Windows and Linux. It should work on other platforms too. rob@76: For example, to generate a Visual Studio 10 project, run cmake rob@76: like this: rob@76: rob@76: > cmake -G "Visual Studio 10" rob@76: rob@76: Run cmake without any parameters to get a list of available generators. rob@76: rob@76: rob@76: Mingw build batch file rob@76: ...................... rob@76: rob@76: For Windows there is a batch file for doing a simple test build with rob@76: MinGW gcc called make.MinGW32.bat. This will build the test executables rob@76: and oscdump in ./bin and run the unit tests. rob@76: rob@76: rob@76: Note: rob@76: rob@76: In some rare instances you may need to edit the Makefile or rob@76: osc/OscHostEndianness.h to configure oscpack for the endianness of your rob@76: processor (see the comments at the top of the Makefile for details). rob@76: rob@76: rob@76: rob@76: Verification test rob@76: ----------------- rob@76: rob@76: To run the unit tests: rob@76: rob@76: $ ./bin/OscUnitTests rob@76: rob@76: To run the send and receive tests. Open two terminals. In one run: rob@76: rob@76: $ ./bin/OscReceiveTest rob@76: rob@76: Then in the other terminal run: rob@76: rob@76: $./bin/OscSendTests rob@76: rob@76: rob@76: You should see an indication that the messages were received rob@76: in the first terminal. rob@76: rob@76: Note that OscSendTests intentionally sends some unexpected rob@76: message parameters to test exception handling in the receiver. rob@76: You will see some "error while parsing message" messages printed. rob@76: rob@76: You can use ./bin/OscDump to print out OSC messages received rob@76: from any program, including the test programs. rob@76: rob@76: rob@76: -- rob@76: rob@76: rob@76: If you fix anything or write a set of TCP send/receive classes rob@76: please consider sending me a patch. My email address is rob@76: rossb@audiomulch.com. Thanks :) rob@76: rob@76: For more information about Open Sound Control, see: rob@76: http://opensoundcontrol.org/ rob@76: rob@76: Thanks to Till Bovermann for helping with POSIX networking code and rob@76: Mac compatibility, and to Martin Kaltenbrunner and the rest of the rob@76: reacTable team for giving me a reason to finish this library. Thanks rob@76: to Merlijn Blaauw for reviewing the interfaces. Thanks to Xavier Oliver rob@76: for additional help with Linux builds and POSIX implementation details. rob@76: rob@76: Portions developed at the Music Technology Group, Audiovisual Institute, rob@76: University Pompeu Fabra, Barcelona, during my stay as a visiting rob@76: researcher, November 2004 - September 2005. rob@76: rob@76: Thanks to Syneme at the University of Calgary for providing financial rob@76: support for the 1.1.0 update, December 2012 - March 2013. rob@76: rob@76: See the file CHANGES for information about recent updates. rob@76: rob@76: See the file LICENSE for information about distributing and using this code. rob@76: rob@76: ###