SPAOP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
wonder::OscSender Class Referenceabstract

An abstract class describing the interface for a class that sends out the WONDER-specific OSC-messages. More...

#include <OscSender.h>

Inheritance diagram for wonder::OscSender:
Inheritance graph
[legend]

Public Member Functions

virtual ~OscSender ()
 Destructor. More...
 
virtual void setAddress (const std::string &newHost, const std::string &newPort)=0
 Sets the destination address where this OscSender will send to. More...
 
virtual std::string url () const =0
 Returns an url representing the destination address where this OscSender will send to. More...
 
virtual std::string hostname () const =0
 Returns the hostname (or IP) of the destination address where this OscSender will send to. More...
 
virtual std::string port () const =0
 Returns the destination port (or service name) where this OscSender will send to. More...
 
virtual int getTtl () const =0
 Returns the time-to-live value for messages sent by this sender. More...
 
virtual void setTtl (uint8_t ttl)=0
 Sets the time-to-live value for messages sent by this sender. More...
 
virtual std::string getIface () const =0
 Returns the name of the network interface that will be used for sending messages. More...
 
virtual void setIfaceByIp (const std::string &ip)=0
 Sets the network interface to use for sending to this address by its IP. More...
 
virtual void sendSourceActivate (int sourceID)=0
 Sends the /WONDER/source/activate message. More...
 
virtual void sendSourceDeactivate (int sourceID)=0
 Sends the /WONDER/source/deactivate message. More...
 
virtual void sendSourceType (int sourceID, int type)=0
 Sends the /WONDER/source/type message. More...
 
virtual void sendSourcePosition (int sourceID, float x, float y)=0
 Sends the /WONDER/source/position message. More...
 
virtual void sendSourcePosition (int sourceID, float x, float y, float duration)=0
 Sends the /WONDER/source/position message with a duration parameter. More...
 
virtual void sendSourcePosition (int sourceID, float x, float y, float duration, float timestamp)=0
 Sends the /WONDER/source/position message with a duration and a timestamp parameter. More...
 
virtual void sendSourceAngle (int sourceID, float angle)=0
 Sends the /WONDER/source/angle message. More...
 
virtual void sendSourceName (int sourceID, const std::string &name)=0
 Sends the /WONDER/source/name message, changing the source's name. More...
 
virtual void sendSourceColor (int sourceID, uint8_t r, uint8_t g, uint8_t b)=0
 Sends the /WONDER/source/color message, changing the colour to be used for that source in any GUI. More...
 
virtual void sendSourceColor (int sourceID, Colour colour)
 Sends the /WONDER/source/color message, changing the colour to be used for that source in any GUI. More...
 
virtual void sendSourceRotatingDirection (int sourceID, int inverted)=0
 Sends the /WONDER/source/rotationDirection message, changing the rotation direction of the source. More...
 
virtual void sendSourceScalingDirection (int sourceID, int inverted)=0
 Sends the /WONDER/source/scalingDirection message, changing the scaling direction of the source. More...
 
virtual void sendSourceDopplerEffect (int sourceID, int on)=0
 Sends the /WONDER/source/dopplerEffect message, switching the doppler effect for this source on or off. More...
 
virtual void sendListenerPosition (int listenerID, float x, float y)=0
 Sends the /WONDER/listener/position message, changing the position of the listener which is used to determine which speakers are used for focused sources. More...
 
virtual void sendGlobalRenderpolygon (const std::string &roomName, int noOfVertices, Room::Vertex *vertices)=0
 Sends the /WONDER/global/renderpolygon message. More...
 
virtual void sendStreamVisualConnect ()=0
 Sends the /WONDER/stream/visual/connect message. More...
 
virtual void sendStreamVisualConnect (const std::string &name)=0
 Sends the /WONDER/stream/visual/connect message. More...
 
virtual void sendStreamVisualConnect (const std::string &host, const std::string &port)=0
 Sends the /WONDER/stream/visual/connect message. More...
 
virtual void sendStreamVisualDisconnect ()=0
 Sends the /WONDER/stream/visual/disconnect message. More...
 
virtual void sendStreamVisualPing (int count)=0
 Sends the /WONDER/stream/visual/ping message. More...
 
virtual void sendStreamVisualPong (int count)=0
 Sends the /WONDER/stream/visual/pong message. More...
 
virtual void sendReply (const std::string &replyToMessage, int state, const std::string &message)=0
 Sends the /WONDER/reply message. More...
 
