Bela
Real-time, ultra-low-latency audio and sensor processing system for BeagleBone Black
 All Classes Files Functions Variables Typedefs Macros Groups
Public Member Functions | List of all members
OSCMessageFactory Class Reference

OSCMessageFactory provides functions for building OSC messages within Bela. More...

#include <OSCClient.h>

Public Member Functions

OSCMessageFactoryto (std::string address)
 Sets the address of the OSC message. More...
 
OSCMessageFactoryadd (std::string)
 Adds a parameter to an OSC message. More...
 
OSCMessageFactoryadd (int)
 
OSCMessageFactoryadd (float)
 
OSCMessageFactoryadd (bool)
 
OSCMessageFactoryadd (void *ptr, int size)
 
oscpkt::Message end ()
 Finalises and returns the OSC message. More...
 

Detailed Description

OSCMessageFactory provides functions for building OSC messages within Bela.

This class is safe to use on the audio thread.

It is a wrapper for the oscpkt::Message class, which allows a message to be constructed conveniently on one line like so:

oscpkt::Message msg = oscMessageFactory.to("/osc_address").add(std::string("string")).add(5).add(3.14).add(false).end();

Every use of OSCMessageFactory must begin with to() and end with end()

Uses oscpkt (http://gruntthepeon.free.fr/oscpkt/) underneath

Member Function Documentation

OSCMessageFactory& OSCMessageFactory::to ( std::string  address)

Sets the address of the OSC message.

Must be called first when creating a message

Returns the class instance, allowing methods to be chained

Parameters
addressthe address of the OSC message
Examples:
OSC/render.cpp.
OSCMessageFactory& OSCMessageFactory::add ( std::string  )

Adds a parameter to an OSC message.

Must be called after to() but before end()

Parameters can be std::string, int, float, bool, or a void pointer to a binary buffer

Returns the class instance, allowing methods to be chained

Parameters
addressthe address of the OSC message
Examples:
OSC/render.cpp.
oscpkt::Message OSCMessageFactory::end ( )

Finalises and returns the OSC message.

Must be called last when creating a message

Returns the created OSC message

Returns
oscpkt::Message the created message
Examples:
OSC/render.cpp.

The documentation for this class was generated from the following file: