SPAOP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | List of all members
wonderlo::StreamMulticaster Class Reference

A StreamMulticaster forwards any OSC messages that are sent to its StreamInPort to a multicast group. More...

#include <StreamMulticaster.h>

Public Member Functions

 StreamMulticaster (const std::string &sourceHost, const std::string &sourcePort, const std::string &mcGroup, const std::string &mcPort, const std::string &mcIfaceIp, const std::string &connectPort, const std::string &streamInPort, const std::string &streamName, const uint8_t ttl=VISUAL_MC_TTL)
 Constructor. More...
 
virtual ~StreamMulticaster ()
 Destructor. More...
 
int getConnectPort () const
 Returns the port where incoming connect messages may be sent to. More...
 
int getStreamInPort () const
 Returns the port where the incoming stream is recieved. More...
 
std::string getStreamSourceHost () const
 Returns the hostname of the stream source (i.e. More...
 
std::string getStreamSourcePort () const
 Returns the port of the stream source (i.e. More...
 
std::string getMulticastGroup () const
 Returns the IP of the multicast group. More...
 
std::string getMulticastPort () const
 Returns the port of the multicast group. More...
 
std::string getMulticastIface () const
 Returns the interface identifier for the network interface used for sending to the multicast group. More...
 

Static Public Member Functions

static int main (const std::string &cWonderAddr="", const std::string &type="visual")
 A function that starts a StreamMulticaster-instance. More...
 

Detailed Description

A StreamMulticaster forwards any OSC messages that are sent to its StreamInPort to a multicast group.

Its purpose is to connect to one of WONDER's OSC "streams" ("visual" / "timer" / "render" / "score") and forward the stream to multiple recievers.

Two threads listen on two ports:

Constructor & Destructor Documentation

wonderlo::StreamMulticaster::StreamMulticaster ( const std::string &  sourceHost,
const std::string &  sourcePort,
const std::string &  mcGroup,
const std::string &  mcPort,
const std::string &  mcIfaceIp,
const std::string &  connectPort,
const std::string &  streamInPort,
const std::string &  streamName,
const uint8_t  ttl = VISUAL_MC_TTL 
)

Constructor.

Parameters
sourceHostThe hostname/IP of cWONDER.
sourcePortThe port of cWONDER.
mcGroupThe IP of the multicast group that the stream shall be forwarded to.
mcPortThe port of the multicast group that the stream shall be forwarded to.
mcIfaceIpThe IP of the local interface where the multicast messages shall be sent from.
connectPortThe port to be used for incoming /WONDER/stream/streamName/connect messages.
streamInPortThe port to be used for recieving the incoming stream.
streamNameThe name of the stream that shall be forwarded. As of WONDER version 3.1.0, this can be "visual", "timer", "render" or "score".
ttlThe time-to-live value for the messages sent to the multicast group.
wonderlo::StreamMulticaster::~StreamMulticaster ( )
virtual

Destructor.

Member Function Documentation

int wonderlo::StreamMulticaster::getConnectPort ( ) const

Returns the port where incoming connect messages may be sent to.

Returns
The port where incoming connect messages may be sent to.
std::string wonderlo::StreamMulticaster::getMulticastGroup ( ) const

Returns the IP of the multicast group.

Returns
The IP of the multicast group.
std::string wonderlo::StreamMulticaster::getMulticastIface ( ) const

Returns the interface identifier for the network interface used for sending to the multicast group.

Returns
The interface identifier for the network interface used for sending to the multicast group.
std::string wonderlo::StreamMulticaster::getMulticastPort ( ) const

Returns the port of the multicast group.

Returns
The port of the multicast group.
int wonderlo::StreamMulticaster::getStreamInPort ( ) const

Returns the port where the incoming stream is recieved.

Returns
The port where the incoming stream is recieved.
std::string wonderlo::StreamMulticaster::getStreamSourceHost ( ) const

Returns the hostname of the stream source (i.e.

cWONDER).

Returns
The hostname of the stream source (i.e. cWONDER).
std::string wonderlo::StreamMulticaster::getStreamSourcePort ( ) const

Returns the port of the stream source (i.e.

cWONDER).

Returns
The port of the stream source (i.e. cWONDER).
int wonderlo::StreamMulticaster::main ( const std::string &  cWonderAddr = "",
const std::string &  type = "visual" 
)
static

A function that starts a StreamMulticaster-instance.

Network-addresses are used as defined in WonderHeader.h, the address of cWONDER can be passed as parameter. This is meant as an OS-independent main function (to be called from the "real" main).

Parameters
cWonderAddrA string of the format "ip:port" that will be used as the address for cWONDER. If an empty string is passed, the default address from WonderHeader.h will be used.
typeThe type of the stream to be forwarded ("visual" / "timer" / "render" / "score")
Returns
0 on success, -1 on failure.