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 | Public Attributes | List of all members
OSCClient Class Reference

OSCClient provides functions for sending OSC messages from Bela. More...

#include <OSCClient.h>

Public Member Functions

void setup (int port, const char *address="127.0.0.1", bool scheduleTask=true)
 Sets the port and optionally the IP address used to send OSC messages. More...
 
void queueMessage (oscpkt::Message)
 Queue an OSC message to be sent at the end of the current audio block. More...
 
void sendMessageNow (oscpkt::Message)
 Send an OSC message immediately *** do not use on audio thread! ***. More...
 

Public Attributes

OSCMessageFactory newMessage
 Create a new oscpkt::Message object representing an OSC message. More...
 

Detailed Description

OSCClient provides functions for sending OSC messages from Bela.

Care must be taken to use the correct methods while running on the audio thread to prevent Xenomai mode switches and audio glitches.

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

Examples:
OSC/render.cpp.

Member Function Documentation

void OSCClient::setup ( int  port,
const char *  address = "127.0.0.1",
bool  scheduleTask = true 
)

Sets the port and optionally the IP address used to send OSC messages.

Must be called once during setup()

If address is left blank it will default to localhost (127.0.0.1) If scheduleTask is set to false, messages queued with queueMessage() will not be sent. Messages sent with sendMessageNow() will be sent. This can save CPU if messages only need to be sent during setup. scheduleTask defaults to true.

Parameters
portthe port used to send OSC messages
addressthe IP address OSC messages are sent to (defaults to 127.0.0.1)
scheduleTasksend queued messages (defaults to true)
Examples:
OSC/render.cpp.
void OSCClient::queueMessage ( oscpkt::Message  )

Queue an OSC message to be sent at the end of the current audio block.

This method is audio-thread safe, and can be used from render()

This is the function you would usually use to send OSC messages The messages are sent over UDP to the IP and port specified in setup()

Parameters
oscpkt::Messagean oscpkt Message object representing an OSC message
Examples:
OSC/render.cpp.
void OSCClient::sendMessageNow ( oscpkt::Message  )

Send an OSC message immediately *** do not use on audio thread! ***.

This method is not audio-thread safe, and can not be used from render()

This method can be used to send OSC messages during setup, or from an auxiliary task

Parameters
oscpkt::Messagean oscpkt Message object representing an OSC message
Examples:
OSC/render.cpp.

Member Data Documentation

OSCMessageFactory OSCClient::newMessage

Create a new oscpkt::Message object representing an OSC message.

This member is an instance of OSCMessageFactory, which can be used to build an OSC message. e.g: oscClient.queueMessage(oscClient.newMessage.to("/address").add(param).end())

Examples:
OSC/render.cpp.

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