changeset 118:a8541380d3e0

Ah, we've already done this. Merge, taking everything from the branch with the older commits.
author Chris Cannam <cannam@all-day-breakfast.com>
date Fri, 04 Jul 2014 10:37:37 +0100
parents 585a7be09763 (current diff) 9ba8af959808 (diff)
children fba6405099d2 c9cf28b398fb
files osx/include/fftw3.h osx/lib/libfftw3.a osx/lib/libfftw3f.a osx/lib/libvamp-hostsdk.a osx/lib/libvamp-sdk.a
diffstat 23 files changed, 3759 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/osx/include/fftw3.h	Fri Jul 04 10:36:59 2014 +0100
+++ b/osx/include/fftw3.h	Fri Jul 04 10:37:37 2014 +0100
@@ -357,7 +357,6 @@
 /* __float128 (quad precision) is a gcc extension on i386, x86_64, and ia64
    for gcc >= 4.6 (compiled in FFTW with --enable-quad-precision) */
 #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) \
- && !(defined(__ICC) || defined(__INTEL_COMPILER)) \
  && (defined(__i386__) || defined(__x86_64__) || defined(__ia64__))
 #  if !defined(FFTW_NO_Complex) && defined(_Complex_I) && defined(complex) && defined(I)
 /* note: __float128 is a typedef, which is not supported with the _Complex
@@ -385,7 +384,6 @@
 #define FFTW_PRESERVE_INPUT (1U << 4) /* cancels FFTW_DESTROY_INPUT */
 #define FFTW_PATIENT (1U << 5) /* IMPATIENT is default */
 #define FFTW_ESTIMATE (1U << 6)
-#define FFTW_WISDOM_ONLY (1U << 21)
 
 /* undocumented beyond-guru flags */
 #define FFTW_ESTIMATE_PATIENT (1U << 7)
@@ -402,6 +400,7 @@
 #define FFTW_NO_SLOW (1U << 18)
 #define FFTW_NO_FIXED_RADIX_LARGE_N (1U << 19)
 #define FFTW_ALLOW_PRUNING (1U << 20)
+#define FFTW_WISDOM_ONLY (1U << 21)
 
 #ifdef __cplusplus
 }  /* extern "C" */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/osx/include/lo/lo.h	Fri Jul 04 10:37:37 2014 +0100
