Vuo  2.3.2
Classes | Typedefs | Functions | Variables
VuoOsc.cc File Reference

Description

VuoOsc implementation.

Definition in file VuoOsc.cc.

Go to the source code of this file.

Classes

class  VuoOscInPacketListener
 This class maintains a list of trigger functions to be called when an OSC message is received. More...
 
class  VuoOscInSocket
 Opens a reusable UDP socket, attaches the specified listener to it (on a separate thread), and starts it receiving messages. More...
 
struct  VuoOscIn_internal
 Private data for a VuoOscIn instance. More...
 
class  VuoOscOutputIdentifier
 Enable VuoOscOutputDevice to be used in std::map. More...
 

Typedefs

typedef void(* VuoOscReceivedMessageTrigger) (VuoOscMessage)
 A node's trigger method, to be called when an OSC message is received. More...
 
typedef struct _VuoOscOut_internal * VuoOscOut_internal
 Private data for a VuoOscOut instance. More...
 

Functions

static void registerCallback (CFNetServiceRef theService, CFStreamError *error, void *info)
 Callback needed to asynchronously register a CFNetService. More...
 
static CFNetServiceRef VuoOsc_createNetService (char *name, int port, bool isServer)
 Creates a new CFNetService for advertising an OSC server or client. More...
 
static void VuoOsc_destroyNetService (CFNetServiceRef netService)
 Stop advertising the Bonjour service. More...
 
void VuoOscIn_destroy (VuoOscIn oi)
 Destroys an OSC server. More...
 
VuoOscIn VuoOscIn_make (const VuoOscInputDevice device)
 Creates a reference-counted object to manage receiving messages from a OSC device. More...
 
void VuoOscIn_enableTriggers (VuoOscIn oi, VuoOutputTrigger(receivedMessage, VuoOscMessage))
 Sets up the OSC server to call the trigger functions when it receives a message. More...
 
void VuoOscIn_disableTriggers (VuoOscIn oi)
 Stops the OSC server from calling trigger functions when it receives a message. More...
 
static int VuoOsc_findAvailableUdpPort (void)
 Returns an available UDP port. More...
 
VuoOscOut VuoOscOut_getShared (const VuoOscOutputDevice device)
 Returns the reference-counted object for the specified OSC output device. More...
 
void VuoOscOut_sendMessages (VuoOscOut ao, VuoList_VuoOscMessage messages)
 Sends a message to the specified OSC device. More...
 
 VUOKEYEDPOOL (VuoOscOutputIdentifier, VuoOscOut_internal)
 VuoKeyedPool_VuoOscOut. More...
 
static void VuoOscOut_destroy (VuoOscOut_internal ai)
 VuoKeyedPool_VuoOscOut. More...
 
VuoOscOut_internal VuoOscOut_make (VuoOscOutputIdentifier device)
 VuoKeyedPool_VuoOscOut. More...
 
 VUOKEYEDPOOL_DEFINE (VuoOscOutputIdentifier, VuoOscOut_internal, VuoOscOut_make)
 VuoKeyedPool_VuoOscOut. More...
 

Variables

std::map< unsigned int, VuoOscInSocket * > VuoOscInPool
 Sockets, keyed by port. More...
 
dispatch_semaphore_t VuoOscInPool_semaphore = NULL
 Synchronizes access to VuoOscInPool. More...
 

Class Documentation

◆ VuoOscIn_internal

struct VuoOscIn_internal
Class Members
VuoOscInputDevice device The port to listen on, and the name of the Bonjour service.
VuoOscReceivedMessageTrigger receivedMessage The trigger function to call when a newly-arrived OSC message has been parsed.

Typedef Documentation

◆ VuoOscOut_internal

typedef struct _VuoOscOut_internal * VuoOscOut_internal

Private data for a VuoOscOut instance.

◆ VuoOscReceivedMessageTrigger

typedef void(* VuoOscReceivedMessageTrigger) (VuoOscMessage)

A node's trigger method, to be called when an OSC message is received.

Definition at line 50 of file VuoOsc.cc.

