NAP
Public Member Functions | Public Attributes | List of all members
OSCSender Class Reference

#include <oscsender.h>

Public Member Functions

 OSCSender ()=default
 
 OSCSender (OSCService &service)
 
virtual bool start (utility::ErrorState &errorState) override
 
virtual void stop () override
 
bool send (const OSCEvent &oscEvent)
 
void addEvent (OSCEventPtr oscEvent)
 
void sendQueuedEvents ()
 
- Public Member Functions inherited from Resource
 Resource ()
 
- Public Member Functions inherited from Object
 Object ()
 
virtual ~Object ()
 
virtual bool init (utility::ErrorState &errorState)
 
virtual void onDestroy ()
 
 Object (Object &)=delete
 
Objectoperator= (const Object &)=delete
 
 Object (Object &&)=delete
 
Objectoperator= (Object &&)=delete
 

Public Attributes

std::string mIPAddress = "127.0.0.1"
 Property: 'IpAddress' target machine ip address. More...
 
int mPort = 8000
 Property: 'Port' target machine port. More...
 
int mBufferScale = 2
 Property: 'Scale' scale factor applied to OSC message buffer. More...
 
- Public Attributes inherited from Object
std::string mID
 Property: 'mID' unique name of the object. Used as an identifier by the system. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Object
static bool isIDProperty (rtti::Instance &object, const rtti::Property &property)
 

Description

Sends a single OSC message or bundle of OSC messages. This device manages it's own connection and is constructed using a target ip address and port.

Inheritance diagram for OSCSender:
[legend]
Collaboration diagram for OSCSender:
[legend]

Constructor & Destructor Documentation

◆ OSCSender() [1/2]

OSCSender ( )
default

◆ OSCSender() [2/2]

OSCSender ( OSCService service)

Member Function Documentation

◆ addEvent()

void addEvent ( OSCEventPtr  oscEvent)

Adds an event to the queue This is more efficient than sending over an individual message Call send() to send over the queue as one message bundle

Parameters
oscEventthe event to add to the queue, note that the sender takes ownership of the event

◆ send()

bool send ( const OSCEvent oscEvent)

Sends an OSC message immediately without adding it to the queue Note that it's more efficient to add a message to the queue and send them as a bundle

Parameters
oscEventthe event to send

◆ sendQueuedEvents()

void sendQueuedEvents ( )

Sends all the osc events in the queue as a bundle All events that were send are removed from the queue

◆ start()

virtual bool start ( utility::ErrorState errorState)
overridevirtual

Constructs the host end point and communication socket.

Reimplemented from Device.

◆ stop()

virtual void stop ( )
overridevirtual

Deletes the communication socket

Reimplemented from Device.

Member Data Documentation

◆ mBufferScale

int mBufferScale = 2

Property: 'Scale' scale factor applied to OSC message buffer.

◆ mIPAddress

std::string mIPAddress = "127.0.0.1"

Property: 'IpAddress' target machine ip address.

◆ mPort

int mPort = 8000

Property: 'Port' target machine port.