virtual void sendProjectCreateWithScore (const std::string &projectName)=0
 Sends the /WONDER/project/createWithScore message. More...
 
virtual void sendProjectCreate (const std::string &projectName)=0
 Sends the /WONDER/project/create message. More...
 
virtual void sendProjectLoad (const std::string &projectName)=0
 Sends the /WONDER/project/load message. More...
 
virtual void sendProjectSave ()=0
 Sends the /WONDER/project/save message without a parameter. More...
 
virtual void sendProjectSave (const std::string &projectName)=0
 Sends the /WONDER/project/save message with a projectName parameter. More...
 
virtual void sendPluginStandalone (const bool standAlone)=0
 Sends the /WONDER/plugin/standalone message. More...
 
void sendFullSourceInfo (const Source &src)
 Sends out all source-related information for one Source object (type, position, angle, colour, doppler effect setting and name). More...
 

Detailed Description

An abstract class describing the interface for a class that sends out the WONDER-specific OSC-messages.

This seperates the actual OSC implementation from the WONDER-specific code and enables the developer to switch from one OSC implementation to another without touching the code within namespace wonder.

See Also
wonderlo::WonderOscSender (and further classesderived from it) for liblo-based implementations of this interface.
VisualStreamReceiver::createSender for an implementation-independent way to create instances of this interface.

Constructor & Destructor Documentation

virtual wonder::OscSender::~OscSender ( )
inlinevirtual

Destructor.

Member Function Documentation

virtual std::string wonder::OscSender::getIface ( ) const
pure virtual

Returns the name of the network interface that will be used for sending messages.

This is relevant for sending multicast messages.

Returns
The name of the network interface that will be used for sending to this address. Might be "(null)" if no interface has been set.

Implemented in wonderlo::WonderOscSender.

virtual int wonder::OscSender::getTtl ( ) const
pure virtual

Returns the time-to-live value for messages sent by this sender.

Returns
The time-to-live value for messages sent by this sender.

Implemented in wonderlo::WonderOscSender.

virtual std::string wonder::OscSender::hostname ( ) const
pure virtual

Returns the hostname (or IP) of the destination address where this OscSender will send to.

Returns
The hostname (or IP) of the destination address where this OscSender will send to.

Implemented in wonderlo::WonderOscSender.

virtual std::string wonder::OscSender::port ( ) const
pure virtual

Returns the destination port (or service name) where this OscSender will send to.

Returns
The destination port (or service name) where this OscSender will send to.

Implemented in wonderlo::WonderOscSender.

void wonder::OscSender::sendFullSourceInfo ( const Source src)
inline

Sends out all source-related information for one Source object (type, position, angle, colour, doppler effect setting and name).

Parameters
srcThe Source whose parameters shall be sent.
virtual void wonder::OscSender::sendGlobalRenderpolygon ( const std::string &  roomName,
int  noOfVertices,
Room::Vertex vertices 
)
pure virtual

Sends the /WONDER/global/renderpolygon message.

The message contains information about the positioning of the WFS speaker array of the current setup.

Parameters
roomNameA string containing the name of the transmitted room setup.
noOfVerticesThe number of vertices transmitted.
verticesAn array of three-dimensional vertex coordinates of noOfVertices length. The array is expected to be ordered in a way that vertices[x] and vertices[(x+1)noOfVertices()] are the two endpoints of an array of speakers.
See Also
Room

Implemented in wonderlo::WonderOscSender.

virtual void wonder::OscSender::sendListenerPosition ( int  listenerID,
float  x,
float  y 
)
pure virtual

Sends the /WONDER/listener/position message, changing the position of the listener which is used to determine which speakers are used for focused sources.

Parameters
listenerIDThe ID of the listener.
xThe x-coordinate of the listener's position.
yThe y-coordinate of the listener's position.
Warning
So far, this command is only supported by a version of WONDER developed at HAW Hamburg.

Implemented in wonderlo::WonderOscSender.

virtual void wonder::OscSender::sendPluginStandalone ( const bool  standAlone)
pure virtual

Sends the /WONDER/plugin/standalone message.

This is used to change the communication mode of the SourceController class: In "standalone" mode, the SourceController sends the source controlling messages to its peers (via multicast) only. If standalone is off ("linked to wonder" mode), the SourceController sends those messages to cWONDER.

Parameters
standAlonetrue for "standalone" mode, false for "linked to wonder" mode.

Implemented in wonderlo::WonderOscSender.