Function Documentation

◆ registerCallback()

static void registerCallback ( CFNetServiceRef  theService,
CFStreamError *  error,
void *  info 
)
static

Callback needed to asynchronously register a CFNetService.

Apparently this doesn't need to do anything.

Definition at line 196 of file VuoOsc.cc.

◆ VUOKEYEDPOOL()

VUOKEYEDPOOL ( VuoOscOutputIdentifier  ,
VuoOscOut_internal   
)

VuoKeyedPool_VuoOscOut.

◆ VUOKEYEDPOOL_DEFINE()

VUOKEYEDPOOL_DEFINE ( VuoOscOutputIdentifier  ,
VuoOscOut_internal  ,
VuoOscOut_make   
)

VuoKeyedPool_VuoOscOut.

◆ VuoOsc_createNetService()

static CFNetServiceRef VuoOsc_createNetService ( char *  name,
int  port,
bool  isServer 
)
static

Creates a new CFNetService for advertising an OSC server or client.

Definition at line 203 of file VuoOsc.cc.

◆ VuoOsc_destroyNetService()

static void VuoOsc_destroyNetService ( CFNetServiceRef  netService)
static

Stop advertising the Bonjour service.

Definition at line 255 of file VuoOsc.cc.

◆ VuoOsc_findAvailableUdpPort()

static int VuoOsc_findAvailableUdpPort ( void  )
static

Returns an available UDP port.

Definition at line 577 of file VuoOsc.cc.

◆ VuoOscIn_destroy()

void VuoOscIn_destroy ( VuoOscIn  oi)

Destroys an OSC server.

Definition at line 512 of file VuoOsc.cc.

◆ VuoOscIn_disableTriggers()

void VuoOscIn_disableTriggers ( VuoOscIn  oi)

Stops the OSC server from calling trigger functions when it receives a message.

This function may be called from any thread.

Definition at line 492 of file VuoOsc.cc.

◆ VuoOscIn_enableTriggers()

void VuoOscIn_enableTriggers ( VuoOscIn  oi,
VuoOutputTrigger(receivedMessage, VuoOscMessage  
)

Sets up the OSC server to call the trigger functions when it receives a message.

This function may be called from any thread.

Definition at line 467 of file VuoOsc.cc.

◆ VuoOscIn_make()

VuoOscIn VuoOscIn_make ( const VuoOscInputDevice  device)

Creates a reference-counted object to manage receiving messages from a OSC device.

If the device's port is nonzero, attempts to use the specified port. If zero, automatically chooses an unused port. If the port is successfully opened, advertises the server via Bonjour.

Definition at line 436 of file VuoOsc.cc.

◆ VuoOscOut_destroy()

static void VuoOscOut_destroy ( VuoOscOut_internal  ai)
static

VuoKeyedPool_VuoOscOut.

Definition at line 702 of file VuoOsc.cc.

◆ VuoOscOut_getShared()

VuoOscOut VuoOscOut_getShared ( const VuoOscOutputDevice  device)

Returns the reference-counted object for the specified OSC output device.

Definition at line 725 of file VuoOsc.cc.

◆ VuoOscOut_make()

VuoOscOut_internal VuoOscOut_make ( VuoOscOutputIdentifier  device)

VuoKeyedPool_VuoOscOut.

Definition at line 615 of file VuoOsc.cc.

◆ VuoOscOut_sendMessages()

void VuoOscOut_sendMessages ( VuoOscOut  ao,
VuoList_VuoOscMessage  messages 
)

Sends a message to the specified OSC device.

Definition at line 733 of file VuoOsc.cc.

Variable Documentation

◆ VuoOscInPool

std::map<unsigned int, VuoOscInSocket *> VuoOscInPool

Sockets, keyed by port.

Definition at line 409 of file VuoOsc.cc.

◆ VuoOscInPool_semaphore

dispatch_semaphore_t VuoOscInPool_semaphore = NULL

Synchronizes access to VuoOscInPool.

Definition at line 410 of file VuoOsc.cc.