@@ -0,0 +1,353 @@
+/*
+ *  Copyright (C) 2004 Steve Harris
+ *
+ *  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_H
+#define LO_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \file lo.h The liblo main headerfile and high-level API functions.
+ */
+
+#include "lo/lo_endian.h"
+#include "lo/lo_types.h"
+#include "lo/lo_osc_types.h"
+#include "lo/lo_errors.h"
+#include "lo/lo_lowlevel.h"
+
+/**
+ * \defgroup liblo High-level OSC API
+ *
+ * Defines the high-level API functions necessary to implement OSC support.
+ * Should be adequate for most applications, but if you require lower level
+ * control you can use the functions defined in lo_lowlevel.h
+ * @{
+ */
+
+/**
+ * \brief Declare an OSC destination, given IP address and port number.
+ * Same as lo_address_new_with_proto(), but using UDP.
+ *
+ * \param host An IP address or number, or NULL for the local machine.
+ * \param port a decimal port number or service name.
+ *
+ * The lo_address object may be used as the target of OSC messages.
+ *
+ * Note: if you wish to receive replies from the target of this address, you
+ * must first create a lo_server_thread or lo_server object which will receive
+ * the replies. The last lo_server(_thread) object creted will be the receiver.
+ */
+lo_address lo_address_new(const char *host, const char *port);
+
+/**
+ * \brief Declare an OSC destination, given IP address and port number,
+ * specifying protocol.
+ *
+ * \param proto The protocol to use, must be one of LO_UDP, LO_TCP or LO_UNIX.
+ * \param host An IP address or number, or NULL for the local machine.
+ * \param port a decimal port number or service name.
+ *
+ * The lo_address object may be used as the target of OSC messages.
+ *
+ * Note: if you wish to receive replies from the target of this address, you
+ * must first create a lo_server_thread or lo_server object which will receive
+ * the replies. The last lo_server(_thread) object creted will be the receiver.
+ */
+lo_address lo_address_new_with_proto(int proto, const char *host, const char *port);
+
+/**
+ * \brief Create a lo_address object from an OSC URL.
+ *
+ * example: \c "osc.udp://localhost:4444/my/path/"
+ */
+lo_address lo_address_new_from_url(const char *url);
+
+/**
+ * \brief Free the memory used by the lo_address object
+ */ 
+void lo_address_free(lo_address t);
+
+/**
+ * \brief Set the Time-to-Live value for a given target address.
+ * 
+ * This is required for sending multicast UDP messages.  A value of 1
+ * (the usual case) keeps the message within the subnet, while 255
+ * means a global, unrestricted scope.
+ * 
+ * \param t An OSC address.
+ * \param ttl An integer specifying the scope of a multicast UDP message.
+ */ 
+void lo_address_set_ttl(lo_address t, int ttl);
+
+/**
+ * \brief Get the Time-to-Live value for a given target address.
+ * 
+ * \param t An OSC address.
+ * \return An integer specifying the scope of a multicast UDP message.
+ */ 
+int lo_address_get_ttl(lo_address t);
+
+/**
+ * \brief Send a OSC formatted message to the address specified.
+ *
+ * \param targ The target OSC address
+ * \param path The OSC path the message will be delivered to
+ * \param type The types of the data items in the message, types are defined in
+ * lo_osc_types.h
+ * \param ... The data values to be transmitted. The types of the arguments
+ * passed here must agree with the types specified in the type parameter.
+ *
+ * example:
+ * \code
+ * lo_send(t, "/foo/bar", "ff", 0.1f, 23.0f);
+ * \endcode
+ *
+ * \return -1 on failure.
+ */
+int lo_send(lo_address targ, const char *path, const char *type, ...);
+
+/**
+ * \brief Send a OSC formatted message to the address specified, 
+ * from the same socket as the specificied server.
+ *
+ * \param targ The target OSC address
+ * \param from The server to send message from   (can be NULL to use new socket)
+ * \param ts   The OSC timetag timestamp at which the message will be processed 
+ * (can be LO_TT_IMMEDIATE if you don't want to attach a timetag)
+ * \param path The OSC path the message will be delivered to
+ * \param type The types of the data items in the message, types are defined in
+ * lo_osc_types.h
+ * \param ... The data values to be transmitted. The types of the arguments
+ * passed here must agree with the types specified in the type parameter.
+ *
+ * example:
+ * \code
+ * serv = lo_server_new(NULL, err);
+ * lo_server_add_method(serv, "/reply", "ss", reply_handler, NULL);
+ * lo_send_from(t, serv, LO_TT_IMMEDIATE, "/foo/bar", "ff", 0.1f, 23.0f);
+ * \endcode
+ *
+ * \return on success, the number of bytes sent, or -1 on failure.
+ */
+int lo_send_from(lo_address targ, lo_server from, lo_timetag ts, 
+	       		const char *path, const char *type, ...);
+
+/**
+ * \brief Send a OSC formatted message to the address specified, scheduled to
+ * be dispatch at some time in the future.
+ *
+ * \param targ The target OSC address
+ * \param ts The OSC timetag timestamp at which the message will be processed
+ * \param path The OSC path the message will be delivered to
+ * \param type The types of the data items in the message, types are defined in
+ * lo_osc_types.h
+ * \param ... The data values to be transmitted. The types of the arguments
+ * passed here must agree with the types specified in the type parameter.
+ *
+ * example:
+ * \code
+ * lo_timetag now;<br>
+ * lo_timetag_now(&now);<br>
+ * lo_send_timestamped(t, now, "/foo/bar", "ff", 0.1f, 23.0f);
+ * \endcode
+ *
+ * \return on success, the number of bytes sent, or -1 on failure.
+ */
+int lo_send_timestamped(lo_address targ, lo_timetag ts, const char *path,
+	       		const char *type, ...);
+
+/**
+ * \brief Return the error number from the last failed lo_send() or
+ * lo_address_new() call
+ */
+int lo_address_errno(lo_address a);
+
+/**
+ * \brief Return the error string from the last failed lo_send() or
+ * lo_address_new() call
+ */
+const char *lo_address_errstr(lo_address a);
+
+/**
+ * \brief Create a new server thread to handle incoming OSC
+ * messages.
+ *
+ * Server threads take care of the message reception and dispatch by
+ * transparently creating a system thread to handle incoming messages.
+ * Use this if you do not want to handle the threading yourself.
+ *
+ * \param port If NULL is passed then an unused port will be chosen by the
+ * system, its number may be retrieved with lo_server_thread_get_port()
+ * so it can be passed to clients. Otherwise a decimal port number, service
+ * name or UNIX domain socket path may be passed.
+ * \param err_h A function that will be called in the event of an error being
+ * raised. The function prototype is defined in lo_types.h
+ */
+lo_server_thread lo_server_thread_new(const char *port, lo_err_handler err_h);
+
+/**
+ * \brief Create a new server thread to handle incoming OSC
+ * messages, and join a UDP multicast group.
+ *
+ * Server threads take care of the message reception and dispatch by
+ * transparently creating a system thread to handle incoming messages.
+ * Use this if you do not want to handle the threading yourself.
+ *
+ * \param group The multicast group to join.  See documentation on IP
+ * multicast for the acceptable address range; e.g., http://tldp.org/HOWTO/Multicast-HOWTO-2.html
+ * \param port If NULL is passed then an unused port will be chosen by the
+ * system, its number may be retrieved with lo_server_thread_get_port()
+ * so it can be passed to clients. Otherwise a decimal port number, service
+ * name or UNIX domain socket path may be passed.
+ * \param err_h A function that will be called in the event of an error being
+ * raised. The function prototype is defined in lo_types.h
+ */
+lo_server_thread lo_server_thread_new_multicast(const char *group, const char *port,
+                                                lo_err_handler err_h);
+
+/**
+ * \brief Create a new server thread to handle incoming OSC
+ * messages, specifying protocol.
+ *
+ * Server threads take care of the message reception and dispatch by
+ * transparently creating a system thread to handle incoming messages.
+ * Use this if you do not want to handle the threading yourself.
+ *
+ * \param port If NULL is passed then an unused port will be chosen by the
+ * system, its number may be retrieved with lo_server_thread_get_port()
+ * so it can be passed to clients. Otherwise a decimal port number, service
+ * name or UNIX domain socket path may be passed.
+ * \param proto The protocol to use, should be one of LO_UDP, LO_TCP or LO_UNIX.
+ * \param err_h A function that will be called in the event of an error being
+ * raised. The function prototype is defined in lo_types.h
+ */
+lo_server_thread lo_server_thread_new_with_proto(const char *port, int proto,
+				   lo_err_handler err_h);
+
+/**
+ * \brief Free memory taken by a server thread
+ *
+ * Frees the memory, and, if currently running will stop the associated thread.
+ */
+void lo_server_thread_free(lo_server_thread st);
+
+/**
+ * \brief Add an OSC method to the specifed server thread.
+ *
+ * \param st The server thread the method is to be added to.
+ * \param path The OSC path to register the method to. If NULL is passed the
+ * method will match all paths.
+ * \param typespec The typespec the method accepts. Incoming messages with
+ * similar typespecs (e.g. ones with numerical types in the same position) will
+ * be coerced to the typespec given here.
+ * \param h The method handler callback function that will be called it a
+ * matching message is received
+ * \param user_data A value that will be passed to the callback function, h,
+ * when its invoked matching from this method.
+ */
+lo_method lo_server_thread_add_method(lo_server_thread st, const char *path,
+                               const char *typespec, lo_method_handler h,
+                               void *user_data);
+/**
+ * \brief Delete an OSC method from the specifed server thread.
+ *
+ * \param st The server thread the method is to be removed from.
+ * \param path The OSC path of the method to delete. If NULL is passed the
+ * method will match the generic handler.
+ * \param typespec The typespec the method accepts.
+ */
+void lo_server_thread_del_method(lo_server_thread st, const char *path,
+				 const char *typespec);
+
+/**
+ * \brief Start the server thread
+ *
+ * \param st the server thread to start.
+ * \return Less than 0 on failure, 0 on success.
+ */
+int lo_server_thread_start(lo_server_thread st);
+
+/**
+ * \brief Stop the server thread
+ *
+ * \param st the server thread to start.
+ * \return Less than 0 on failure, 0 on success.
+ */
+int lo_server_thread_stop(lo_server_thread st);
+
+/**
+ * \brief Return the port number that the server thread has bound to.
+ */
+int lo_server_thread_get_port(lo_server_thread st);
+
+/**
+ * \brief Return a URL describing the address of the server thread.
+ *
+ * Return value must be free()'d to reclaim memory.
+ */
+char *lo_server_thread_get_url(lo_server_thread st);
+
+/**
+ * \brief Return the lo_server for a lo_server_thread
+ *
+ * This function is useful for passing a thread's lo_server 
+ * to lo_send_from().
+ */
+lo_server lo_server_thread_get_server(lo_server_thread st);
+
+/** \brief Return true if there are scheduled events (eg. from bundles) waiting
+ * to be dispatched by the thread */
+int lo_server_thread_events_pending(lo_server_thread st);
+
+/**
+ * \brief Create a new OSC blob type.
+ *
+ * \param size The amount of space to allocate in the blob structure.
+ * \param data The data that will be used to initialise the blob, should be
+ * size bytes long.
+ */
+lo_blob lo_blob_new(int32_t size, const void *data);
+
+/**
+ * \brief Free the memory taken by a blob
+ */
+void lo_blob_free(lo_blob b);
+
+/**
+ * \brief Return the amount of valid data in a lo_blob object.
+ *
+ * If you want to know the storage size, use lo_arg_size().
+ */
+uint32_t lo_blob_datasize(lo_blob b);
+
+/**
+ * \brief Return a pointer to the start of the blob data to allow contents to
+ * be changed.
+ */
+void *lo_blob_dataptr(lo_blob b);
+
+/** @} */
+
+#include "lo/lo_macros.h"
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/osx/include/lo/lo_endian.h	Fri Jul 04 10:37:37 2014 +0100
@@ -0,0 +1,125 @@
+/*
+ *  Copyright (C) 2004 Steve Harris
+ *
+ *  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_ENDIAN_H
+#define LO_ENDIAN_H
+
+#include <sys/types.h>
+#include <stdint.h>
+
+#ifdef WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#else
+#include <netinet/in.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define lo_swap16(x) htons(x)
+
+#define lo_swap32(x) htonl(x)
+
+/* These macros come from the Linux kernel */
+
+#ifndef lo_swap16
+#define lo_swap16(x) \
+({ \
+    uint16_t __x = (x); \
+    ((uint16_t)( \
+	(((uint16_t)(__x) & (uint16_t)0x00ffU) << 8) | \
+	(((uint16_t)(__x) & (uint16_t)0xff00U) >> 8) )); \
+})
+#warning USING UNOPTIMISED ENDIAN STUFF
+#endif
+
+#ifndef lo_swap32
+#define lo_swap32(x) \
+({ \
+    uint32_t __x = (x); \
+    ((uint32_t)( \
+	(((uint32_t)(__x) & (uint32_t)0x000000ffUL) << 24) | \
+	(((uint32_t)(__x) & (uint32_t)0x0000ff00UL) <<  8) | \
+	(((uint32_t)(__x) & (uint32_t)0x00ff0000UL) >>  8) | \
+	(((uint32_t)(__x) & (uint32_t)0xff000000UL) >> 24) )); \
+})
+#endif
+
+#if 0
+#ifndef lo_swap64
+#define lo_swap64(x) \
+({ \
+    uint64_t __x = (x); \
+    ((uint64_t)( \
+	(uint64_t)(((uint64_t)(__x) & (uint64_t)0x00000000000000ffULL) << 56) | \
+	(uint64_t)(((uint64_t)(__x) & (uint64_t)0x000000000000ff00ULL) << 40) | \
+	(uint64_t)(((uint64_t)(__x) & (uint64_t)0x0000000000ff0000ULL) << 24) | \
+	(uint64_t)(((uint64_t)(__x) & (uint64_t)0x00000000ff000000ULL) <<  8) | \
+	(uint64_t)(((uint64_t)(__x) & (uint64_t)0x000000ff00000000ULL) >>  8) | \
+	(uint64_t)(((uint64_t)(__x) & (uint64_t)0x0000ff0000000000ULL) >> 24) | \
+	(uint64_t)(((uint64_t)(__x) & (uint64_t)0x00ff000000000000ULL) >> 40) | \
+	(uint64_t)(((uint64_t)(__x) & (uint64_t)0xff00000000000000ULL) >> 56) )); \
+})
+#endif
+#else
+
+typedef union {
+    uint64_t all;
+    struct {
+	uint32_t a;
+	uint32_t b;
+    } part;
+} lo_split64;
+
+static inline uint64_t lo_swap64(uint64_t x)
+{
+    lo_split64 in, out;
+
+    in.all = x;
+    out.part.a = lo_swap32(in.part.b);
+    out.part.b = lo_swap32(in.part.a);
+
+    return out.all;
+}
+#endif
+
+/* Host to OSC and OSC to Host conversion macros */
+
+#if 0
+#define lo_htoo16(x) (x)
+#define lo_htoo32(x) (x)
+#define lo_htoo64(x) (x)
+#define lo_otoh16(x) (x)
+#define lo_otoh32(x) (x)
+#define lo_otoh64(x) (x)
+#else
+#define lo_htoo16 lo_swap16
+#define lo_htoo32 lo_swap32
+#define lo_htoo64 lo_swap64
+#define lo_otoh16 lo_swap16
+#define lo_otoh32 lo_swap32
+#define lo_otoh64 lo_swap64
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+/* vi:set ts=8 sts=4 sw=4: */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/osx/include/lo/lo_errors.h	Fri Jul 04 10:37:37 2014 +0100
@@ -0,0 +1,45 @@
+/*
+ *  Copyright (C) 2004 Steve Harris
+ *
+ *  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_ERRORS_H
+#define LO_ERRORS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define LO_ENOPATH      9901
+#define LO_ENOTYPE      9902
+#define LO_UNKNOWNPROTO 9903
+#define LO_NOPORT       9904
+#define LO_TOOBIG       9905
+#define LO_INT_ERR      9906
+#define LO_EALLOC       9907
+#define LO_EINVALIDPATH 9908
+#define LO_EINVALIDTYPE 9909
+#define LO_EBADTYPE     9910
+#define LO_ESIZE        9911
+#define LO_EINVALIDARG  9912
+#define LO_ETERM        9913
+#define LO_EPAD         9914
+#define LO_EINVALIDBUND 9915
+#define LO_EINVALIDTIME 9916
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/osx/include/lo/lo_lowlevel.h	Fri Jul 04 10:37:37 2014 +0100
@@ -0,0 +1,860 @@
+/*
+ *  Copyright (C) 2004 Steve Harris
+ *
+ *  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_LOWLEVEL_H
+#define LO_LOWLEVEL_H
+
+#include "lo/lo_osc_types.h"
+
+/**
+ * \file lo_lowlevel.h The liblo headerfile defining the low-level API
+ * functions.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdarg.h>
+#ifdef _MSC_VER
+#define ssize_t SSIZE_T
+#define uint32_t unsigned __int32
+#else
+#include <stdint.h>
+#endif
+
+#include "lo/lo_types.h"
+#include "lo/lo_errors.h"
+
+/**
+ * \defgroup liblolowlevel Low-level OSC API
+ *
+ * Use these functions if you require more precise control over OSC message
+ * contruction or handling that what is provided in the high-level functions
+ * described in liblo.
+ * @{
+ */
+
+/**
+ * \brief Type used to represent numerical values in conversions between OSC
+ * types.
+ */
+typedef long double lo_hires;
+
+
+
+
+/**
+ * \brief Send a lo_message object to target targ
+ *
+ * This is slightly more efficient than lo_send() if you want to send a lot of
+ * similar messages. The messages are constructed with the lo_message_new() and
+ * \ref lo_message_add_int32 "lo_message_add*()" functions.
+ */
+int lo_send_message(lo_address targ, const char *path, lo_message msg);
+
+/**
+ * \brief Send a lo_message object to target targ from address of serv
+ *
+ * This is slightly more efficient than lo_send() if you want to send a lot of
+ * similar messages. The messages are constructed with the lo_message_new() and
+ * \ref lo_message_add_int32 "lo_message_add*()" functions.
+ *
+ * \param targ The address to send the message to
+ * \param serv The server socket to send the message from
+ *              (can be NULL to use new socket)
+ * \param path The path to send the message to
+ * \param msg  The bundle itself
+ */
+int lo_send_message_from(lo_address targ, lo_server serv, 
+     const char *path, lo_message msg);
+
+/**
+ * \brief Send a lo_bundle object to address targ
+ *
+ * Bundles are constructed with the
+ * lo_bundle_new() and lo_bundle_add_message() functions.
+ */
+int lo_send_bundle(lo_address targ, lo_bundle b);
+
+/**
+ * \brief Send a lo_bundle object to address targ from address of serv
+ *
+ * Bundles are constructed with the
+ * lo_bundle_new() and lo_bundle_add_message() functions.
+ *
+ * \param targ The address to send the bundle to
+ * \param serv The server socket to send the bundle from 
+ *              (can be NULL to use new socket)
+ * \param b    The bundle itself
+ */
+int lo_send_bundle_from(lo_address targ, lo_server serv, lo_bundle b);
+
+/**
+ * \brief Create a new lo_message object
+ */
+lo_message lo_message_new();
+
+/**
+ * \brief Free memory allocated by lo_message_new() and any subsequent
+ * \ref lo_message_add_int32 lo_message_add*() calls.
+ */
+void lo_message_free(lo_message m);
+
+/**
+ * \brief Append a number of arguments to a message.
+ *
+ * The data will be added in OSC byteorder (bigendian).
+ *
+ * \param m The message to be extended.
+ * \param types The types of the data items in the message, types are defined in
+ * lo_types_common.h
+ * \param ... The data values to be transmitted. The types of the arguments
+ * passed here must agree with the types specified in the type parameter.
+ *
+ * \return Less than 0 on failure, 0 on success.
+ */
+int lo_message_add(lo_message m, const char *types, ...);
+
+/** \internal \brief the real message_add function (don't call directly) */
+int lo_message_add_internal(lo_message m,  const char *file, const int line,
+                            const char *types, ...);
+
+/**
+ * \brief Append a varargs list to a message.
+ *
+ * The data will be added in OSC byteorder (bigendian).
+ * IMPORTANT: args list must be terminated with LO_ARGS_END, or this call will
+ * fail.  This is used to do simple error checking on the sizes of parameters
+ * passed.
+ *
+ * \param m The message to be extended.
+ * \param types The types of the data items in the message, types are defined in
+ * lo_types_common.h
+ * \param ap The va_list created by a C function declared with an
+ * ellipsis (...) argument, and pre-initialised with
+ * "va_start(ap)". The types of the arguments passed here must agree
+ * with the types specified in the type parameter.
+ *
+ * \return Less than 0 on failure, 0 on success.
+ */
+int lo_message_add_varargs(lo_message m, const char *types, va_list ap);
+
+/** \internal \brief the real message_add_varargs function (don't call directly) */
+int lo_message_add_varargs_internal(lo_message m, const char *types, va_list ap,
+                                    const char *file, const int line);
+
+/**
+ * \brief Append a data item and typechar of the specified type to a message.
+ *
+ * The data will be added in OSC byteorder (bigendian).
+ *
+ * \param m The message to be extended.
+ * \param a The data item.
+ *
+ * \return Less than 0 on failure, 0 on success.
+ */
+int lo_message_add_int32(lo_message m, int32_t a);
+
+/**
+ * \brief  Append a data item and typechar of the specified type to a message.
+ * See lo_message_add_int32() for details.
+ *
+ * \return Less than 0 on failure, 0 on success.
+ */
+int lo_message_add_float(lo_message m, float a);
+
+/**
+ * \brief  Append a data item and typechar of the specified type to a message.
+ * See lo_message_add_int32() for details.
+ *
+ * \return Less than 0 on failure, 0 on success.
+ */
+int lo_message_add_string(lo_message m, const char *a);
+
+/**
+ * \brief  Append a data item and typechar of the specified type to a message.
+ * See lo_message_add_int32() for details.
+ *
+ * \return Less than 0 on failure, 0 on success.
+ */
+int lo_message_add_blob(lo_message m, lo_blob a);
+
+/**
+ * \brief  Append a data item and typechar of the specified type to a message.
+ * See lo_message_add_int32() for details.
+ *
+ * \return Less than 0 on failure, 0 on success.
+ */
+int lo_message_add_int64(lo_message m, int64_t a);
+
+/**
+ * \brief  Append a data item and typechar of the specified type to a message.
+ * See lo_message_add_int32() for details.
+ *
+ * \return Less than 0 on failure, 0 on success.
+ */
+int lo_message_add_timetag(lo_message m, lo_timetag a);
+
+/**
+ * \brief  Append a data item and typechar of the specified type to a message.
+ * See lo_message_add_int32() for details.
+ *
+ * \return Less than 0 on failure, 0 on success.
+ */
+int lo_message_add_double(lo_message m, double a);
+
+/**
+ * \brief  Append a data item and typechar of the specified type to a message.
+ * See lo_message_add_int32() for details.
+ *
+ * \return Less than 0 on failure, 0 on success.
+ */
+int lo_message_add_symbol(lo_message m, const char *a);
+
+/**
+ * \brief  Append a data item and typechar of the specified type to a message.
+ * See lo_message_add_int32() for details.
+ *
+ * \return Less than 0 on failure, 0 on success.
+ */
+int lo_message_add_char(lo_message m, char a);
+
+/**
+ * \brief  Append a data item and typechar of the specified type to a message.
+ * See lo_message_add_int32() for details.
+ *
+ * \return Less than 0 on failure, 0 on success.
+ */
+int lo_message_add_midi(lo_message m, uint8_t a[4]);
+
+/**
+ * \brief  Append a data item and typechar of the specified type to a message.
+ * See lo_message_add_int32() for details.
+ *
+ * \return Less than 0 on failure, 0 on success.
+ */
+int lo_message_add_true(lo_message m);
+
+/**
+ * \brief  Append a data item and typechar of the specified type to a message.
+ * See lo_message_add_int32() for details.
+ *
+ * \return Less than 0 on failure, 0 on success.
+ */
+int lo_message_add_false(lo_message m);
+
+/**
+ * \brief  Append a data item and typechar of the specified type to a message.
+ * See lo_message_add_int32() for details.
+ *
+ * \return Less than 0 on failure, 0 on success.
+ */
+int lo_message_add_nil(lo_message m);
+
+/**
+ * \brief  Append a data item and typechar of the specified type to a message.
+ * See lo_message_add_int32() for details.
+ *
+ * \return Less than 0 on failure, 0 on success.
+ */
+int lo_message_add_infinitum(lo_message m);
+
+/**
+ * \brief  Returns the source (lo_address) of an incoming message.
+ *
+ * Returns NULL if the message is outgoing. Do not free the returned address.
+ */
+lo_address lo_message_get_source(lo_message m);
+
+/**
+ * \brief  Returns the timestamp (lo_timetag *) of a bundled incoming message.
+ *
+ * Returns LO_TT_IMMEDIATE if the message is outgoing, or did not arrive
+ * contained in a bundle. Do not free the returned timetag.
+ */
+lo_timetag lo_message_get_timestamp(lo_message m);
+
+/**
+ * \brief  Return the message type tag string.
+ *
+ * The result is valid until further data is added with lo_message_add*().
+ */
+char *lo_message_get_types(lo_message m);
+
+/**
+ * \brief  Return the message argument count.
+ *
+ * The result is valid until further data is added with lo_message_add*().
+ */
+int lo_message_get_argc(lo_message m);
+
+/**
+ * \brief  Return the message arguments. Do not free the returned data.
+ *
+ * The result is valid until further data is added with lo_message_add*().
+ */
+lo_arg **lo_message_get_argv(lo_message m);
+
+/**
+ * \brief  Return the length of a message in bytes.
+ *
+ * \param m The message to be sized
+ * \param path The path the message will be sent to
+ */
+size_t lo_message_length(lo_message m, const char *path);
+
+/**
+ * \brief  Serialise the lo_message object to an area of memory and return a
+ * pointer to the serialised form.  Opposite of lo_message_deserialise().
+ *
+ * \param m The message to be serialised
+ * \param path The path the message will be sent to
+ * \param to The address to serialise to, memory will be allocated if to is
+ * NULL.
+ * \param size If this pointer is non-NULL the size of the memory area
+ * will be written here
+ *
+ * The returned form is suitable to be sent over a low level OSC transport,
+ * having the correct endianess and bit-packed structure.
+ */
+void *lo_message_serialise(lo_message m, const char *path, void *to,
+			   size_t *size);
+
+/**
+ * \brief  Deserialise a raw OSC message and return a new lo_message object.
+ * Opposite of lo_message_serialise().
+ *
+ * \param data Pointer to the raw OSC message data in network transmission form
+ * (network byte order where appropriate).
+ * \param size The size of data in bytes
+ * \param result If this pointer is non-NULL, the result or error code will
+ * be written here.
+ *
+ * Returns a new lo_message, or NULL if deserialisation fails.
+ * Use lo_message_free() to free the resulting object.
+ */
+lo_message lo_message_deserialise(void *data, size_t size, int *result);
+
+/**
+ * \brief  Dispatch a raw block of memory containing an OSC message.
+ *
+ * This is useful when a raw block of memory is available that is
+ * structured as OSC, and you wish to use liblo to dispatch the
+ * message to a handler function as if it had been received over the
+ * network.
+ *
+ * \param s The lo_server to use for dispatching.
+ * \param data Pointer to the raw OSC message data in network transmission form
+ * (network byte order where appropriate).
+ * \param size The size of data in bytes
+ *
+ * Returns the number of bytes used if successful, or less than 0 otherwise.
+ */
+int lo_server_dispatch_data(lo_server s, void *data, size_t size);
+
+/**
+ * \brief  Return the hostname of a lo_address object
+ *
+ * Returned value must not be modified or free'd. Value will be a dotted quad,
+ * colon'd IPV6 address, or resolvable name.
+ */
+const char *lo_address_get_hostname(lo_address a);
+
+/**
+ * \brief  Return the port/service name of a lo_address object
+ *
+ * Returned value must not be modified or free'd. Value will be a service name
+ * or ASCII representation of the port number.
+ */
+const char *lo_address_get_port(lo_address a);
+
+/**
+ * \brief  Return the protocol of a lo_address object
+ *
+ * Returned value will be one of LO_UDP, LO_TCP or LO_UNIX.
+ */
+int lo_address_get_protocol(lo_address a);
+
+/**
+ * \brief  Return a URL representing an OSC address
+ *
+ * Returned value must be free'd.
+ */
+char *lo_address_get_url(lo_address a);
+
+/**
+ * \brief Set the Time-to-Live value for a given target address.
+ * 
+ * This is required for sending multicast UDP messages.  A value of 1
+ * (the usual case) keeps the message within the subnet, while 255
+ * means a global, unrestricted scope.
+ * 
+ * \param t An OSC address.
+ * \param ttl An integer specifying the scope of a multicast UDP message.
+ */ 
+void lo_address_set_ttl(lo_address t, int ttl);
+
+/**
+ * \brief Get the Time-to-Live value for a given target address.
+ * 
+ * \param t An OSC address.
+ * \return An integer specifying the scope of a multicast UDP message.
+ */ 
+int lo_address_get_ttl(lo_address t);
+
+/**
+ * \brief  Create a new bundle object.
+ *
+ * OSC Bundles encapsulate one or more OSC messages and may include a timestamp
+ * indicating when the bundle should be dispatched.
+ *
+ * \param tt The timestamp when the bundle should be handled by the receiver.
+ *           Pass LO_TT_IMMEDIATE if you want the receiving server to dispatch
+ *           the bundle as soon as it receives it.
+ */
+lo_bundle lo_bundle_new(lo_timetag tt);
+
+/**
+ * \brief  Adds an OSC message to an existing bundle.
+ *
+ * The message passed is appended to the list of messages in the bundle to be
+ * dispatched to 'path'.
+ *
+ * \return 0 if successful, less than 0 otherwise.
+ */
+int lo_bundle_add_message(lo_bundle b, const char *path, lo_message m);
+
+/**
+ * \brief  Return the length of a bundle in bytes.
+ *
+ * Includes the marker and typetage length.
+ *
+ * \param b The bundle to be sized
+ */
+size_t lo_bundle_length(lo_bundle b);
+
+/**
+ * \brief  Serialise the bundle object to an area of memory and return a
+ * pointer to the serialised form.
+ *
+ * \param b The bundle to be serialised
+ * \param to The address to serialise to, memory will be allocated if to is
+ * NULL.
+ * \param size If this pointer is non-NULL the size of the memory area
+ * will be written here
+ *
+ * The returned form is suitable to be sent over a low level OSC transport,
+ * having the correct endianess and bit-packed structure.
+ */
+void *lo_bundle_serialise(lo_bundle b, void *to, size_t *size);
+
+/**
+ * \brief  Frees the memory taken by a bundle object.
+ *
+ * \param b The bundle to be freed.
+*/
+void lo_bundle_free(lo_bundle b);
+
+/**
+ * \brief  Frees the memory taken by a bundle object and messages in the bundle.
+ *
+ * \param b The bundle, which may contain messages, to be freed.
+*/
+void lo_bundle_free_messages(lo_bundle b);
+
+/**
+ * \brief Return true if the type specified has a numerical value, such as
+ * LO_INT32, LO_FLOAT etc.
+ *
+ * \param a The type to be tested.
+ */
+int lo_is_numerical_type(lo_type a);
+
+/**
+ * \brief Return true if the type specified has a textual value, such as
+ * LO_STRING or LO_SYMBOL.
+ *
+ * \param a The type to be tested.
+ */
+int lo_is_string_type(lo_type a);
+
+/**
+ * \brief Attempt to convert one OSC type to another.
+ *
+ * Numerical types (eg LO_INT32, LO_FLOAT etc.) may be converted to other
+ * numerical types and string types (LO_STRING and LO_SYMBOL) may be converted
+ * to the other type. This is done automatically if a received message matches
+ * the path, but not the exact types, and is coercible (ie. all numerical
+ * types in numerical positions).
+ *
+ * On failure no translation occurs and false is returned.
+ *
+ * \param type_to   The type of the destination variable.
+ * \param to        A pointer to the destination variable.
+ * \param type_from The type of the source variable.
+ * \param from      A pointer to the source variable.
+ */
+int lo_coerce(lo_type type_to, lo_arg *to, lo_type type_from, lo_arg *from);
+
+/**
+ * \brief Return the numerical value of the given argument with the
+ * maximum native system precision.
+ */
+lo_hires lo_hires_val(lo_type type, lo_arg *p);
+
+/**
+ * \brief Create a new server instance.
+ *
+ * Using lo_server_recv(), lo_servers block until they receive OSC
+ * messages.  If you want non-blocking behaviour see
+ * lo_server_recv_noblock() or the \ref lo_server_thread_new
+ * "lo_server_thread_*" functions.
+ *
+ * \param port If NULL is passed then an unused UDP port will be chosen by the
+ * system, its number may be retrieved with lo_server_thread_get_port()
+ * so it can be passed to clients. Otherwise a decimal port number, service
+ * name or UNIX domain socket path may be passed.
+ * \param err_h An error callback function that will be called if there is an
+ * error in messge reception or server creation. Pass NULL if you do not want
+ * error handling.
+ */
+lo_server lo_server_new(const char *port, lo_err_handler err_h);
+
+/**
+ * \brief Create a new server instance, specifying protocol.
+ *
+ * Using lo_server_recv(), lo_servers block until they receive OSC
+ * messages.  If you want non-blocking behaviour see
+ * lo_server_recv_noblock() or the \ref lo_server_thread_new
+ * "lo_server_thread_*" functions.
+ *
+ * \param port If using UDP then NULL may be passed to find an unused port.
+ * Otherwise a decimal port number orservice name or may be passed.
+ * If using UNIX domain sockets then a socket path should be passed here.
+ * \param proto The protocol to use, should be one of LO_UDP, LO_TCP or LO_UNIX.
+ * \param err_h An error callback function that will be called if there is an
+ * error in messge reception or server creation. Pass NULL if you do not want
+ * error handling.
+ */
+lo_server lo_server_new_with_proto(const char *port, int proto,
+                                   lo_err_handler err_h);
+
+/**
+ * \brief Create a new server instance, and join a UDP multicast group.
+ * 
+ * \param group The multicast group to join.  See documentation on IP
+ * multicast for the acceptable address range; e.g., http://tldp.org/HOWTO/Multicast-HOWTO-2.html
+ * \param port If using UDP then NULL may be passed to find an unused port.
+ * Otherwise a decimal port number or service name or may be passed.
+ * If using UNIX domain sockets then a socket path should be passed here.
+ * \param err_h An error callback function that will be called if there is an
+ * error in messge reception or server creation. Pass NULL if you do not want
+ * error handling.
+ */
+lo_server lo_server_new_multicast(const char *group, const char *port,
+                                  lo_err_handler err_h);
+
+/**
+ * \brief Free up memory used by the lo_server object
+ */
+void lo_server_free(lo_server s);
+
+/**
+ * \brief Wait for an OSC message to be received
+ *
+ * \param s The server to wait for connections on.
+ * \param timeout A timeout in milliseconds to wait for the incoming packet.
+ * a value of 0 will return immediately.
+ *
+ * The return value is 1 if there is a message waiting or 0 if
+ * there is no message. If there is a message waiting you can now
+ * call lo_server_recv() to receive that message.
+ */
+int lo_server_wait(lo_server s, int timeout);
+
+/**
+ * \brief Look for an OSC message waiting to be received
+ *
+ * \param s The server to wait for connections on.
+ * \param timeout A timeout in milliseconds to wait for the incoming packet.
+ * a value of 0 will return immediately.
+ *
+ * The return value is the number of bytes in the received message or 0 if
+ * there is no message. The message will be dispatched to a matching method
+ * if one is found.
+ */
+int lo_server_recv_noblock(lo_server s, int timeout);
+
+/**
+ * \brief Block, waiting for an OSC message to be received
+ *
+ * The return value is the number of bytes in the received message. The message
+ * will be dispatched to a matching method if one is found.
+ */
+int lo_server_recv(lo_server s);
+
+/**
+ * \brief Add an OSC method to the specifed server.
+ *
+ * \param s The server the method is to be added to.
+ * \param path The OSC path to register the method to. If NULL is passed the
+ * method will match all paths.
+ * \param typespec The typespec the method accepts. Incoming messages with
+ * similar typespecs (e.g. ones with numerical types in the same position) will
+ * be coerced to the typespec given here.
+ * \param h The method handler callback function that will be called if a
+ * matching message is received
+ * \param user_data A value that will be passed to the callback function, h,
+ * when its invoked matching from this method.
+ */
+lo_method lo_server_add_method(lo_server s, const char *path,
+                               const char *typespec, lo_method_handler h,
+                               void *user_data);
+
+/**
+ * \brief Delete an OSC method from the specifed server.
+ *
+ * \param s The server the method is to be removed from.
+ * \param path The OSC path of the method to delete. If NULL is passed the
+ * method will match the generic handler.
+ * \param typespec The typespec the method accepts.
+ */
+void lo_server_del_method(lo_server s, const char *path,
+                               const char *typespec);
+
+/**
+ * \brief Return the file descriptor of the server socket.
+ *
+ * If the server protocol supports exposing the server's underlying
+ * receive mechanism for monitoring with select() or poll(), this function
+ * returns the file descriptor needed, otherwise, it returns -1.
+ *
+ * WARNING: when using this function beware that not all OSC packets that are
+ * received are dispatched immediately. lo_server_events_pending() and
+ * lo_server_next_event_delay() can be used to tell if there are pending
+ * events and how long before you should attempt to receive them.
+ */
+int lo_server_get_socket_fd(lo_server s);
+
+/**
+ * \brief Return the port number that the server has bound to.
+ *
+ * Useful when NULL is passed for the port number and you wish to know how to
+ * address the server.
+ */
+int lo_server_get_port(lo_server s);
+
+/**
+ * \brief  Return the protocol that the server is using.
+ *
+ * Returned value will be one of LO_UDP, LO_TCP or LO_UNIX.
+ */
+int lo_server_get_protocol(lo_server s);
+
+/**
+ * \brief Return an OSC URL that can be used to contact the server.
+ *
+ * The return value should be free()'d when it is no longer needed.
+ */
+char *lo_server_get_url(lo_server s);
+
+/** 
+ * \brief Return true if there are scheduled events (eg. from bundles) 
+ * waiting to be dispatched by the server
+ */
+int lo_server_events_pending(lo_server s);
+
+/** 
+ * \brief Return the time in seconds until the next scheduled event.
+ *
+ * If the delay is greater than 100 seconds then it will return 100.0.
+ */
+double lo_server_next_event_delay(lo_server s);
+
+/**
+ * \brief Return the protocol portion of an OSC URL, eg. udp, tcp.
+ *
+ * This library uses OSC URLs of the form: osc.prot://hostname:port/path if the
+ * prot part is missing, UDP is assumed.
+ *
+ * The return value should be free()'d when it is no longer needed.
+ */
+char *lo_url_get_protocol(const char *url);
+
+/**
+ * \brief Return the protocol ID of an OSC URL.
+ *
+ * This library uses OSC URLs of the form: osc.prot://hostname:port/path if the
+ * prot part is missing, UDP is assumed.
+ * Returned value will be one of LO_UDP, LO_TCP, LO_UNIX or -1.
+ *
+ * \return An integer specifying the protocol. Return -1 when the protocol is
+ * not supported by liblo.
+ *
+ */
+int lo_url_get_protocol_id(const char *url);
+
+/**
+ * \brief Return the hostname portion of an OSC URL.
+ *
+ * The return value should be free()'d when it is no longer needed.
+ */
+char *lo_url_get_hostname(const char *url);
+
+/**
+ * \brief Return the port portion of an OSC URL.
+ *
+ * The return value should be free()'d when it is no longer needed.
+ */
+char *lo_url_get_port(const char *url);
+
+/**
+ * \brief Return the path portion of an OSC URL.
+ *
+ * The return value should be free()'d when it is no longer needed.
+ */
+char *lo_url_get_path(const char *url);
+
+/* utility functions */
+
+/**
+ * \brief A function to calculate the amount of OSC message space required by a
+ * C char *.
+ *
+ * Returns the storage size in bytes, which will always be a multiple of four.
+ */
+int lo_strsize(const char *s);
+
+/**
+ * \brief A function to calculate the amount of OSC message space required by a
+ * lo_blob object.
+ *
+ * Returns the storage size in bytes, which will always be a multiple of four.
+ */
+uint32_t lo_blobsize(lo_blob b);
+
+/**
+ * \brief Test a string against an OSC pattern glob
+ *
+ * \param str The string to test
+ * \param p   The pattern to test against
+ */
+int lo_pattern_match(const char *str, const char *p);
+
+/** \internal \brief the real send function (don't call directly) */
+int lo_send_internal(lo_address t, const char *file, const int line,
+     const char *path, const char *types, ...);
+/** \internal \brief the real send_timestamped function (don't call directly) */
+int lo_send_timestamped_internal(lo_address t, const char *file, const int line,
+     lo_timetag ts, const char *path, const char *types, ...);
+/** \internal \brief the real lo_send_from() function (don't call directly) */
+int lo_send_from_internal(lo_address targ, lo_server from, const char *file, 
+     const int line, const lo_timetag ts, 
+     const char *path, const char *types, ...);
+
+
+/** \brief Find the time difference between two timetags
+ *
+ * Returns a - b in seconds.
+ */
+double lo_timetag_diff(lo_timetag a, lo_timetag b);
+
+/** \brief Return a timetag for the current time
+ *
+ * On exit the timetag pointed to by t is filled with the OSC
+ * representation of this instant in time.
+ */
+void lo_timetag_now(lo_timetag *t);
+
+/**
+ * \brief Return the storage size, in bytes, of the given argument.
+ */
+size_t lo_arg_size(lo_type type, void *data);
+
+/**
+ * \brief Given a raw OSC message, return the message path.
+ *
+ * \param data      A pointer to the raw OSC message data.
+ * \param size      The size of data in bytes (total buffer bytes).
+ *
+ * Returns the message path or NULL if an error occurs.
+ * Do not free() the returned pointer.
+ */
+char *lo_get_path(void *data, ssize_t size);
+
+/**
+ * \brief Convert the specified argument to host byte order where necessary.
+ *
+ * \param type The OSC type of the data item (eg. LO_FLOAT).
+ * \param data A pointer to the data item to be converted. It is changed
+ * in-place.
+ */
+void lo_arg_host_endian(lo_type type, void *data);
+
+/**
+ * \brief Convert the specified argument to network byte order where necessary.
+ *
+ * \param type The OSC type of the data item (eg. LO_FLOAT).
+ * \param data A pointer to the data item to be converted. It is changed
+ * in-place.
+ */
+void lo_arg_network_endian(lo_type type, void *data);
+
+/** @} */
+
+/* prettyprinters */
+
+/**
+ * \defgroup pp Prettyprinting functions
+ *
+ * These functions all print an ASCII representation of their argument to
+ * stdout. Useful for debugging.
+ * @{
+ */
+
+/** \brief Pretty-print a lo_bundle object. */
+void lo_bundle_pp(lo_bundle b);
+
+/** \brief Pretty-print a lo_message object. */
+void lo_message_pp(lo_message m);
+
+/** \brief Pretty-print a set of typed arguments.
+ * \param type A type string in the form provided to lo_send().
+ * \param data An OSC data pointer, like that provided in the
+ * lo_method_handler.
+ */
+void lo_arg_pp(lo_type type, void *data);
+
+/** \brief Pretty-print a lo_server object. */
+void lo_server_pp(lo_server s);
+
+/** \brief Pretty-print a lo_method object. */
+void lo_method_pp(lo_method m);
+
+/** \brief Pretty-print a lo_method object, but prepend a given prefix
+ * to all field names. */
+void lo_method_pp_prefix(lo_method m, const char *p);
+
+/** \brief Pretty-print a lo_server_thread object. */
+void lo_server_thread_pp(lo_server_thread st);
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/osx/include/lo/lo_macros.h	Fri Jul 04 10:37:37 2014 +0100
@@ -0,0 +1,80 @@
+/*
+ *  Copyright (C) 2004 Steve Harris
+ *
+ *  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_MACROS_H
+#define LO_MACROS_H
+
+/* macros that have to be defined after function signatures */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* \brief Maximum length of UDP messages in bytes
+ */
+#define LO_MAX_MSG_SIZE 32768
+
+/* \brief A set of macros to represent different communications transports
+ */
+#define LO_DEFAULT 0x0
+#define LO_UDP     0x1
+#define LO_UNIX    0x2
+#define LO_TCP     0x4
+
+/* an internal value, ignored in transmission but check against LO_MARKER in the
+ * argument list. Used to do primitive bounds checking */
+#define LO_MARKER_A 0xdeadbeef
+#define LO_MARKER_B 0xf00baa23
+#define LO_ARGS_END LO_MARKER_A, LO_MARKER_B
+
+#define lo_message_add_varargs(msg, types, list) \
+    lo_message_add_varargs_internal(msg, types, list, __FILE__, __LINE__)
+
+#ifdef __GNUC__
+
+#define lo_message_add(msg, types...)                         \
+    lo_message_add_internal(msg, __FILE__, __LINE__, types,   \
+                            LO_MARKER_A, LO_MARKER_B)
+
+#define lo_send(targ, path, types...) \
+        lo_send_internal(targ, __FILE__, __LINE__, path, types, \
+			 LO_MARKER_A, LO_MARKER_B)
+
+#define lo_send_timestamped(targ, ts, path, types...) \
+        lo_send_timestamped_internal(targ, __FILE__, __LINE__, ts, path, \
+		       	             types, LO_MARKER_A, LO_MARKER_B)
+
+#define lo_send_from(targ, from, ts, path, types...) \
+        lo_send_from_internal(targ, from, __FILE__, __LINE__, ts, path, \
+		       	             types, LO_MARKER_A, LO_MARKER_B)
+
+#else
+
+/* In non-GCC compilers, there is no support for variable-argument
+ * macros, so provide "internal" vararg functions directly instead. */
+
+int lo_message_add(lo_message msg, const char *types, ...);
+int lo_send(lo_address targ, const char *path, const char *types, ...);
+int lo_send_timestamped(lo_address targ, lo_timetag ts, const char *path, const char *types, ...);
+int lo_send_from(lo_address targ, lo_server from, lo_timetag ts, const char *path, const char *types, ...);
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/osx/include/lo/lo_osc_types.h	Fri Jul 04 10:37:37 2014 +0100
@@ -0,0 +1,141 @@
+/*
+ *  Copyright (C) 2004 Steve Harris
+ *
+ *  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
+
+/**
+ * \file lo_osc_types.h A liblo header defining OSC-related types and
+ * constants.
+ */
+
+#ifdef _MSC_VER
+#define int32_t __int32
+#define int64_t __int64
+#define uint32_t unsigned __int32
+#define uint64_t unsigned __int64
+#define uint8_t unsigned __int8
+#else
+#include <stdint.h>
+#endif
+
+/**
+ * \addtogroup liblo
+ * @{
+ */
+
+/**
+ * \brief A structure to store OSC TimeTag values.
+ */
+typedef struct {
+	/** The number of seconds since Jan 1st 1900 in the UTC timezone. */
+	uint32_t sec;
+	/** The fractions of a second offset from above, expressed as 1/2^32nds
+         * of a second */
+	uint32_t frac;
+} lo_timetag;
+
+/**
+ * \brief An enumeration of the OSC types liblo can send and receive.
+ *
+ * The value of the enumeration is the typechar used to tag messages and to
+ * specify arguments with lo_send().
+ */
+typedef enum {
+/* basic OSC types */
+	/** 32 bit signed integer. */
+	LO_INT32 =     'i',
+	/** 32 bit IEEE-754 float. */
+	LO_FLOAT =     'f',
+	/** Standard C, NULL terminated string. */
+	LO_STRING =    's',
+	/** OSC binary blob type. Accessed using the lo_blob_*() functions. */
+	LO_BLOB =      'b',
+
+/* extended OSC types */
+	/** 64 bit signed integer. */
+	LO_INT64 =     'h',
+	/** OSC TimeTag type, represented by the lo_timetag structure. */
+	LO_TIMETAG =   't',
+	/** 64 bit IEEE-754 double. */
+	LO_DOUBLE =    'd',
+	/** Standard C, NULL terminated, string. Used in systems which
+	  * distinguish strings and symbols. */
+	LO_SYMBOL =    'S',
+	/** Standard C, 8 bit, char variable. */
+	LO_CHAR =      'c',
+	/** A 4 byte MIDI packet. */
+	LO_MIDI =      'm',
+	/** Sybol representing the value True. */
+	LO_TRUE =      'T',
+	/** Sybol representing the value False. */
+	LO_FALSE =     'F',
+	/** Sybol representing the value Nil. */
+	LO_NIL =       'N',
+	/** Sybol representing the value Infinitum. */
+	LO_INFINITUM = 'I'
+} lo_type;
+
+
+/**
+ * \brief Union used to read values from incoming messages.
+ *
+ * Types can generally be read using argv[n]->t where n is the argument number
+ * and t is the type character, with the exception of strings and symbols which
+ * must be read with &argv[n]->t.
+ */
+typedef union {
+	/** 32 bit signed integer. */
+    int32_t    i;
+	/** 32 bit signed integer. */
+    int32_t    i32;
+	/** 64 bit signed integer. */
+    int64_t    h;
+	/** 64 bit signed integer. */
+    int64_t    i64;
+	/** 32 bit IEEE-754 float. */
+    float      f;
+	/** 32 bit IEEE-754 float. */
+    float      f32;
+	/** 64 bit IEEE-754 double. */
+    double     d;
+	/** 64 bit IEEE-754 double. */
+    double     f64;
+	/** Standard C, NULL terminated string. */
+    char       s;
+	/** Standard C, NULL terminated, string. Used in systems which
+	  * distinguish strings and symbols. */
+    char       S;
+	/** Standard C, 8 bit, char. */
+    unsigned char c;
+	/** A 4 byte MIDI packet. */
+    uint8_t    m[4];
+	/** OSC TimeTag value. */
+    lo_timetag t;
+} lo_arg;
+
+/** \brief A timetag constant representing "now". */
+/* Note: No struct literals in MSVC */
+#ifdef _MSC_VER
+lo_timetag lo_get_tt_immediate();
+#define LO_TT_IMMEDIATE lo_get_tt_immediate()
+#else
+#define LO_TT_IMMEDIATE ((lo_timetag){0U,1U})
+#endif
+
+/** @} */
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/osx/include/lo/lo_throw.h	Fri Jul 04 10:37:37 2014 +0100
@@ -0,0 +1,30 @@
+/*
+ *  Copyright (C) 2004 Steve Harris
+ *
+ *  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_THROW_H
+#define LO_THROW_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void lo_throw(lo_server s, int errnum, const char *message, const char *path);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/osx/include/lo/lo_types.h	Fri Jul 04 10:37:37 2014 +0100
@@ -0,0 +1,141 @@
+/*
+ *  Copyright (C) 2004 Steve Harris
+ *
+ *  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_TYPES_H
+#define LO_TYPES_H
+
+/**
+ * \file lo_types.h The liblo headerfile defining types used by this API.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#else
+#include <netdb.h>
+#endif
+
+#include <pthread.h>
+
+#include "lo/lo_osc_types.h"
+
+/**
+ * \brief A reference to an OSC service.
+ *
+ * Created by calls to lo_address_new() or lo_address_new_from_url().
+ */
+typedef void *lo_address;
+
+/**
+ * \brief A object to store an opaque binary data object.
+ *
+ * Can be passed over OSC using the 'b' type. Created by calls to lo_blob_new().
+ */
+typedef void *lo_blob;
+
+/**
+ * \brief A low-level object used to represent messages passed over OSC.
+ *
+ * Created by calls to lo_message_new(), arguments can be added with calls to
+ * lo_message_add_*().
+ */
+typedef void *lo_message;
+
+/**
+ * \brief A low-level object used to represent bundles of messages passed over
+ * OSC.
+ *
+ * Created by calls to lo_bundle_new(), messages can be added with calls to
+ * lo_bundle_add_message().
+ */
+typedef void *lo_bundle;
+
+/**
+ * \brief An object representing an method on a server.
+ *
+ * Returned by calls to lo_server_thread_add_method() and
+ * lo_server_add_method().
+ */
+typedef void *lo_method;
+
+/**
+ * \brief An object representing an instance of an OSC server.
+ *
+ * Created by calls to lo_server_new(). If you with the library to take care of
+ * the threading as well you can just use server threads instead.
+ */
+typedef void *lo_server;
+
+/**
+ * \brief An object representing a thread containing an OSC server.
+ *
+ * Created by calls to lo_server_thread_new().
+ */
+typedef void *lo_server_thread;
+
+/**
+ * \brief A callback function to receive notifcation of an error in a server or
+ * server thread.
+ *
+ * On callback the paramters will be set to the following values:
+ *
+ * \param num An error number that can be used to identify this condition.
+ * \param msg An error message describing the condidtion.
+ * \param where A string describing the place the error occured - typically
+ * either a function call or method path.
+ */
+typedef void (*lo_err_handler)(int num, const char *msg, const char *where);
+
+/**
+ * \brief A callback function to receive notifcation of matching message
+ * arriving in the server or server thread.
+ *
+ * The return value tells the method dispatcher whether this handler
+ * has dealt with the message correctly: a return value of 0 indicates
+ * that it has been handled, and it should not attempt to pass it on
+ * to any other handlers, non-0 means that it has not been handled and
+ * the dispatcher will attempt to find more handlers that match the
+ * path and types of the incoming message.
+ *
+ * On callback the paramters will be set to the following values:
+ *
+ * \param path That path that the incoming message was sent to
+ * \param types If you specided types in your method creation call then this
+ * will match those and the incoming types will have been coerced to match,
+ * otherwise it will be the types of the arguments of the incoming message.
+ * \param argv An array of lo_arg types containing the values, e.g. if the
+ * first argument of the incoming message is of type 'f' then the vlaue will be
+ * found in argv[0]->f.
+ * \param argc The number of argumets received.
+ * \param msg A structure containing the original raw message as received. No
+ * type coercion will have occured and the data will be in OSC byte order
+ * (bigendian).
+ * \param user_data This contains the user_data value passed in the call to
+ * lo_server_thread_add_method.
+ */
+typedef int (*lo_method_handler)(const char *path, const char *types,
+				 lo_arg **argv, int argc, lo_message msg,
+				 void *user_data);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/osx/include/portaudio.h	Fri Jul 04 10:37:37 2014 +0100
@@ -0,0 +1,1149 @@
+#ifndef PORTAUDIO_H
+#define PORTAUDIO_H
+/*
+ * $Id: portaudio.h 1594 2011-02-05 14:33:29Z rossb $
+ * PortAudio Portable Real-Time Audio Library
+ * PortAudio API Header File
+ * Latest version available at: http://www.portaudio.com/
+ *
+ * Copyright (c) 1999-2002 Ross Bencina and Phil Burk
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+ * The text above constitutes the entire PortAudio license; however, 
+ * the PortAudio community also makes the following non-binding requests:
+ *
+ * Any person wishing to distribute modifications to the Software is
+ * requested to send the modifications to the original developer so that
+ * they can be incorporated into the canonical version. It is also 
+ * requested that these non-binding requests be included along with the 
+ * license above.
+ */
+
+/** @file
+ @ingroup public_header
+ @brief The portable PortAudio API.
+*/
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+ 
+/** Retrieve the release number of the currently running PortAudio build,
+ eg 1900.
+*/
+int Pa_GetVersion( void );
+
+
+/** Retrieve a textual description of the current PortAudio build,
+ eg "PortAudio V19-devel 13 October 2002".
+*/
+const char* Pa_GetVersionText( void );
+
+
+/** Error codes returned by PortAudio functions.
+ Note that with the exception of paNoError, all PaErrorCodes are negative.
+*/
+
+typedef int PaError;
+typedef enum PaErrorCode
+{
+    paNoError = 0,
+
+    paNotInitialized = -10000,
+    paUnanticipatedHostError,
+    paInvalidChannelCount,
+    paInvalidSampleRate,
+    paInvalidDevice,
+    paInvalidFlag,
+    paSampleFormatNotSupported,
+    paBadIODeviceCombination,
+    paInsufficientMemory,
+    paBufferTooBig,
+    paBufferTooSmall,
+    paNullCallback,
+    paBadStreamPtr,
+    paTimedOut,
+    paInternalError,
+    paDeviceUnavailable,
+    paIncompatibleHostApiSpecificStreamInfo,
+    paStreamIsStopped,
+    paStreamIsNotStopped,
+    paInputOverflowed,
+    paOutputUnderflowed,
+    paHostApiNotFound,
+    paInvalidHostApi,
+    paCanNotReadFromACallbackStream,
+    paCanNotWriteToACallbackStream,
+    paCanNotReadFromAnOutputOnlyStream,
+    paCanNotWriteToAnInputOnlyStream,
+    paIncompatibleStreamHostApi,
+    paBadBufferPtr
+} PaErrorCode;
+
+
+/** Translate the supplied PortAudio error code into a human readable
+ message.
+*/
+const char *Pa_GetErrorText( PaError errorCode );
+
+
+/** Library initialization function - call this before using PortAudio.
+ This function initializes internal data structures and prepares underlying
+ host APIs for use.  With the exception of Pa_GetVersion(), Pa_GetVersionText(),
+ and Pa_GetErrorText(), this function MUST be called before using any other
+ PortAudio API functions.
+
+ If Pa_Initialize() is called multiple times, each successful 
+ call must be matched with a corresponding call to Pa_Terminate(). 
+ Pairs of calls to Pa_Initialize()/Pa_Terminate() may overlap, and are not 
+ required to be fully nested.
+
+ Note that if Pa_Initialize() returns an error code, Pa_Terminate() should
+ NOT be called.
+
+ @return paNoError if successful, otherwise an error code indicating the cause
+ of failure.
+
+ @see Pa_Terminate
+*/
+PaError Pa_Initialize( void );
+
+
+/** Library termination function - call this when finished using PortAudio.
+ This function deallocates all resources allocated by PortAudio since it was
+ initialized by a call to Pa_Initialize(). In cases where Pa_Initialise() has
+ been called multiple times, each call must be matched with a corresponding call
+ to Pa_Terminate(). The final matching call to Pa_Terminate() will automatically
+ close any PortAudio streams that are still open.
+
+ Pa_Terminate() MUST be called before exiting a program which uses PortAudio.
+ Failure to do so may result in serious resource leaks, such as audio devices
+ not being available until the next reboot.
+
+ @return paNoError if successful, otherwise an error code indicating the cause
+ of failure.
+ 
+ @see Pa_Initialize
+*/
+PaError Pa_Terminate( void );
+
+
+
+/** The type used to refer to audio devices. Values of this type usually
+ range from 0 to (Pa_GetDeviceCount()-1), and may also take on the PaNoDevice
+ and paUseHostApiSpecificDeviceSpecification values.
+
+ @see Pa_GetDeviceCount, paNoDevice, paUseHostApiSpecificDeviceSpecification
+*/
+typedef int PaDeviceIndex;
+
+
+/** A special PaDeviceIndex value indicating that no device is available,
+ or should be used.
+
+ @see PaDeviceIndex
+*/
+#define paNoDevice ((PaDeviceIndex)-1)
+
+
+/** A special PaDeviceIndex value indicating that the device(s) to be used
+ are specified in the host api specific stream info structure.
+
+ @see PaDeviceIndex
+*/
+#define paUseHostApiSpecificDeviceSpecification ((PaDeviceIndex)-2)
+
+
+/* Host API enumeration mechanism */
+
+/** The type used to enumerate to host APIs at runtime. Values of this type
+ range from 0 to (Pa_GetHostApiCount()-1).
+
+ @see Pa_GetHostApiCount
+*/
+typedef int PaHostApiIndex;
+
+
+/** Retrieve the number of available host APIs. Even if a host API is
+ available it may have no devices available.
+
+ @return A non-negative value indicating the number of available host APIs
+ or, a PaErrorCode (which are always negative) if PortAudio is not initialized
+ or an error is encountered.
+
+ @see PaHostApiIndex
+*/
+PaHostApiIndex Pa_GetHostApiCount( void );
+
+
+/** Retrieve the index of the default host API. The default host API will be
+ the lowest common denominator host API on the current platform and is
+ unlikely to provide the best performance.
+
+ @return A non-negative value ranging from 0 to (Pa_GetHostApiCount()-1)
+ indicating the default host API index or, a PaErrorCode (which are always
+ negative) if PortAudio is not initialized or an error is encountered.
+*/
+PaHostApiIndex Pa_GetDefaultHostApi( void );
+
+
+/** Unchanging unique identifiers for each supported host API. This type
+ is used in the PaHostApiInfo structure. The values are guaranteed to be
+ unique and to never change, thus allowing code to be written that
+ conditionally uses host API specific extensions.
+
+ New type ids will be allocated when support for a host API reaches
+ "public alpha" status, prior to that developers should use the
+ paInDevelopment type id.
+
+ @see PaHostApiInfo
+*/
+typedef enum PaHostApiTypeId
+{
+    paInDevelopment=0, /* use while developing support for a new host API */
+    paDirectSound=1,
+    paMME=2,
+    paASIO=3,
+    paSoundManager=4,
+    paCoreAudio=5,
+    paOSS=7,
+    paALSA=8,
+    paAL=9,
+    paBeOS=10,
+    paWDMKS=11,
+    paJACK=12,
+    paWASAPI=13,
+    paAudioScienceHPI=14
+} PaHostApiTypeId;
+
+
+/** A structure containing information about a particular host API. */
+
+typedef struct PaHostApiInfo
+{
+    /** this is struct version 1 */
+    int structVersion;
+    /** The well known unique identifier of this host API @see PaHostApiTypeId */
+    PaHostApiTypeId type;
+    /** A textual description of the host API for display on user interfaces. */
+    const char *name;
+
+    /**  The number of devices belonging to this host API. This field may be
+     used in conjunction with Pa_HostApiDeviceIndexToDeviceIndex() to enumerate
+     all devices for this host API.
+     @see Pa_HostApiDeviceIndexToDeviceIndex
+    */
+    int deviceCount;
+
+    /** The default input device for this host API. The value will be a
+     device index ranging from 0 to (Pa_GetDeviceCount()-1), or paNoDevice
+     if no default input device is available.
+    */
+    PaDeviceIndex defaultInputDevice;
+
+    /** The default output device for this host API. The value will be a
+     device index ranging from 0 to (Pa_GetDeviceCount()-1), or paNoDevice
+     if no default output device is available.
+    */
+    PaDeviceIndex defaultOutputDevice;
+    
+} PaHostApiInfo;
+
+
+/** Retrieve a pointer to a structure containing information about a specific
+ host Api.
+
+ @param hostApi A valid host API index ranging from 0 to (Pa_GetHostApiCount()-1)
+
+ @return A pointer to an immutable PaHostApiInfo structure describing
+ a specific host API. If the hostApi parameter is out of range or an error
+ is encountered, the function returns NULL.
+
+ The returned structure is owned by the PortAudio implementation and must not
+ be manipulated or freed. The pointer is only guaranteed to be valid between
+ calls to Pa_Initialize() and Pa_Terminate().
+*/
+const PaHostApiInfo * Pa_GetHostApiInfo( PaHostApiIndex hostApi );
+
+
+/** Convert a static host API unique identifier, into a runtime
+ host API index.
+
+ @param type A unique host API identifier belonging to the PaHostApiTypeId
+ enumeration.
+
+ @return A valid PaHostApiIndex ranging from 0 to (Pa_GetHostApiCount()-1) or,
+ a PaErrorCode (which are always negative) if PortAudio is not initialized
+ or an error is encountered.
+ 
+ The paHostApiNotFound error code indicates that the host API specified by the
+ type parameter is not available.
+
+ @see PaHostApiTypeId
+*/
+PaHostApiIndex Pa_HostApiTypeIdToHostApiIndex( PaHostApiTypeId type );
+
+
+/** Convert a host-API-specific device index to standard PortAudio device index.
+ This function may be used in conjunction with the deviceCount field of
+ PaHostApiInfo to enumerate all devices for the specified host API.
+
+ @param hostApi A valid host API index ranging from 0 to (Pa_GetHostApiCount()-1)
+
+ @param hostApiDeviceIndex A valid per-host device index in the range
+ 0 to (Pa_GetHostApiInfo(hostApi)->deviceCount-1)
+
+ @return A non-negative PaDeviceIndex ranging from 0 to (Pa_GetDeviceCount()-1)
+ or, a PaErrorCode (which are always negative) if PortAudio is not initialized
+ or an error is encountered.
+
+ A paInvalidHostApi error code indicates that the host API index specified by
+ the hostApi parameter is out of range.
+
+ A paInvalidDevice error code indicates that the hostApiDeviceIndex parameter
+ is out of range.
+ 
+ @see PaHostApiInfo
+*/
+PaDeviceIndex Pa_HostApiDeviceIndexToDeviceIndex( PaHostApiIndex hostApi,
+        int hostApiDeviceIndex );
+
+
+
+/** Structure used to return information about a host error condition.
+*/
+typedef struct PaHostErrorInfo{
+    PaHostApiTypeId hostApiType;    /**< the host API which returned the error code */
+    long errorCode;                 /**< the error code returned */
+    const char *errorText;          /**< a textual description of the error if available, otherwise a zero-length string */
+}PaHostErrorInfo;
+
+
+/** Return information about the last host error encountered. The error
+ information returned by Pa_GetLastHostErrorInfo() will never be modified
+ asynchronously by errors occurring in other PortAudio owned threads
+ (such as the thread that manages the stream callback.)
+
+ This function is provided as a last resort, primarily to enhance debugging
+ by providing clients with access to all available error information.
+
+ @return A pointer to an immutable structure constraining information about
+ the host error. The values in this structure will only be valid if a
+ PortAudio function has previously returned the paUnanticipatedHostError
+ error code.
+*/
+const PaHostErrorInfo* Pa_GetLastHostErrorInfo( void );
+
+
+
+/* Device enumeration and capabilities */
+
+/** Retrieve the number of available devices. The number of available devices
+ may be zero.
+
+ @return A non-negative value indicating the number of available devices or,
+ a PaErrorCode (which are always negative) if PortAudio is not initialized
+ or an error is encountered.
+*/
+PaDeviceIndex Pa_GetDeviceCount( void );
+
+
+/** Retrieve the index of the default input device. The result can be
+ used in the inputDevice parameter to Pa_OpenStream().
+
+ @return The default input device index for the default host API, or paNoDevice
+ if no default input device is available or an error was encountered.
+*/
+PaDeviceIndex Pa_GetDefaultInputDevice( void );
+
+
+/** Retrieve the index of the default output device. The result can be
+ used in the outputDevice parameter to Pa_OpenStream().
+
+ @return The default output device index for the default host API, or paNoDevice
+ if no default output device is available or an error was encountered.
+
+ @note
+ On the PC, the user can specify a default device by
+ setting an environment variable. For example, to use device #1.
+<pre>
+ set PA_RECOMMENDED_OUTPUT_DEVICE=1
+</pre>
+ The user should first determine the available device ids by using
+ the supplied application "pa_devs".
+*/
+PaDeviceIndex Pa_GetDefaultOutputDevice( void );
+
+
+/** The type used to represent monotonic time in seconds. PaTime is 
+ used for the fields of the PaStreamCallbackTimeInfo argument to the 
+ PaStreamCallback and as the result of Pa_GetStreamTime().
+
+ PaTime values have unspecified origin.
+     
+ @see PaStreamCallback, PaStreamCallbackTimeInfo, Pa_GetStreamTime
+*/
+typedef double PaTime;
+
+
+/** A type used to specify one or more sample formats. Each value indicates
+ a possible format for sound data passed to and from the stream callback,
+ Pa_ReadStream and Pa_WriteStream.
+
+ The standard formats paFloat32, paInt16, paInt32, paInt24, paInt8
+ and aUInt8 are usually implemented by all implementations.
+
+ The floating point representation (paFloat32) uses +1.0 and -1.0 as the
+ maximum and minimum respectively.
+
+ paUInt8 is an unsigned 8 bit format where 128 is considered "ground"
+
+ The paNonInterleaved flag indicates that audio data is passed as an array 
+ of pointers to separate buffers, one buffer for each channel. Usually,
+ when this flag is not used, audio data is passed as a single buffer with
+ all channels interleaved.
+
+ @see Pa_OpenStream, Pa_OpenDefaultStream, PaDeviceInfo
+ @see paFloat32, paInt16, paInt32, paInt24, paInt8
+ @see paUInt8, paCustomFormat, paNonInterleaved
+*/
+typedef unsigned long PaSampleFormat;
+
+
+#define paFloat32        ((PaSampleFormat) 0x00000001) /**< @see PaSampleFormat */
+#define paInt32          ((PaSampleFormat) 0x00000002) /**< @see PaSampleFormat */
+#define paInt24          ((PaSampleFormat) 0x00000004) /**< Packed 24 bit format. @see PaSampleFormat */
+#define paInt16          ((PaSampleFormat) 0x00000008) /**< @see PaSampleFormat */
+#define paInt8           ((PaSampleFormat) 0x00000010) /**< @see PaSampleFormat */
+#define paUInt8          ((PaSampleFormat) 0x00000020) /**< @see PaSampleFormat */
+#define paCustomFormat   ((PaSampleFormat) 0x00010000) /**< @see PaSampleFormat */
+
+#define paNonInterleaved ((PaSampleFormat) 0x80000000) /**< @see PaSampleFormat */
+
+/** A structure providing information and capabilities of PortAudio devices.
+ Devices may support input, output or both input and output.
+*/
+typedef struct PaDeviceInfo
+{
+    int structVersion;  /* this is struct version 2 */
+    const char *name;
+    PaHostApiIndex hostApi; /* note this is a host API index, not a type id*/
+    
+    int maxInputChannels;
+    int maxOutputChannels;
+
+    /* Default latency values for interactive performance. */
+    PaTime defaultLowInputLatency;
+    PaTime defaultLowOutputLatency;
+    /* Default latency values for robust non-interactive applications (eg. playing sound files). */
+    PaTime defaultHighInputLatency;
+    PaTime defaultHighOutputLatency;
+
+    double defaultSampleRate;
+} PaDeviceInfo;
+
+
+/** Retrieve a pointer to a PaDeviceInfo structure containing information
+ about the specified device.
+ @return A pointer to an immutable PaDeviceInfo structure. If the device
+ parameter is out of range the function returns NULL.
+
+ @param device A valid device index in the range 0 to (Pa_GetDeviceCount()-1)
+
+ @note PortAudio manages the memory referenced by the returned pointer,
+ the client must not manipulate or free the memory. The pointer is only
+ guaranteed to be valid between calls to Pa_Initialize() and Pa_Terminate().
+
+ @see PaDeviceInfo, PaDeviceIndex
+*/
+const PaDeviceInfo* Pa_GetDeviceInfo( PaDeviceIndex device );
+
+
+/** Parameters for one direction (input or output) of a stream.
+*/
+typedef struct PaStreamParameters
+{
+    /** A valid device index in the range 0 to (Pa_GetDeviceCount()-1)
+     specifying the device to be used or the special constant
+     paUseHostApiSpecificDeviceSpecification which indicates that the actual
+     device(s) to use are specified in hostApiSpecificStreamInfo.
+     This field must not be set to paNoDevice.
+    */
+    PaDeviceIndex device;
+    
+    /** The number of channels of sound to be delivered to the
+     stream callback or accessed by Pa_ReadStream() or Pa_WriteStream().
+     It can range from 1 to the value of maxInputChannels in the
+     PaDeviceInfo record for the device specified by the device parameter.
+    */
+    int channelCount;
+
+    /** The sample format of the buffer provided to the stream callback,
+     a_ReadStream() or Pa_WriteStream(). It may be any of the formats described
+     by the PaSampleFormat enumeration.
+    */
+    PaSampleFormat sampleFormat;
+
+    /** The desired latency in seconds. Where practical, implementations should
+     configure their latency based on these parameters, otherwise they may
+     choose the closest viable latency instead. Unless the suggested latency
+     is greater than the absolute upper limit for the device implementations
+     should round the suggestedLatency up to the next practical value - ie to
+     provide an equal or higher latency than suggestedLatency wherever possible.
+     Actual latency values for an open stream may be retrieved using the
+     inputLatency and outputLatency fields of the PaStreamInfo structure
+     returned by Pa_GetStreamInfo().
+     @see default*Latency in PaDeviceInfo, *Latency in PaStreamInfo
+    */
+    PaTime suggestedLatency;
+
+    /** An optional pointer to a host api specific data structure
+     containing additional information for device setup and/or stream processing.
+     hostApiSpecificStreamInfo is never required for correct operation,
+     if not used it should be set to NULL.
+    */
+    void *hostApiSpecificStreamInfo;
+
+} PaStreamParameters;
+
+
+/** Return code for Pa_IsFormatSupported indicating success. */
+#define paFormatIsSupported (0)
+
+/** Determine whether it would be possible to open a stream with the specified
+ parameters.
+
+ @param inputParameters A structure that describes the input parameters used to
+ open a stream. The suggestedLatency field is ignored. See PaStreamParameters
+ for a description of these parameters. inputParameters must be NULL for
+ output-only streams.
+
+ @param outputParameters A structure that describes the output parameters used
+ to open a stream. The suggestedLatency field is ignored. See PaStreamParameters
+ for a description of these parameters. outputParameters must be NULL for
+ input-only streams.
+
+ @param sampleRate The required sampleRate. For full-duplex streams it is the
+ sample rate for both input and output
+
+ @return Returns 0 if the format is supported, and an error code indicating why
+ the format is not supported otherwise. The constant paFormatIsSupported is
+ provided to compare with the return value for success.
+
+ @see paFormatIsSupported, PaStreamParameters
+*/
+PaError Pa_IsFormatSupported( const PaStreamParameters *inputParameters,
+                              const PaStreamParameters *outputParameters,
+                              double sampleRate );
+
+
+
+/* Streaming types and functions */
+
+
+/**
+ A single PaStream can provide multiple channels of real-time
+ streaming audio input and output to a client application. A stream
+ provides access to audio hardware represented by one or more
+ PaDevices. Depending on the underlying Host API, it may be possible 
+ to open multiple streams using the same device, however this behavior 
+ is implementation defined. Portable applications should assume that 
+ a PaDevice may be simultaneously used by at most one PaStream.
+
+ Pointers to PaStream objects are passed between PortAudio functions that
+ operate on streams.
+
+ @see Pa_OpenStream, Pa_OpenDefaultStream, Pa_OpenDefaultStream, Pa_CloseStream,
+ Pa_StartStream, Pa_StopStream, Pa_AbortStream, Pa_IsStreamActive,
+ Pa_GetStreamTime, Pa_GetStreamCpuLoad
+
+*/
+typedef void PaStream;
+
+
+/** Can be passed as the framesPerBuffer parameter to Pa_OpenStream()
+ or Pa_OpenDefaultStream() to indicate that the stream callback will
+ accept buffers of any size.
+*/
+#define paFramesPerBufferUnspecified  (0)
+
+
+/** Flags used to control the behavior of a stream. They are passed as
+ parameters to Pa_OpenStream or Pa_OpenDefaultStream. Multiple flags may be
+ ORed together.
+
+ @see Pa_OpenStream, Pa_OpenDefaultStream
+ @see paNoFlag, paClipOff, paDitherOff, paNeverDropInput,
+  paPrimeOutputBuffersUsingStreamCallback, paPlatformSpecificFlags
+*/
+typedef unsigned long PaStreamFlags;
+
+/** @see PaStreamFlags */
+#define   paNoFlag          ((PaStreamFlags) 0)
+
+/** Disable default clipping of out of range samples.
+ @see PaStreamFlags
+*/
+#define   paClipOff         ((PaStreamFlags) 0x00000001)
+
+/** Disable default dithering.
+ @see PaStreamFlags
+*/
+#define   paDitherOff       ((PaStreamFlags) 0x00000002)
+
+/** Flag requests that where possible a full duplex stream will not discard
+ overflowed input samples without calling the stream callback. This flag is
+ only valid for full duplex callback streams and only when used in combination
+ with the paFramesPerBufferUnspecified (0) framesPerBuffer parameter. Using
+ this flag incorrectly results in a paInvalidFlag error being returned from
+ Pa_OpenStream and Pa_OpenDefaultStream.
+
+ @see PaStreamFlags, paFramesPerBufferUnspecified
+*/
+#define   paNeverDropInput  ((PaStreamFlags) 0x00000004)
+
+/** Call the stream callback to fill initial output buffers, rather than the
+ default behavior of priming the buffers with zeros (silence). This flag has
+ no effect for input-only and blocking read/write streams.
+ 
+ @see PaStreamFlags
+*/
+#define   paPrimeOutputBuffersUsingStreamCallback ((PaStreamFlags) 0x00000008)
+
+/** A mask specifying the platform specific bits.
+ @see PaStreamFlags
+*/
+#define   paPlatformSpecificFlags ((PaStreamFlags)0xFFFF0000)
+
+/**
+ Timing information for the buffers passed to the stream callback.
+*/
+typedef struct PaStreamCallbackTimeInfo{
+    PaTime inputBufferAdcTime;
+    PaTime currentTime;
+    PaTime outputBufferDacTime;
+} PaStreamCallbackTimeInfo;
+
+
+/**
+ Flag bit constants for the statusFlags to PaStreamCallback.
+
+ @see paInputUnderflow, paInputOverflow, paOutputUnderflow, paOutputOverflow,
+ paPrimingOutput
+*/
+typedef unsigned long PaStreamCallbackFlags;
+
+/** In a stream opened with paFramesPerBufferUnspecified, indicates that
+ input data is all silence (zeros) because no real data is available. In a
+ stream opened without paFramesPerBufferUnspecified, it indicates that one or
+ more zero samples have been inserted into the input buffer to compensate
+ for an input underflow.
+ @see PaStreamCallbackFlags
+*/
+#define paInputUnderflow   ((PaStreamCallbackFlags) 0x00000001)
+
+/** In a stream opened with paFramesPerBufferUnspecified, indicates that data
+ prior to the first sample of the input buffer was discarded due to an
+ overflow, possibly because the stream callback is using too much CPU time.
+ Otherwise indicates that data prior to one or more samples in the
+ input buffer was discarded.
+ @see PaStreamCallbackFlags
+*/
+#define paInputOverflow    ((PaStreamCallbackFlags) 0x00000002)
+
+/** Indicates that output data (or a gap) was inserted, possibly because the
+ stream callback is using too much CPU time.
+ @see PaStreamCallbackFlags
+*/
+#define paOutputUnderflow  ((PaStreamCallbackFlags) 0x00000004)
+
+/** Indicates that output data will be discarded because no room is available.
+ @see PaStreamCallbackFlags
+*/
+#define paOutputOverflow   ((PaStreamCallbackFlags) 0x00000008)
+
+/** Some of all of the output data will be used to prime the stream, input
+ data may be zero.
+ @see PaStreamCallbackFlags
+*/
+#define paPrimingOutput    ((PaStreamCallbackFlags) 0x00000010)
+
+/**
+ Allowable return values for the PaStreamCallback.
+ @see PaStreamCallback
+*/
+typedef enum PaStreamCallbackResult
+{
+    paContinue=0,
+    paComplete=1,
+    paAbort=2
+} PaStreamCallbackResult;
+
+
+/**
+ Functions of type PaStreamCallback are implemented by PortAudio clients.
+ They consume, process or generate audio in response to requests from an
+ active PortAudio stream.
+     
+ @param input and @param output are either arrays of interleaved samples or;
+ if non-interleaved samples were requested using the paNonInterleaved sample 
+ format flag, an array of buffer pointers, one non-interleaved buffer for 
+ each channel.
+
+ The format, packing and number of channels used by the buffers are
+ determined by parameters to Pa_OpenStream().
+     
+ @param frameCount The number of sample frames to be processed by
+ the stream callback.
+
+ @param timeInfo The time in seconds when the first sample of the input
+ buffer was received at the audio input, the time in seconds when the first
+ sample of the output buffer will begin being played at the audio output, and
+ the time in seconds when the stream callback was called.
+ See also Pa_GetStreamTime()
+
+ @param statusFlags Flags indicating whether input and/or output buffers
+ have been inserted or will be dropped to overcome underflow or overflow
+ conditions.
+
+ @param userData The value of a user supplied pointer passed to
+ Pa_OpenStream() intended for storing synthesis data etc.
+
+ @return
+ The stream callback should return one of the values in the
+ PaStreamCallbackResult enumeration. To ensure that the callback continues
+ to be called, it should return paContinue (0). Either paComplete or paAbort
+ can be returned to finish stream processing, after either of these values is
+ returned the callback will not be called again. If paAbort is returned the
+ stream will finish as soon as possible. If paComplete is returned, the stream
+ will continue until all buffers generated by the callback have been played.
+ This may be useful in applications such as soundfile players where a specific
+ duration of output is required. However, it is not necessary to utilize this
+ mechanism as Pa_StopStream(), Pa_AbortStream() or Pa_CloseStream() can also
+ be used to stop the stream. The callback must always fill the entire output
+ buffer irrespective of its return value.
+
+ @see Pa_OpenStream, Pa_OpenDefaultStream
+
+ @note With the exception of Pa_GetStreamCpuLoad() it is not permissible to call
+ PortAudio API functions from within the stream callback.
+*/
+typedef int PaStreamCallback(
+    const void *input, void *output,
+    unsigned long frameCount,
+    const PaStreamCallbackTimeInfo* timeInfo,
+    PaStreamCallbackFlags statusFlags,
+    void *userData );
+
+
+/** Opens a stream for either input, output or both.
+     
+ @param stream The address of a PaStream pointer which will receive
+ a pointer to the newly opened stream.
+     
+ @param inputParameters A structure that describes the input parameters used by
+ the opened stream. See PaStreamParameters for a description of these parameters.
+ inputParameters must be NULL for output-only streams.
+
+ @param outputParameters A structure that describes the output parameters used by
+ the opened stream. See PaStreamParameters for a description of these parameters.
+ outputParameters must be NULL for input-only streams.
+ 
+ @param sampleRate The desired sampleRate. For full-duplex streams it is the
+ sample rate for both input and output
+     
+ @param framesPerBuffer The number of frames passed to the stream callback
+ function, or the preferred block granularity for a blocking read/write stream.
+ The special value paFramesPerBufferUnspecified (0) may be used to request that
+ the stream callback will receive an optimal (and possibly varying) number of
+ frames based on host requirements and the requested latency settings.
+ Note: With some host APIs, the use of non-zero framesPerBuffer for a callback
+ stream may introduce an additional layer of buffering which could introduce
+ additional latency. PortAudio guarantees that the additional latency
+ will be kept to the theoretical minimum however, it is strongly recommended
+ that a non-zero framesPerBuffer value only be used when your algorithm
+ requires a fixed number of frames per stream callback.
+ 
+ @param streamFlags Flags which modify the behavior of the streaming process.
+ This parameter may contain a combination of flags ORed together. Some flags may
+ only be relevant to certain buffer formats.
+     
+ @param streamCallback A pointer to a client supplied function that is responsible
+ for processing and filling input and output buffers. If this parameter is NULL
+ the stream will be opened in 'blocking read/write' mode. In blocking mode,
+ the client can receive sample data using Pa_ReadStream and write sample data
+ using Pa_WriteStream, the number of samples that may be read or written
+ without blocking is returned by Pa_GetStreamReadAvailable and
+ Pa_GetStreamWriteAvailable respectively.
+
+ @param userData A client supplied pointer which is passed to the stream callback
+ function. It could for example, contain a pointer to instance data necessary
+ for processing the audio buffers. This parameter is ignored if streamCallback
+ is NULL.
+     
+ @return
+ Upon success Pa_OpenStream() returns paNoError and places a pointer to a
+ valid PaStream in the stream argument. The stream is inactive (stopped).
+ If a call to Pa_OpenStream() fails, a non-zero error code is returned (see
+ PaError for possible error codes) and the value of stream is invalid.
+
+ @see PaStreamParameters, PaStreamCallback, Pa_ReadStream, Pa_WriteStream,
+ Pa_GetStreamReadAvailable, Pa_GetStreamWriteAvailable
+*/
+PaError Pa_OpenStream( PaStream** stream,
+                       const PaStreamParameters *inputParameters,
+                       const PaStreamParameters *outputParameters,
+                       double sampleRate,
+                       unsigned long framesPerBuffer,
+                       PaStreamFlags streamFlags,
+                       PaStreamCallback *streamCallback,
+                       void *userData );
+
+
+/** A simplified version of Pa_OpenStream() that opens the default input
+ and/or output devices.
+
+ @param stream The address of a PaStream pointer which will receive
+ a pointer to the newly opened stream.
+ 
+ @param numInputChannels  The number of channels of sound that will be supplied
+ to the stream callback or returned by Pa_ReadStream. It can range from 1 to
+ the value of maxInputChannels in the PaDeviceInfo record for the default input
+ device. If 0 the stream is opened as an output-only stream.
+
+ @param numOutputChannels The number of channels of sound to be delivered to the
+ stream callback or passed to Pa_WriteStream. It can range from 1 to the value
+ of maxOutputChannels in the PaDeviceInfo record for the default output device.
+ If 0 the stream is opened as an output-only stream.
+
+ @param sampleFormat The sample format of both the input and output buffers
+ provided to the callback or passed to and from Pa_ReadStream and Pa_WriteStream.
+ sampleFormat may be any of the formats described by the PaSampleFormat
+ enumeration.
+ 
+ @param sampleRate Same as Pa_OpenStream parameter of the same name.
+ @param framesPerBuffer Same as Pa_OpenStream parameter of the same name.
+ @param streamCallback Same as Pa_OpenStream parameter of the same name.
+ @param userData Same as Pa_OpenStream parameter of the same name.
+
+ @return As for Pa_OpenStream
+
+ @see Pa_OpenStream, PaStreamCallback
+*/
+PaError Pa_OpenDefaultStream( PaStream** stream,
+                              int numInputChannels,
+                              int numOutputChannels,
+                              PaSampleFormat sampleFormat,
+                              double sampleRate,
+                              unsigned long framesPerBuffer,
+                              PaStreamCallback *streamCallback,
+                              void *userData );
+
+
+/** Closes an audio stream. If the audio stream is active it
+ discards any pending buffers as if Pa_AbortStream() had been called.
+*/
+PaError Pa_CloseStream( PaStream *stream );
+
+
+/** Functions of type PaStreamFinishedCallback are implemented by PortAudio 
+ clients. They can be registered with a stream using the Pa_SetStreamFinishedCallback
+ function. Once registered they are called when the stream becomes inactive
+ (ie once a call to Pa_StopStream() will not block).
+ A stream will become inactive after the stream callback returns non-zero,
+ or when Pa_StopStream or Pa_AbortStream is called. For a stream providing audio
+ output, if the stream callback returns paComplete, or Pa_StopStream is called,
+ the stream finished callback will not be called until all generated sample data
+ has been played.
+ 
+ @param userData The userData parameter supplied to Pa_OpenStream()
+
+ @see Pa_SetStreamFinishedCallback
+*/
+typedef void PaStreamFinishedCallback( void *userData );
+
+
+/** Register a stream finished callback function which will be called when the 
+ stream becomes inactive. See the description of PaStreamFinishedCallback for 
+ further details about when the callback will be called.
+
+ @param stream a pointer to a PaStream that is in the stopped state - if the
+ stream is not stopped, the stream's finished callback will remain unchanged 
+ and an error code will be returned.
+
+ @param streamFinishedCallback a pointer to a function with the same signature
+ as PaStreamFinishedCallback, that will be called when the stream becomes
+ inactive. Passing NULL for this parameter will un-register a previously
+ registered stream finished callback function.
+
+ @return on success returns paNoError, otherwise an error code indicating the cause
+ of the error.
+
+ @see PaStreamFinishedCallback
+*/
+PaError Pa_SetStreamFinishedCallback( PaStream *stream, PaStreamFinishedCallback* streamFinishedCallback ); 
+
+
+/** Commences audio processing.
+*/
+PaError Pa_StartStream( PaStream *stream );
+
+
+/** Terminates audio processing. It waits until all pending
+ audio buffers have been played before it returns.
+*/
+PaError Pa_StopStream( PaStream *stream );
+
+
+/** Terminates audio processing immediately without waiting for pending
+ buffers to complete.
+*/
+PaError Pa_AbortStream( PaStream *stream );
+
+
+/** Determine whether the stream is stopped.
+ A stream is considered to be stopped prior to a successful call to
+ Pa_StartStream and after a successful call to Pa_StopStream or Pa_AbortStream.
+ If a stream callback returns a value other than paContinue the stream is NOT
+ considered to be stopped.
+
+ @return Returns one (1) when the stream is stopped, zero (0) when
+ the stream is running or, a PaErrorCode (which are always negative) if
+ PortAudio is not initialized or an error is encountered.
+
+ @see Pa_StopStream, Pa_AbortStream, Pa_IsStreamActive
+*/
+PaError Pa_IsStreamStopped( PaStream *stream );
+
+
+/** Determine whether the stream is active.
+ A stream is active after a successful call to Pa_StartStream(), until it
+ becomes inactive either as a result of a call to Pa_StopStream() or
+ Pa_AbortStream(), or as a result of a return value other than paContinue from
+ the stream callback. In the latter case, the stream is considered inactive
+ after the last buffer has finished playing.
+
+ @return Returns one (1) when the stream is active (ie playing or recording
+ audio), zero (0) when not playing or, a PaErrorCode (which are always negative)
+ if PortAudio is not initialized or an error is encountered.
+
+ @see Pa_StopStream, Pa_AbortStream, Pa_IsStreamStopped
+*/
+PaError Pa_IsStreamActive( PaStream *stream );
+
+
+
+/** A structure containing unchanging information about an open stream.
+ @see Pa_GetStreamInfo
+*/
+
+typedef struct PaStreamInfo
+{
+    /** this is struct version 1 */
+    int structVersion;
+
+    /** The input latency of the stream in seconds. This value provides the most
+     accurate estimate of input latency available to the implementation. It may
+     differ significantly from the suggestedLatency value passed to Pa_OpenStream().
+     The value of this field will be zero (0.) for output-only streams.
+     @see PaTime
+    */
+    PaTime inputLatency;
+
+    /** The output latency of the stream in seconds. This value provides the most
+     accurate estimate of output latency available to the implementation. It may
+     differ significantly from the suggestedLatency value passed to Pa_OpenStream().
+     The value of this field will be zero (0.) for input-only streams.
+     @see PaTime
+    */
+    PaTime outputLatency;
+
+    /** The sample rate of the stream in Hertz (samples per second). In cases
+     where the hardware sample rate is inaccurate and PortAudio is aware of it,
+     the value of this field may be different from the sampleRate parameter
+     passed to Pa_OpenStream(). If information about the actual hardware sample
+     rate is not available, this field will have the same value as the sampleRate
+     parameter passed to Pa_OpenStream().
+    */
+    double sampleRate;
+    
+} PaStreamInfo;
+
+
+/** Retrieve a pointer to a PaStreamInfo structure containing information
+ about the specified stream.
+ @return A pointer to an immutable PaStreamInfo structure. If the stream
+ parameter invalid, or an error is encountered, the function returns NULL.
+
+ @param stream A pointer to an open stream previously created with Pa_OpenStream.
+
+ @note PortAudio manages the memory referenced by the returned pointer,
+ the client must not manipulate or free the memory. The pointer is only
+ guaranteed to be valid until the specified stream is closed.
+
+ @see PaStreamInfo
+*/
+const PaStreamInfo* Pa_GetStreamInfo( PaStream *stream );
+
+
+/** Returns the current time in seconds for a stream according to the same clock used
+ to generate callback PaStreamCallbackTimeInfo timestamps. The time values are
+ monotonically increasing and have unspecified origin. 
+ 
+ Pa_GetStreamTime returns valid time values for the entire life of the stream,
+ from when the stream is opened until it is closed. Starting and stopping the stream
+ does not affect the passage of time returned by Pa_GetStreamTime.
+
+ This time may be used for synchronizing other events to the audio stream, for 
+ example synchronizing audio to MIDI.
+                                        
+ @return The stream's current time in seconds, or 0 if an error occurred.
+
+ @see PaTime, PaStreamCallback, PaStreamCallbackTimeInfo
+*/
+PaTime Pa_GetStreamTime( PaStream *stream );
+
+
+/** Retrieve CPU usage information for the specified stream.
+ The "CPU Load" is a fraction of total CPU time consumed by a callback stream's
+ audio processing routines including, but not limited to the client supplied
+ stream callback. This function does not work with blocking read/write streams.
+
+ This function may be called from the stream callback function or the
+ application.
+     
+ @return
+ A floating point value, typically between 0.0 and 1.0, where 1.0 indicates
+ that the stream callback is consuming the maximum number of CPU cycles possible
+ to maintain real-time operation. A value of 0.5 would imply that PortAudio and
+ the stream callback was consuming roughly 50% of the available CPU time. The
+ return value may exceed 1.0. A value of 0.0 will always be returned for a
+ blocking read/write stream, or if an error occurs.
+*/
+double Pa_GetStreamCpuLoad( PaStream* stream );
+
+
+/** Read samples from an input stream. The function doesn't return until
+ the entire buffer has been filled - this may involve waiting for the operating
+ system to supply the data.
+
+ @param stream A pointer to an open stream previously created with Pa_OpenStream.
+ 
+ @param buffer A pointer to a buffer of sample frames. The buffer contains
+ samples in the format specified by the inputParameters->sampleFormat field
+ used to open the stream, and the number of channels specified by
+ inputParameters->numChannels. If non-interleaved samples were requested using
+ the paNonInterleaved sample format flag, buffer is a pointer to the first element 
+ of an array of buffer pointers, one non-interleaved buffer for each channel.
+
+ @param frames The number of frames to be read into buffer. This parameter
+ is not constrained to a specific range, however high performance applications
+ will want to match this parameter to the framesPerBuffer parameter used
+ when opening the stream.
+
+ @return On success PaNoError will be returned, or PaInputOverflowed if input
+ data was discarded by PortAudio after the previous call and before this call.
+*/
+PaError Pa_ReadStream( PaStream* stream,
+                       void *buffer,
+                       unsigned long frames );
+
+
+/** Write samples to an output stream. This function doesn't return until the
+ entire buffer has been consumed - this may involve waiting for the operating
+ system to consume the data.
+
+ @param stream A pointer to an open stream previously created with Pa_OpenStream.
+
+ @param buffer A pointer to a buffer of sample frames. The buffer contains
+ samples in the format specified by the outputParameters->sampleFormat field
+ used to open the stream, and the number of channels specified by
+ outputParameters->numChannels. If non-interleaved samples were requested using
+ the paNonInterleaved sample format flag, buffer is a pointer to the first element 
+ of an array of buffer pointers, one non-interleaved buffer for each channel.
+
+ @param frames The number of frames to be written from buffer. This parameter
+ is not constrained to a specific range, however high performance applications
+ will want to match this parameter to the framesPerBuffer parameter used
+ when opening the stream.
+
+ @return On success PaNoError will be returned, or paOutputUnderflowed if
+ additional output data was inserted after the previous call and before this
+ call.
+*/
+PaError Pa_WriteStream( PaStream* stream,
+                        const void *buffer,
+                        unsigned long frames );
+
+
+/** Retrieve the number of frames that can be read from the stream without
+ waiting.
+
+ @return Returns a non-negative value representing the maximum number of frames
+ that can be read from the stream without blocking or busy waiting or, a
+ PaErrorCode (which are always negative) if PortAudio is not initialized or an
+ error is encountered.
+*/
+signed long Pa_GetStreamReadAvailable( PaStream* stream );
+
+
+/** Retrieve the number of frames that can be written to the stream without
+ waiting.
+
+ @return Returns a non-negative value representing the maximum number of frames
+ that can be written to the stream without blocking or busy waiting or, a
+ PaErrorCode (which are always negative) if PortAudio is not initialized or an
+ error is encountered.
+*/
+signed long Pa_GetStreamWriteAvailable( PaStream* stream );
+
+
+/* Miscellaneous utilities */
+
+
+/** Retrieve the size of a given sample format in bytes.
+
+ @return The size in bytes of a single sample in the specified format,
+ or paSampleFormatNotSupported if the format is not supported.
+*/
+PaError Pa_GetSampleSize( PaSampleFormat format );
+
+
+/** Put the caller to sleep for at least 'msec' milliseconds. This function is
+ provided only as a convenience for authors of portable code (such as the tests
+ and examples in the PortAudio distribution.)
+
+ The function may sleep longer than requested so don't rely on this for accurate
+ musical timing.
+*/
+void Pa_Sleep( long msec );
+
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+#endif /* PORTAUDIO_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/osx/include/rubberband/RubberBandStretcher.h	Fri Jul 04 10:37:37 2014 +0100
@@ -0,0 +1,687 @@
+/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
+
+/*
+    Rubber Band Library
+    An audio time-stretching and pitch-shifting library.
+    Copyright 2007-2012 Particular Programs Ltd.
+
+    This program is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License as
+    published by the Free Software Foundation; either version 2 of the
+    License, or (at your option) any later version.  See the file
+    COPYING included with this distribution for more information.
+
+    Alternatively, if you have a valid commercial licence for the
+    Rubber Band Library obtained by agreement with the copyright
+    holders, you may redistribute and/or modify it under the terms
+    described in that licence.
+
+    If you wish to distribute code using the Rubber Band Library
+    under terms other than those of the GNU General Public License,
+    you must obtain a valid commercial licence before doing so.
+*/
+
+#ifndef _RUBBERBANDSTRETCHER_H_
+#define _RUBBERBANDSTRETCHER_H_
+    
+#define RUBBERBAND_VERSION "1.8.1"
+#define RUBBERBAND_API_MAJOR_VERSION 2
+#define RUBBERBAND_API_MINOR_VERSION 5
+
+#include <vector>
+#include <map>
+#include <cstddef>
+
+/**
+ * @mainpage RubberBand
+ * 
+ * The Rubber Band API is contained in the single class
+ * RubberBand::RubberBandStretcher.
+ * 
+ * Threading notes for real-time applications:
+ * 
+ * Multiple instances of RubberBandStretcher may be created and used
+ * in separate threads concurrently.  However, for any single instance
+ * of RubberBandStretcher, you may not call process() more than once
+ * concurrently, and you may not change the time or pitch ratio while
+ * a process() call is being executed (if the stretcher was created in
+ * "real-time mode"; in "offline mode" you can't change the ratios
+ * during use anyway).
+ * 
+ * So you can run process() in its own thread if you like, but if you
+ * want to change ratios dynamically from a different thread, you will
+ * need some form of mutex in your code.  Changing the time or pitch
+ * ratio is real-time safe except in extreme circumstances, so for
+ * most applications that may change these dynamically it probably
+ * makes most sense to do so from the same thread as calls process(),
+ * even if that is a real-time thread.
+ */
+
+namespace RubberBand
+{
+
+class RubberBandStretcher
+{
+public:
+    /**
+     * Processing options for the timestretcher.  The preferred
+     * options should normally be set in the constructor, as a bitwise
+     * OR of the option flags.  The default value (DefaultOptions) is
+     * intended to give good results in most situations.
+     *
+     * 1. Flags prefixed \c OptionProcess determine how the timestretcher
+     * will be invoked.  These options may not be changed after
+     * construction.
+     * 
+     *   \li \c OptionProcessOffline - Run the stretcher in offline
+     *   mode.  In this mode the input data needs to be provided
+     *   twice, once to study(), which calculates a stretch profile
+     *   for the audio, and once to process(), which stretches it.
+     *
+     *   \li \c OptionProcessRealTime - Run the stretcher in real-time
+     *   mode.  In this mode only process() should be called, and the
+     *   stretcher adjusts dynamically in response to the input audio.
+     * 
+     * The Process setting is likely to depend on your architecture:
+     * non-real-time operation on seekable files: Offline; real-time
+     * or streaming operation: RealTime.
+     *
+     * 2. Flags prefixed \c OptionStretch control the profile used for
+     * variable timestretching.  Rubber Band always adjusts the
+     * stretch profile to minimise stretching of busy broadband
+     * transient sounds, but the degree to which it does so is
+     * adjustable.  These options may not be changed after
+     * construction.
+     *
+     *   \li \c OptionStretchElastic - Only meaningful in offline
+     *   mode, and the default in that mode.  The audio will be
+     *   stretched at a variable rate, aimed at preserving the quality
+     *   of transient sounds as much as possible.  The timings of low
+     *   activity regions between transients may be less exact than
+     *   when the precise flag is set.
+     * 
+     *   \li \c OptionStretchPrecise - Although still using a variable
+     *   stretch rate, the audio will be stretched so as to maintain
+     *   as close as possible to a linear stretch ratio throughout.
+     *   Timing may be better than when using \c OptionStretchElastic, at
+     *   slight cost to the sound quality of transients.  This setting
+     *   is always used when running in real-time mode.
+     *
+     * 3. Flags prefixed \c OptionTransients control the component
+     * frequency phase-reset mechanism that may be used at transient
+     * points to provide clarity and realism to percussion and other
+     * significant transient sounds.  These options may be changed
+     * after construction when running in real-time mode, but not when
+     * running in offline mode.
+     * 
+     *   \li \c OptionTransientsCrisp - Reset component phases at the
+     *   peak of each transient (the start of a significant note or
+     *   percussive event).  This, the default setting, usually
+     *   results in a clear-sounding output; but it is not always
+     *   consistent, and may cause interruptions in stable sounds
+     *   present at the same time as transient events.  The
+     *   OptionDetector flags (below) can be used to tune this to some
+     *   extent.
+     *
+     *   \li \c OptionTransientsMixed - Reset component phases at the
+     *   peak of each transient, outside a frequency range typical of
+     *   musical fundamental frequencies.  The results may be more
+     *   regular for mixed stable and percussive notes than
+     *   \c OptionTransientsCrisp, but with a "phasier" sound.  The
+     *   balance may sound very good for certain types of music and
+     *   fairly bad for others.
+     *
+     *   \li \c OptionTransientsSmooth - Do not reset component phases
+     *   at any point.  The results will be smoother and more regular
+     *   but may be less clear than with either of the other
+     *   transients flags.
+     *
+     * 4. Flags prefixed \c OptionDetector control the type of
+     * transient detector used.  These options may be changed
+     * after construction when running in real-time mode, but not when
+     * running in offline mode.
+     *
+     *   \li \c OptionDetectorCompound - Use a general-purpose
+     *   transient detector which is likely to be good for most
+     *   situations.  This is the default.
+     *
+     *   \li \c OptionDetectorPercussive - Detect percussive
+     *   transients.  Note that this was the default and only option
+     *   in Rubber Band versions prior to 1.5.
+     *
+     *   \li \c OptionDetectorSoft - Use an onset detector with less
+     *   of a bias toward percussive transients.  This may give better
+     *   results with certain material (e.g. relatively monophonic
+     *   piano music).
+     *
+     * 5. Flags prefixed \c OptionPhase control the adjustment of
+     * component frequency phases from one analysis window to the next
+     * during non-transient segments.  These options may be changed at
+     * any time.
+     *
+     *   \li \c OptionPhaseLaminar - Adjust phases when stretching in
+     *   such a way as to try to retain the continuity of phase
+     *   relationships between adjacent frequency bins whose phases
+     *   are behaving in similar ways.  This, the default setting,
+     *   should give good results in most situations.
+     *
+     *   \li \c OptionPhaseIndependent - Adjust the phase in each
+     *   frequency bin independently from its neighbours.  This
+     *   usually results in a slightly softer, phasier sound.
+     *
+     * 6. Flags prefixed \c OptionThreading control the threading
+     * model of the stretcher.  These options may not be changed after
+     * construction.
+     *
+     *   \li \c OptionThreadingAuto - Permit the stretcher to
+     *   determine its own threading model.  Usually this means using
+     *   one processing thread per audio channel in offline mode if
+     *   the stretcher is able to determine that more than one CPU is
+     *   available, and one thread only in realtime mode.  This is the
+     *   defafult.
+     *
+     *   \li \c OptionThreadingNever - Never use more than one thread.
+     *  
+     *   \li \c OptionThreadingAlways - Use multiple threads in any
+     *   situation where \c OptionThreadingAuto would do so, except omit
+     *   the check for multiple CPUs and instead assume it to be true.
+     *
+     * 7. Flags prefixed \c OptionWindow control the window size for
+     * FFT processing.  The window size actually used will depend on
+     * many factors, but it can be influenced.  These options may not
+     * be changed after construction.
+     *
+     *   \li \c OptionWindowStandard - Use the default window size.
+     *   The actual size will vary depending on other parameters.
+     *   This option is expected to produce better results than the
+     *   other window options in most situations.
+     *
+     *   \li \c OptionWindowShort - Use a shorter window.  This may
+     *   result in crisper sound for audio that depends strongly on
+     *   its timing qualities.
+     *
+     *   \li \c OptionWindowLong - Use a longer window.  This is
+     *   likely to result in a smoother sound at the expense of
+     *   clarity and timing.
+     *
+     * 8. Flags prefixed \c OptionSmoothing control the use of
+     * window-presum FFT and time-domain smoothing.  These options may
+     * not be changed after construction.
+     *
+     *   \li \c OptionSmoothingOff - Do not use time-domain smoothing.
+     *   This is the default.
+     *
+     *   \li \c OptionSmoothingOn - Use time-domain smoothing.  This
+     *   will result in a softer sound with some audible artifacts
+     *   around sharp transients, but it may be appropriate for longer
+     *   stretches of some instruments and can mix well with
+     *   OptionWindowShort.
+     *
+     * 9. Flags prefixed \c OptionFormant control the handling of
+     * formant shape (spectral envelope) when pitch-shifting.  These
+     * options may be changed at any time.
+     *
+     *   \li \c OptionFormantShifted - Apply no special formant
+     *   processing.  The spectral envelope will be pitch shifted as
+     *   normal.  This is the default.
+     *
+     *   \li \c OptionFormantPreserved - Preserve the spectral
+     *   envelope of the unshifted signal.  This permits shifting the
+     *   note frequency without so substantially affecting the
+     *   perceived pitch profile of the voice or instrument.
+     *
+     * 10. Flags prefixed \c OptionPitch control the method used for
+     * pitch shifting.  These options may be changed at any time.
+     * They are only effective in realtime mode; in offline mode, the
+     * pitch-shift method is fixed.
+     *
+     *   \li \c OptionPitchHighSpeed - Use a method with a CPU cost
+     *   that is relatively moderate and predictable.  This may
+     *   sound less clear than OptionPitchHighQuality, especially
+     *   for large pitch shifts.  This is the default.
+
+     *   \li \c OptionPitchHighQuality - Use the highest quality
+     *   method for pitch shifting.  This method has a CPU cost
+     *   approximately proportional to the required frequency shift.
+
+     *   \li \c OptionPitchHighConsistency - Use the method that gives
+     *   greatest consistency when used to create small variations in
+     *   pitch around the 1.0-ratio level.  Unlike the previous two
+     *   options, this avoids discontinuities when moving across the
+     *   1.0 pitch scale in real-time; it also consumes more CPU than
+     *   the others in the case where the pitch scale is exactly 1.0.
+     *
+     * 11. Flags prefixed \c OptionChannels control the method used for
+     * processing two-channel audio.  These options may not be changed
+     * after construction.
+     *
+     *   \li \c OptionChannelsApart - Each channel is processed
+     *   individually, though timing is synchronised and phases are
+     *   synchronised at transients (depending on the OptionTransients
+     *   setting).  This gives the highest quality for the individual
+     *   channels but a relative lack of stereo focus and unrealistic
+     *   increase in "width".  This is the default.
+     *
+     *   \li \c OptionChannelsTogether - The first two channels (where
+     *   two or more are present) are considered to be a stereo pair
+     *   and are processed in mid-side format; mid and side are
+     *   processed individually, with timing synchronised and phases
+     *   synchronised at transients (depending on the OptionTransients
+     *   setting).  This usually leads to better focus in the centre
+     *   but a loss of stereo space and width.  Any channels beyond
+     *   the first two are processed individually.
+     */
+    
+    enum Option {
+
+        OptionProcessOffline       = 0x00000000,
+        OptionProcessRealTime      = 0x00000001,
+
+        OptionStretchElastic       = 0x00000000,
+        OptionStretchPrecise       = 0x00000010,
+    
+        OptionTransientsCrisp      = 0x00000000,
+        OptionTransientsMixed      = 0x00000100,
+        OptionTransientsSmooth     = 0x00000200,
+
+        OptionDetectorCompound     = 0x00000000,
+        OptionDetectorPercussive   = 0x00000400,
+        OptionDetectorSoft         = 0x00000800,
+
+        OptionPhaseLaminar         = 0x00000000,
+        OptionPhaseIndependent     = 0x00002000,
+    
+        OptionThreadingAuto        = 0x00000000,
+        OptionThreadingNever       = 0x00010000,
+        OptionThreadingAlways      = 0x00020000,
+
+        OptionWindowStandard       = 0x00000000,
+        OptionWindowShort          = 0x00100000,
+        OptionWindowLong           = 0x00200000,
+
+        OptionSmoothingOff         = 0x00000000,
+        OptionSmoothingOn          = 0x00800000,
+
+        OptionFormantShifted       = 0x00000000,
+        OptionFormantPreserved     = 0x01000000,
+
+        OptionPitchHighSpeed       = 0x00000000,
+        OptionPitchHighQuality     = 0x02000000,
+        OptionPitchHighConsistency = 0x04000000,
+
+        OptionChannelsApart        = 0x00000000,
+        OptionChannelsTogether     = 0x10000000,
+
+        // n.b. Options is int, so we must stop before 0x80000000
+    };
+
+    typedef int Options;
+
+    enum PresetOption {
+        DefaultOptions             = 0x00000000,
+        PercussiveOptions          = 0x00102000
+    };
+
+    /**
+     * Construct a time and pitch stretcher object to run at the given
+     * sample rate, with the given number of channels.  Processing
+     * options and the time and pitch scaling ratios may be provided.
+     * The time and pitch ratios may be changed after construction,
+     * but most of the options may not.  See the option documentation
+     * above for more details.
+     */
+    RubberBandStretcher(size_t sampleRate,
+                        size_t channels,
+                        Options options = DefaultOptions,
+                        double initialTimeRatio = 1.0,
+                        double initialPitchScale = 1.0);
+    ~RubberBandStretcher();
+
+    /**
+     * Reset the stretcher's internal buffers.  The stretcher should
+     * subsequently behave as if it had just been constructed
+     * (although retaining the current time and pitch ratio).
+     */
+    void reset();
+
+    /**
+     * Set the time ratio for the stretcher.  This is the ratio of
+     * stretched to unstretched duration -- not tempo.  For example, a
+     * ratio of 2.0 would make the audio twice as long (i.e. halve the
+     * tempo); 0.5 would make it half as long (i.e. double the tempo);
+     * 1.0 would leave the duration unaffected.
+     *
+     * If the stretcher was constructed in Offline mode, the time
+     * ratio is fixed throughout operation; this function may be
+     * called any number of times between construction (or a call to
+     * reset()) and the first call to study() or process(), but may
+     * not be called after study() or process() has been called.
+     *
+     * If the stretcher was constructed in RealTime mode, the time
+     * ratio may be varied during operation; this function may be
+     * called at any time, so long as it is not called concurrently
+     * with process().  You should either call this function from the
+     * same thread as process(), or provide your own mutex or similar
+     * mechanism to ensure that setTimeRatio and process() cannot be
+     * run at once (there is no internal mutex for this purpose).
+     */
+    void setTimeRatio(double ratio);
+
+    /**
+     * Set the pitch scaling ratio for the stretcher.  This is the
+     * ratio of target frequency to source frequency.  For example, a
+     * ratio of 2.0 would shift up by one octave; 0.5 down by one
+     * octave; or 1.0 leave the pitch unaffected.
+     *
+     * To put this in musical terms, a pitch scaling ratio
+     * corresponding to a shift of S equal-tempered semitones (where S
+     * is positive for an upwards shift and negative for downwards) is
+     * pow(2.0, S / 12.0).
+     *
+     * If the stretcher was constructed in Offline mode, the pitch
+     * scaling ratio is fixed throughout operation; this function may
+     * be called any number of times between construction (or a call
+     * to reset()) and the first call to study() or process(), but may
+     * not be called after study() or process() has been called.
+     *
+     * If the stretcher was constructed in RealTime mode, the pitch
+     * scaling ratio may be varied during operation; this function may
+     * be called at any time, so long as it is not called concurrently
+     * with process().  You should either call this function from the
+     * same thread as process(), or provide your own mutex or similar
+     * mechanism to ensure that setPitchScale and process() cannot be
+     * run at once (there is no internal mutex for this purpose).
+     */
+    void setPitchScale(double scale);
+
+    /**
+     * Return the last time ratio value that was set (either on
+     * construction or with setTimeRatio()).
+     */
+    double getTimeRatio() const;
+
+    /**
+     * Return the last pitch scaling ratio value that was set (either
+     * on construction or with setPitchScale()).
+     */
+    double getPitchScale() const;
+
+    /**
+     * Return the processing latency of the stretcher.  This is the
+     * number of audio samples that one would have to discard at the
+     * start of the output in order to ensure that the resulting audio
+     * aligned with the input audio at the start.  In Offline mode,
+     * latency is automatically adjusted for and the result is zero.
+     * In RealTime mode, the latency may depend on the time and pitch
+     * ratio and other options.
+     */
+    size_t getLatency() const;
+
+    /**
+     * Change an OptionTransients configuration setting.  This may be
+     * called at any time in RealTime mode.  It may not be called in
+     * Offline mode (for which the transients option is fixed on
+     * construction).
+     */
+    void setTransientsOption(Options options);
+
+    /**
+     * Change an OptionDetector configuration setting.  This may be
+     * called at any time in RealTime mode.  It may not be called in
+     * Offline mode (for which the detector option is fixed on
+     * construction).
+     */
+    void setDetectorOption(Options options);
+
+    /**
+     * Change an OptionPhase configuration setting.  This may be
+     * called at any time in any mode.
+     *
+     * Note that if running multi-threaded in Offline mode, the change
+     * may not take effect immediately if processing is already under
+     * way when this function is called.
+     */
+    void setPhaseOption(Options options);
+
+    /**
+     * Change an OptionFormant configuration setting.  This may be
+     * called at any time in any mode.
+     *
+     * Note that if running multi-threaded in Offline mode, the change
+     * may not take effect immediately if processing is already under
+     * way when this function is called.
+     */
+    void setFormantOption(Options options);
+
+    /**
+     * Change an OptionPitch configuration setting.  This may be
+     * called at any time in RealTime mode.  It may not be called in
+     * Offline mode (for which the transients option is fixed on
+     * construction).
+     */
+    void setPitchOption(Options options);
+
+    /**
+     * Tell the stretcher exactly how many input samples it will
+     * receive.  This is only useful in Offline mode, when it allows
+     * the stretcher to ensure that the number of output samples is
+     * exactly correct.  In RealTime mode no such guarantee is
+     * possible and this value is ignored.
+     */
+    void setExpectedInputDuration(size_t samples);
+
+    /**
+     * Tell the stretcher the maximum number of sample frames that you
+     * will ever be passing in to a single process() call.  If you
+     * don't call this, the stretcher will assume that you are calling
+     * getSamplesRequired() at each cycle and are never passing more
+     * samples than are suggested by that function.
+     *
+     * If your application has some external constraint that means you
+     * prefer a fixed block size, then your normal mode of operation
+     * would be to provide that block size to this function; to loop
+     * calling process() with that size of block; after each call to
+     * process(), test whether output has been generated by calling
+     * available(); and, if so, call retrieve() to obtain it.  See
+     * getSamplesRequired() for a more suitable operating mode for
+     * applications without such external constraints.
+     *
+     * This function may not be called after the first call to study()
+     * or process().
+     *
+     * Note that this value is only relevant to process(), not to
+     * study() (to which you may pass any number of samples at a time,
+     * and from which there is no output).
+     */
+    void setMaxProcessSize(size_t samples);
+
+    /**
+     * Ask the stretcher how many audio sample frames should be
+     * provided as input in order to ensure that some more output
+     * becomes available.
+     * 
+     * If your application has no particular constraint on processing
+     * block size and you are able to provide any block size as input
+     * for each cycle, then your normal mode of operation would be to
+     * loop querying this function; providing that number of samples
+     * to process(); and reading the output using available() and
+     * retrieve().  See setMaxProcessSize() for a more suitable
+     * operating mode for applications that do have external block
+     * size constraints.
+     *
+     * Note that this value is only relevant to process(), not to
+     * study() (to which you may pass any number of samples at a time,
+     * and from which there is no output).
+     */
+     size_t getSamplesRequired() const;
+
+    /**
+     * Provide a set of mappings from "before" to "after" sample
+     * numbers so as to enforce a particular stretch profile.  The
+     * argument is a map from audio sample frame number in the source
+     * material, to the corresponding sample frame number in the
+     * stretched output.  The mapping should be for key frames only,
+     * with a "reasonable" gap between mapped samples.
+     *
+     * This function cannot be used in RealTime mode.
+     *
+     * This function may not be called after the first call to
+     * process().  It should be called after the time and pitch ratios
+     * have been set; the results of changing the time and pitch
+     * ratios after calling this function are undefined.  Calling
+     * reset() will clear this mapping.
+     *
+     * The key frame map only affects points within the material; it
+     * does not determine the overall stretch ratio (that is, the
+     * ratio between the output material's duration and the source
+     * material's duration).  You need to provide this ratio
+     * separately to setTimeRatio(), otherwise the results may be
+     * truncated or extended in unexpected ways regardless of the
+     * extent of the frame numbers found in the key frame map.
+     */
+    void setKeyFrameMap(const std::map<size_t, size_t> &);
+    
+    /**
+     * Provide a block of "samples" sample frames for the stretcher to
+     * study and calculate a stretch profile from.
+     *
+     * This is only meaningful in Offline mode, and is required if
+     * running in that mode.  You should pass the entire input through
+     * study() before any process() calls are made, as a sequence of
+     * blocks in individual study() calls, or as a single large block.
+     *
+     * "input" should point to de-interleaved audio data with one
+     * float array per channel.  "samples" supplies the number of
+     * audio sample frames available in "input".  If "samples" is
+     * zero, "input" may be NULL.
+     * 
+     * Set "final" to true if this is the last block of data that will
+     * be provided to study() before the first process() call.
+     */
+    void study(const float *const *input, size_t samples, bool final);
+
+    /**
+     * Provide a block of "samples" sample frames for processing.
+     * See also getSamplesRequired() and setMaxProcessSize().
+     *
+     * Set "final" to true if this is the last block of input data.
+     */
+    void process(const float *const *input, size_t samples, bool final);
+
+    /**
+     * Ask the stretcher how many audio sample frames of output data
+     * are available for reading (via retrieve()).
+     * 
+     * This function returns 0 if no frames are available: this
+     * usually means more input data needs to be provided, but if the
+     * stretcher is running in threaded mode it may just mean that not
+     * enough data has yet been processed.  Call getSamplesRequired()
+     * to discover whether more input is needed.
+     *
+     * This function returns -1 if all data has been fully processed
+     * and all output read, and the stretch process is now finished.
+     */
+    int available() const;
+
+    /**
+     * Obtain some processed output data from the stretcher.  Up to
+     * "samples" samples will be stored in the output arrays (one per
+     * channel for de-interleaved audio data) pointed to by "output".
+     * The return value is the actual number of sample frames
+     * retrieved.
+     */
+    size_t retrieve(float *const *output, size_t samples) const;
+
+    /**
+     * Return the value of internal frequency cutoff value n.
+     *
+     * This function is not for general use.
+     */
+    float getFrequencyCutoff(int n) const;
+
+    /** 
+     * Set the value of internal frequency cutoff n to f Hz.
+     *
+     * This function is not for general use.
+     */
+    void setFrequencyCutoff(int n, float f);
+    
+    /**
+     * Retrieve the value of the internal input block increment value.
+     *
+     * This function is provided for diagnostic purposes only.
+     */
+    size_t getInputIncrement() const;
+
+    /**
+     * In offline mode, retrieve the sequence of internal block
+     * increments for output, for the entire audio data, provided the
+     * stretch profile has been calculated.  In realtime mode,
+     * retrieve any output increments that have accumulated since the
+     * last call to getOutputIncrements, to a limit of 16.
+     *
+     * This function is provided for diagnostic purposes only.
+     */
+    std::vector<int> getOutputIncrements() const;
+
+    /**
+     * In offline mode, retrieve the sequence of internal phase reset
+     * detection function values, for the entire audio data, provided
+     * the stretch profile has been calculated.  In realtime mode,
+     * retrieve any phase reset points that have accumulated since the
+     * last call to getPhaseResetCurve, to a limit of 16.
+     *
+     * This function is provided for diagnostic purposes only.
+     */
+    std::vector<float> getPhaseResetCurve() const;
+
+    /**
+     * In offline mode, retrieve the sequence of internal frames for
+     * which exact timing has been sought, for the entire audio data,
+     * provided the stretch profile has been calculated.  In realtime
+     * mode, return an empty sequence.
+     *
+     * This function is provided for diagnostic purposes only.
+     */
+    std::vector<int> getExactTimePoints() const;
+
+    /**
+     * Return the number of channels this stretcher was constructed
+     * with.
+     */
+    size_t getChannelCount() const;
+
+    /**
+     * Force the stretcher to calculate a stretch profile.  Normally
+     * this happens automatically for the first process() call in
+     * offline mode.
+     *
+     * This function is provided for diagnostic purposes only.
+     */
+    void calculateStretch();
+
+    /**
+     * Set the level of debug output.  The value may be from 0 (errors
+     * only) to 3 (very verbose, with audible ticks in the output at
+     * phase reset points).  The default is whatever has been set
+     * using setDefaultDebugLevel, or 0 if that function has not been
+     * called.
+     */
+    void setDebugLevel(int level);
+
+    /**
+     * Set the default level of debug output for subsequently
+     * constructed stretchers.
+     *
+     * @see setDebugLevel
+     */
+    static void setDefaultDebugLevel(int level);
+
+protected:
+    class Impl;
+    Impl *m_d;
+};
+
+}
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/osx/include/rubberband/rubberband-c.h	Fri Jul 04 10:37:37 2014 +0100
@@ -0,0 +1,142 @@
+/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
+
+/*
+    Rubber Band Library
+    An audio time-stretching and pitch-shifting library.
+    Copyright 2007-2012 Particular Programs Ltd.
+
+    This program is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License as
+    published by the Free Software Foundation; either version 2 of the
+    License, or (at your option) any later version.  See the file
+    COPYING included with this distribution for more information.
+
+    Alternatively, if you have a valid commercial licence for the
+    Rubber Band Library obtained by agreement with the copyright
+    holders, you may redistribute and/or modify it under the terms
+    described in that licence.
+
+    If you wish to distribute code using the Rubber Band Library
+    under terms other than those of the GNU General Public License,
+    you must obtain a valid commercial licence before doing so.
+*/
+
+#ifndef _RUBBERBAND_C_API_H_
+#define _RUBBERBAND_C_API_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define RUBBERBAND_VERSION "1.8.1"
+#define RUBBERBAND_API_MAJOR_VERSION 2
+#define RUBBERBAND_API_MINOR_VERSION 5
+
+/**
+ * This is a C-linkage interface to the Rubber Band time stretcher.
+ * 
+ * This is a wrapper interface: the primary interface is in C++ and is
+ * defined and documented in RubberBandStretcher.h.  The library
+ * itself is implemented in C++, and requires C++ standard library
+ * support even when using the C-linkage API.
+ *
+ * Please see RubberBandStretcher.h for documentation.
+ *
+ * If you are writing to the C++ API, do not include this header.
+ */
+
+enum RubberBandOption {
+
+    RubberBandOptionProcessOffline       = 0x00000000,
+    RubberBandOptionProcessRealTime      = 0x00000001,
+
+    RubberBandOptionStretchElastic       = 0x00000000,
+    RubberBandOptionStretchPrecise       = 0x00000010,
+    
+    RubberBandOptionTransientsCrisp      = 0x00000000,
+    RubberBandOptionTransientsMixed      = 0x00000100,
+    RubberBandOptionTransientsSmooth     = 0x00000200,
+
+    RubberBandOptionDetectorCompound     = 0x00000000,
+    RubberBandOptionDetectorPercussive   = 0x00000400,
+    RubberBandOptionDetectorSoft         = 0x00000800,
+
+    RubberBandOptionPhaseLaminar         = 0x00000000,
+    RubberBandOptionPhaseIndependent     = 0x00002000,
+    
+    RubberBandOptionThreadingAuto        = 0x00000000,
+    RubberBandOptionThreadingNever       = 0x00010000,
+    RubberBandOptionThreadingAlways      = 0x00020000,
+
+    RubberBandOptionWindowStandard       = 0x00000000,
+    RubberBandOptionWindowShort          = 0x00100000,
+    RubberBandOptionWindowLong           = 0x00200000,
+
+    RubberBandOptionSmoothingOff         = 0x00000000,
+    RubberBandOptionSmoothingOn          = 0x00800000,
+
+    RubberBandOptionFormantShifted       = 0x00000000,
+    RubberBandOptionFormantPreserved     = 0x01000000,
+
+    RubberBandOptionPitchHighQuality     = 0x00000000,
+    RubberBandOptionPitchHighSpeed       = 0x02000000,
+    RubberBandOptionPitchHighConsistency = 0x04000000,
+
+    RubberBandOptionChannelsApart        = 0x00000000,
+    RubberBandOptionChannelsTogether     = 0x10000000,
+};
+
+typedef int RubberBandOptions;
+
+struct RubberBandState_;
+typedef struct RubberBandState_ *RubberBandState;
+
+extern RubberBandState rubberband_new(unsigned int sampleRate,
+                                      unsigned int channels,
+                                      RubberBandOptions options,
+                                      double initialTimeRatio,
+                                      double initialPitchScale);
+
+extern void rubberband_delete(RubberBandState);
+
+extern void rubberband_reset(RubberBandState);
+
+extern void rubberband_set_time_ratio(RubberBandState, double ratio);
+extern void rubberband_set_pitch_scale(RubberBandState, double scale);
+
+extern double rubberband_get_time_ratio(const RubberBandState);
+extern double rubberband_get_pitch_scale(const RubberBandState);
+
+extern unsigned int rubberband_get_latency(const RubberBandState);
+
+extern void rubberband_set_transients_option(RubberBandState, RubberBandOptions options);
+extern void rubberband_set_detector_option(RubberBandState, RubberBandOptions options);
+extern void rubberband_set_phase_option(RubberBandState, RubberBandOptions options);
+extern void rubberband_set_formant_option(RubberBandState, RubberBandOptions options);
+extern void rubberband_set_pitch_option(RubberBandState, RubberBandOptions options);
+
+extern void rubberband_set_expected_input_duration(RubberBandState, unsigned int samples);
+
+extern unsigned int rubberband_get_samples_required(const RubberBandState);
+
+extern void rubberband_set_max_process_size(RubberBandState, unsigned int samples);
+extern void rubberband_set_key_frame_map(RubberBandState, unsigned int keyframecount, unsigned int *from, unsigned int *to);
+
+extern void rubberband_study(RubberBandState, const float *const *input, unsigned int samples, int final);
+extern void rubberband_process(RubberBandState, const float *const *input, unsigned int samples, int final);
+
+extern int rubberband_available(const RubberBandState);
+extern unsigned int rubberband_retrieve(const RubberBandState, float *const *output, unsigned int samples);
+
+extern unsigned int rubberband_get_channel_count(const RubberBandState);
+
+extern void rubberband_calculate_stretch(RubberBandState);
+
+extern void rubberband_set_debug_level(RubberBandState, int level);
+extern void rubberband_set_default_debug_level(int level);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
Binary file osx/lib/libfftw3.a has changed
Binary file osx/lib/libfftw3f.a has changed
Binary file osx/lib/liblo.a has changed
Binary file osx/lib/libportaudio.a has changed
Binary file osx/lib/librubberband.a has changed
Binary file osx/lib/libvamp-hostsdk.a has changed
Binary file osx/lib/libvamp-sdk.a has changed
--- a/src/vamp-plugin-sdk-2.5/build/Makefile.mingw32	Fri Jul 04 10:36:59 2014 +0100
+++ b/src/vamp-plugin-sdk-2.5/build/Makefile.mingw32	Fri Jul 04 10:37:37 2014 +0100
@@ -61,10 +61,11 @@
 
 # Tools selection
 #
-CXX		= i586-mingw32msvc-g++
-LD		= i586-mingw32msvc-g++
-AR		= i586-mingw32msvc-ar
-RANLIB		= i586-mingw32msvc-ranlib
+CC              = gcc
+CXX		= g++
+LD		= g++
+AR		= ar
+RANLIB		= ranlib
 
 # Compile flags
 #
Binary file win32-mingw/lib/librubberband.a has changed
Binary file win32-mingw/lib/libvamp-hostsdk.a has changed
Binary file win32-mingw/lib/libvamp-sdk.a has changed