virtual void wonder::OscSender::sendProjectCreate ( const std::string &  projectName)
pure virtual

Sends the /WONDER/project/create message.

This tells cWONDER to create a new project (which does not include a score from the ScorePlayer).

Check the corresponding /WONDER/reply message for possible error codes. (Codes may be: 0 for success, 1 for empty project name, 2 for "project already exists, 3 for any other error (including file i/o)).

Parameters
projectNameThe name of the new project.

Implemented in wonderlo::WonderOscSender.

virtual void wonder::OscSender::sendProjectCreateWithScore ( const std::string &  projectName)
pure virtual

Sends the /WONDER/project/createWithScore message.

This tells cWONDER to create a new project that includes a score from the ScorePlayer.

Check the corresponding /WONDER/reply message for possible error codes. (Codes may be: 0 for success, 1 for empty project name, 2 for "project already exists, 3 for any other error (including file i/o)).

Parameters
projectNameThe name of the new project.

Implemented in wonderlo::WonderOscSender.

virtual void wonder::OscSender::sendProjectLoad ( const std::string &  projectName)
pure virtual

Sends the /WONDER/project/load message.

This tells cWONDER to restore an existing project.

Check the corresponding /WONDER/reply message for possible error codes. (Codes may be: 0 for success, 1 for "file not found", 2 or 3 for various project loading errors (see the message's string for details)).

Parameters
projectNameThe name of the project to be loaded.

Implemented in wonderlo::WonderOscSender.

virtual void wonder::OscSender::sendProjectSave ( )
pure virtual

Sends the /WONDER/project/save message without a parameter.

This tells cWONDER to store the current project under its current name.

Implemented in wonderlo::WonderOscSender.

virtual void wonder::OscSender::sendProjectSave ( const std::string &  projectName)
pure virtual

Sends the /WONDER/project/save message with a projectName parameter.

This tells cWONDER to store the current project under the given name.

Parameters
projectNameThe name under which the project shall be stored.

Implemented in wonderlo::WonderOscSender.

virtual void wonder::OscSender::sendReply ( const std::string &  replyToMessage,
int  state,
const std::string &  message 
)
pure virtual

Sends the /WONDER/reply message.

This is can be used for any replies to incoming messages, confirming successfull execution or transmitting an error message.

Parameters
replyToMessageThe OSC path of the message that triggered this reply.
state0 for confirmations of successfull operations, != 0 for error messages.
messageThe actual reply text.

Implemented in wonderlo::WonderOscSender.

virtual void wonder::OscSender::sendSourceActivate ( int  sourceID)
pure virtual

Sends the /WONDER/source/activate message.

This will activate the specified source within WONDER.

Parameters
sourceIDThe wonder-specific ID of the source to be activated. May range from 0 to N-1 where N is the total number of sources supported by the current WONDER installation.
See Also
sendSourceDeactivate

Implemented in wonderlo::WonderOscSender.

virtual void wonder::OscSender::sendSourceAngle ( int  sourceID,
float  angle 
)
pure virtual

Sends the /WONDER/source/angle message.

This sets a planewave source's direction.

Parameters
sourceIDThe wonder-specific ID of the source to be changed. May range from 0 to N-1 where N is the total number of sources supported by the current WONDER installation.
angleThe direction of the planewave source as an angle (in degrees). The zero degrees position is "to the right" (aka eastward aka 3 o'clock direction), an increase in angle rotates the direction clockwise.

Implemented in wonderlo::WonderOscSender.

virtual void wonder::OscSender::sendSourceColor ( int  sourceID,
uint8_t  r,
uint8_t  g,
uint8_t  b 
)
pure virtual

Sends the /WONDER/source/color message, changing the colour to be used for that source in any GUI.

Parameters
sourceIDThe wonder-specific ID of the source to be changed. May range from 0 to N-1 where N is the total number of sources supported by the current WONDER installation.
rThe red value of the new colour.
gThe green value of the new colour.
bThe blue value of the new colour.

Implemented in wonderlo::WonderOscSender.

virtual void wonder::OscSender::sendSourceColor ( int  sourceID,
Colour  colour 
)
inlinevirtual

Sends the /WONDER/source/color message, changing the colour to be used for that source in any GUI.

Parameters
sourceIDThe wonder-specific ID of the source to be changed. May range from 0 to N-1 where N is the total number of sources supported by the current WONDER installation.
colourThe new colour.
virtual void wonder::OscSender::sendSourceDeactivate ( int  sourceID)
pure virtual

Sends the /WONDER/source/deactivate message.

This will deactivate the specified source within WONDER.

Parameters
sourceIDThe wonder-specific ID of the source to be deactivated. May range from 0 to N-1 where N is the total number of sources supported by the current WONDER installation.
See Also
sendSourceActivate

Implemented in wonderlo::WonderOscSender.

virtual void wonder::OscSender::sendSourceDopplerEffect ( int  sourceID,
int  on 
)
pure virtual

Sends the /WONDER/source/dopplerEffect message, switching the doppler effect for this source on or off.

Parameters
sourceIDThe wonder-specific ID of the source to be changed. May range from 0 to N-1 where N is the total number of sources supported by the current WONDER installation.
on1 for on, 0 for off.

Implemented in wonderlo::WonderOscSender.

virtual void wonder::OscSender::sendSourceName ( int  sourceID,
const std::string &  name 
)
pure virtual

Sends the /WONDER/source/name message, changing the source's name.

The name is only relevant for UI representaions of the source, within the rendering, only the ID is used.

Parameters
sourceIDThe wonder-specific ID of the source to be changed. May range from 0 to N-1 where N is the total number of sources supported by the current WONDER installation.
nameThe new name of the source.

Implemented in wonderlo::WonderOscSender.

virtual void wonder::OscSender::sendSourcePosition ( int  sourceID,
float  x,
float  y 
)
pure virtual

Sends the /WONDER/source/position message.

This will set the source's position immediately.

Parameters
sourceIDThe wonder-specific ID of the source to be moved. May range from 0 to N-1 where N is the total number of sources supported by the current WONDER installation.
xThe x-axis coordinate (in meters).
yThe y-axis coordinate (in meters).

Implemented in wonderlo::WonderOscSender.

virtual void wonder::OscSender::sendSourcePosition ( int  sourceID,
float  x,
float  y,
float  duration 
)
pure virtual

Sends the /WONDER/source/position message with a duration parameter.

This will immediately make the source start move from its current position to the specified position where it will arrive within the specified duration.

Parameters
sourceIDThe wonder-specific ID of the source to be moved. May range from 0 to N-1 where N is the total number of sources supported by the current WONDER installation.
xThe x-axis coordinate (in meters).
yThe y-axis coordinate (in meters).
durationHow long it will take for the source to arrive at the specified position (in seconds).

Implemented in wonderlo::WonderOscSender.

virtual void wonder::OscSender::sendSourcePosition ( int  sourceID,
float  x,
float  y,
float  duration,
float  timestamp 
)
pure virtual

Sends the /WONDER/source/position message with a duration and a timestamp parameter.

This will make the source start move from its current position at the moment specified by the timestamp to the specified position where it will arrive within the specified duration.

Parameters
sourceIDThe wonder-specific ID of the source to be moved. May range from 0 to N-1 where N is the total number of sources supported by the current WONDER installation.
xThe x-axis coordinate (in meters).
yThe y-axis coordinate (in meters).
durationHow long it will take for the source to arrive at the specified position (in seconds).
timestampThe moment when the source will start to move (in seconds from "now" - "now" being the moment when this message is received by cWONDER).
Warning
For this command to work, an instance of the time base helper application jfWONDER must be running and connected to cWONDER. Generally, the WONDER system can be run without jfWONDER running - in that case, there is no time base and this command will never be executed. Since there are no warnings issued by cWONDER about jfWONDER not running, make sure that jfWONDER is running when using this command.

Implemented in wonderlo::WonderOscSender.

virtual void wonder::OscSender::sendSourceRotatingDirection ( int  sourceID,
int  inverted 
)
pure virtual

Sends the /WONDER/source/rotationDirection message, changing the rotation direction of the source.

As of WONDER version 3.1.0, this is only used by xWONDER in the context of rotating source groups.

Parameters
sourceIDThe wonder-specific ID of the source to be changed. May range from 0 to N-1 where N is the total number of sources supported by the current WONDER installation.
inverted1 for "inverted", 0 for "not inverted".

Implemented in wonderlo::WonderOscSender.

virtual void wonder::OscSender::sendSourceScalingDirection ( int  sourceID,
int  inverted 
)
pure virtual

Sends the /WONDER/source/scalingDirection message, changing the scaling direction of the source.

As of WONDER version 3.1.0, this is only used by xWONDER in the context of source groups.

Parameters
sourceIDThe wonder-specific ID of the source to be changed. May range from 0 to N-1 where N is the total number of sources supported by the current WONDER installation.
inverted1 for "inverted", 0 for "not inverted".

Implemented in wonderlo::WonderOscSender.

virtual void wonder::OscSender::sendSourceType ( int  sourceID,
int  type 
)
pure virtual

Sends the /WONDER/source/type message.

This will set the source's type (either "planewave" or "point").

Parameters
sourceIDThe wonder-specific ID of the source to be changed. May range from 0 to N-1 where N is the total number of sources supported by the current WONDER installation.
type0 for a planewave source, 1 for a point source.

Implemented in wonderlo::WonderOscSender.

virtual void wonder::OscSender::sendStreamVisualConnect ( )
pure virtual

Sends the /WONDER/stream/visual/connect message.

Once this is sent (to cWONDER), cWONDER will start sending the "visual stream" to the IP & port where this message was sent from.

Implemented in wonderlo::WonderOscSender.

virtual void wonder::OscSender::sendStreamVisualConnect ( const std::string &  name)
pure virtual

Sends the /WONDER/stream/visual/connect message.

Once this is sent (to cWONDER), cWONDER will start sending the "visual stream" to the IP & port where this message was sent from.

Parameters
nameA name that identifies the sender. cWONDER keeps a list of connected stream clients. This list will contain the client's IP & port along with this name.

Implemented in wonderlo::WonderOscSender.

virtual void wonder::OscSender::sendStreamVisualConnect ( const std::string &  host,
const std::string &  port 
)
pure virtual

Sends the /WONDER/stream/visual/connect message.

Once this is sent (to cWONDER), cWONDER will start sending the "visual stream" to the specified address

Parameters
hostA valid hostname. (Since cWONDER uses the liblo library for sending OSC, what exactly is supported (IPv6?) depends on the liblo version being used for the WONDER system in use.)
portA valid port. (Since cWONDER uses the liblo library for sending OSC, you should see the liblo documentation for details on what exactly is supported.)

Implemented in wonderlo::WonderOscSender.

virtual void wonder::OscSender::sendStreamVisualDisconnect ( )
pure virtual

Sends the /WONDER/stream/visual/disconnect message.

Once this is sent (to cWONDER), cWONDER is expected to stop sending the "visual stream" to the IP & port where this message was sent from.

Warning
Currently not supported by cWONDER. Although /WONDER/stream/visual/disconnect is listed in WONDER's OSC_and_Commandline_Overview.ods spreadsheet, the command isn't actually supported (at least not by WONDER version 3.1.0).

Implemented in wonderlo::WonderOscSender.

virtual void wonder::OscSender::sendStreamVisualPing ( int  count)
pure virtual

Sends the /WONDER/stream/visual/ping message.

This is sent by instances who send out a "visual stream" (like cWONDER or VisualHub).

Parameters
countAn integer value chosen by the sender.

Implemented in wonderlo::WonderOscSender.

virtual void wonder::OscSender::sendStreamVisualPong ( int  count)
pure virtual

Sends the /WONDER/stream/visual/pong message.

This is sent by clients who receive a "visual stream" as reply to /WONDER/stream/visual/ping.

Parameters
countThe integer value that was received with the incoming /WONDER/stream/visual/ping message.

Implemented in wonderlo::WonderOscSender.

virtual void wonder::OscSender::setAddress ( const std::string &  newHost,
const std::string &  newPort 
)
pure virtual

Sets the destination address where this OscSender will send to.

Parameters
newHostA valid hostname or ip string (what exactly is supported (IPv6?) may depend on what OSC library is used to implement this interface).
newPortA valid port number or service name (what exactly is supported may depend on what OSC library is used to implement this interface).

Implemented in wonderlo::WonderOscSender.

virtual void wonder::OscSender::setIfaceByIp ( const std::string &  ip)
pure virtual

Sets the network interface to use for sending to this address by its IP.

Parameters
ipThe IP of the local interface where the messages shall be sent from.

Implemented in wonderlo::WonderOscSender.

virtual void wonder::OscSender::setTtl ( uint8_t  ttl)
pure virtual

Sets the time-to-live value for messages sent by this sender.

This is required for sending UDP multicast messages.

Parameters
ttlThe time-to-live value for messages sent by this sender.

Implemented in wonderlo::WonderOscSender.

virtual std::string wonder::OscSender::url ( ) const
pure virtual

Returns an url representing the destination address where this OscSender will send to.

Returns
An url representing the destination address where this OscSender will send to.

Implemented in wonderlo::WonderOscSender.