20 #ifndef SOURCECONTROLLER_H_INCLUDED
21 #define SOURCECONTROLLER_H_INCLUDED
34 #define ABS(x) ((x) > 0 ? (x) : -(x))
119 std::shared_ptr<const SourceCollection>
getSources()
const;
148 bool setID(
int sourceID);
297 std::shared_ptr<const Room>
getRoom()
const;
310 std::unique_ptr<VisualStreamReceiver> server_;
311 std::unique_ptr<OscSenderThread> cWonder_;
312 std::unique_ptr<OscSenderThread> mCaster_;
313 std::unique_ptr<OscSenderThread> peerGroup_;
316 std::shared_ptr<SourceCollection> sources_;
320 std::shared_ptr<Room> room_;
323 bool linkedToWonder_;
333 float unnormalizedValue);
343 bool relevantChange(
int index);
371 void connectionLost(
const int connectionID);
376 int onSourceActivate(
int wondID);
378 int onSourceDeactivate(
int wondID);
380 int onSourcePosition(
int wondID,
float xPos,
float yPos);
382 int onSourceAngle(
int wondID,
float angle);
384 int onSourceType(
int wondID,
int type);
386 int onSourceName(
int wondID,
const std::string& sourceName);
388 int onSourceColor(
int wondID,
int r,
int g,
int b);
390 int onSourceGroupId(
int wondID,
int groupID)
393 int onSourceRotatingDirection(
int wondID,
int rotDir)
396 int onSourceScalingDirection(
int wondID,
int scalDir)
399 int onSourceDopplerEffect(
int wondID,
int doppler);
401 int onListenerPosition(
int listenerID,
float x,
float y)
404 int onGlobalMaxNoSources(
int maxSources);
406 int onGlobalRenderpolygon(Room& room);
408 int onProjectXmlDump(
int err,
const std::string& xmlDump);
410 int onStreamVisualPing(
int pingCount, OscSender* replyTo);
412 int onStreamVisualPong(
int pingCount){
return 0; }
414 int onStreamVisualConnect(OscSender* replyTo);
416 int onReply(std::string replyToMsg,
int state, std::string msg);
418 int onPluginStandalone(
bool standAloneOn);
425 #endif // SOURCECONTROLLER_H_INCLUDED
std::string connectionStatusString() const
Returns a string representation of the current status of the incoming "Visual Stream" connection...
Definition: SourceController.cpp:285
void setCoordinatesAndSendChange(float normalizedX, float normalizedY)
Sets the coordinates of the source that is controlled by this SourceController and sends them to cWON...
Definition: SourceController.cpp:159
Another listener interface especially for incoming ping messages.
Definition: VisualStreamReceiver.h:258
A factory class that creates VisualStreamReceiver instances.
Definition: VisualStreamReceiver.h:318
A listener interface that can be registered with the VisualStreamReceiver.
Definition: VisualStreamReceiver.h:64
std::string getCWonderHost() const
Returns the IP or hostname that is set for cWONDER.
Definition: SourceController.cpp:249
virtual void connectionLost()
Called when the (incoming data) connection is lost.
Definition: SourceController.h:75
const std::string getDataDestHostAndPort() const
Returns the Address where the WONDER control message are sent to.
Definition: SourceController.cpp:301
bool setCWonderAddress(const std::string &ip, const std::string &port)
Sets the address where outgoing OSC messages will be sent in "linked to WONDER" mode will be sent (i...
Definition: SourceController.cpp:239
ConnectionStates
An enum describing the differents states of an incoming connection.
Definition: WonderHeader.h:134
A class for connection timeout control.
Definition: PingControl.h:36
ConnectionStates connectionStatus() const
Returns the current status of the incoming connection.
Definition: SourceController.cpp:280
bool idIsLocked() const
Returns true if the source ID is locked.
Definition: SourceController.cpp:275
void setIdIsLocked(bool isLocked)
Sets the ID locked status.
Definition: SourceController.cpp:259
An interface for a thread implementing the OscSender interface.
Definition: OscSenderThread.h:38
A struct representing a (RGB) colour.
Definition: Colours.h:28
int rcvPort() const
Returns the port this instance is listening on.
Definition: SourceController.cpp:296
An interface for a factory class that creates ConnectionTimers.
Definition: ConnectionTimer.h:72
bool setID(int sourceID)
Sets the ID of the source that is controlled by this SourceController.
Definition: SourceController.cpp:108
AutomatedParameters
Parameters that can be automated by the host must be accessed using this enum.
Definition: Source.h:81
void setLinkedToWonder(bool linked, bool notifyPeers=true)
Sets whether this SourceController shall communicate with WONDER ("linked to wonder") or not...
Definition: SourceController.cpp:193
virtual ~Listener()
Destructor.
Definition: SourceController.h:55
A class containing the wonder-specific information about a room (name and vertices).
Definition: Room.h:35
void updateSourceName(const std::string &newSourceName)
Updates the name of the source that is controlled by this SourceController and sends out the correspo...
Definition: SourceController.cpp:177
SourceController(VisualStreamReceiver::Factory *vsFactory, Listener *listener, ConnectionTimer::Factory *timerFactory, XmlParser *xmlParser, int maxSources)
Constructor.
Definition: SourceController.cpp:24
An interface for a listener that listens to various callbacks triggered by incoming messages or conne...
Definition: SourceController.h:51
bool setSource(const Source &source)
Copies the parameters of a given Source object to the internal SourceCollection (overwriting the Sour...
Definition: SourceController.cpp:96
void updateSourceColour(const Colour colour)
Updates the colour of the source that is controlled by this SourceController and sends out the corres...
Definition: SourceController.cpp:185
void setParameterAndSendChange(int paramIndex, float normalizedValue)
Sets a parameter of the source that is controlled by this SourceController and sends it to cWONDER (i...
Definition: SourceController.cpp:118
virtual ~SourceController()
Destructor.
Definition: SourceController.cpp:63
std::string getCWonderPort() const
Returns the port that is set for cWONDER.
Definition: SourceController.cpp:254
void setRoom(const Room &room)
Sets the internal Room object to the parameters of a given Room object.
Definition: SourceController.cpp:311
A class for objects representing a WONDER source with all its properties.
Definition: Source.h:60
virtual void incomingParameterChange(Source::AutomatedParameters index, float newValue)=0
Called when one of the sources automatable parameters is changed by an incoming message.
bool isLinkedToWonder() const
Returns the linkedToWonder status.
Definition: SourceController.cpp:234
std::shared_ptr< const SourceCollection > getSources() const
Returns a (reference-counting) shared pointer to the SourceCollection object that is controlled by th...
Definition: SourceController.cpp:91
std::shared_ptr< const Room > getRoom() const
Returns a (reference-counting) shared pointer to the Room object stored internally.
Definition: SourceController.cpp:306
The main communication node that keeps track of all virtual sources and enables the host DAW to contr...
Definition: SourceController.h:42
A listener class for callbacks in case loss of connection is detected.
Definition: PingControl.h:44
const Source & getSource() const
Returns the Source object that is controlled by this SourceController.
Definition: SourceController.cpp:86
An interface defining a class that sets the parameters of one or several sources from an XML formatte...
Definition: XmlParser.h:30
Total number of (automated) parameters.
Definition: Source.h:89
virtual void incomingMaxNoSources(const int maxSources)
Called when the maximum number of sources allowed by the WONDER system has been received via the /glo...
Definition: SourceController.h:72