JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
juce::OSCSender Class Reference

An OSC message sender. More...

#include "juce_OSCSender.h"

Classes

struct  Pimpl
 

Public Member Functions

 OSCSender ()
 Constructs a new OSCSender.
 
 ~OSCSender ()
 Destructor.
 
bool connect (const String &targetHostName, int targetPortNumber)
 Connects to a datagram socket and prepares the socket for sending OSC packets to the specified target.
 
bool connectToSocket (DatagramSocket &socket, const String &targetHostName, int targetPortNumber)
 Uses an existing datagram socket for sending OSC packets to the specified target.
 
bool disconnect ()
 Disconnects from the currently used UDP port.
 
bool send (const OSCMessage &message)
 Sends an OSC message to the target.
 
bool send (const OSCBundle &bundle)
 Send an OSC bundle to the target.
 
bool sendToIPAddress (const String &targetIPAddress, int targetPortNumber, const OSCMessage &message)
 Sends an OSC message to a specific IP address and port.
 
bool sendToIPAddress (const String &targetIPAddress, int targetPortNumber, const OSCBundle &bundle)
 Sends an OSC bundle to a specific IP address and port.
 
template<typename... Args>
bool send (const OSCAddressPattern &address, Args &&... args)
 Creates a new OSC message with the specified address pattern and list of arguments, and sends it to the target.
 
template<typename... Args>
bool sendToIPAddress (const String &targetIPAddress, int targetPortNumber, const OSCAddressPattern &address, Args &&... args)
 Creates a new OSC message with the specified address pattern and list of arguments, and sends it to the target.
 

Detailed Description

An OSC message sender.

An OSCSender object can connect to a network port. It then can send OSC messages and bundles to a specified host over an UDP socket.

@tags{OSC}

Definition at line 38 of file juce_OSCSender.h.

Constructor & Destructor Documentation

◆ OSCSender()

juce::OSCSender::OSCSender ( )

Constructs a new OSCSender.

Definition at line 301 of file juce_OSCSender.cpp.

◆ ~OSCSender()

juce::OSCSender::~OSCSender ( )

Destructor.

Definition at line 305 of file juce_OSCSender.cpp.

Member Function Documentation

◆ connect()

bool juce::OSCSender::connect ( const String targetHostName,
int  targetPortNumber 
)

Connects to a datagram socket and prepares the socket for sending OSC packets to the specified target.

Note: The operating system will choose which specific network adapter(s) to bind your socket to, and which local port to use for the sender.

Parameters
targetHostNameThe remote host to which messages will be send.
targetPortNumberThe remote UDP port number on which the host will receive the messages.
Returns
true if the connection was successful; false otherwise.
See also
send, disconnect.

Definition at line 312 of file juce_OSCSender.cpp.

◆ connectToSocket()

bool juce::OSCSender::connectToSocket ( DatagramSocket socket,
const String targetHostName,
int  targetPortNumber 
)

Uses an existing datagram socket for sending OSC packets to the specified target.

Parameters
socketAn existing datagram socket. Make sure this doesn't get deleted while this class is still using it!
targetHostNameThe remote host to which messages will be send.
targetPortNumberThe remote UDP port number on which the host will receive the messages.
Returns
true if the connection was successful; false otherwise.
See also
connect, send, disconnect.

Definition at line 317 of file juce_OSCSender.cpp.

◆ disconnect()

bool juce::OSCSender::disconnect ( )

Disconnects from the currently used UDP port.

Returns
true if the disconnection was successful; false otherwise.
See also
connect.

Definition at line 322 of file juce_OSCSender.cpp.

◆ send() [1/3]

template<typename... Args>
bool juce::OSCSender::send ( const OSCAddressPattern address,
Args &&...  args 
)

Creates a new OSC message with the specified address pattern and list of arguments, and sends it to the target.

Parameters
addressThe OSC address pattern of the message (you can use a string literal here).
argsThe list of arguments for the message.

Definition at line 151 of file juce_OSCSender.h.

◆ send() [2/3]

bool juce::OSCSender::send ( const OSCBundle bundle)

Send an OSC bundle to the target.

Parameters
bundleThe OSC bundle to send.
Returns
true if the operation was successful.

Definition at line 329 of file juce_OSCSender.cpp.

◆ send() [3/3]

bool juce::OSCSender::send ( const OSCMessage message)

Sends an OSC message to the target.

Parameters
messageThe OSC message to send.
Returns
true if the operation was successful.

Definition at line 328 of file juce_OSCSender.cpp.

◆ sendToIPAddress() [1/3]

template<typename... Args>
bool juce::OSCSender::sendToIPAddress ( const String targetIPAddress,
int  targetPortNumber,
const OSCAddressPattern address,
Args &&...  args 
)

Creates a new OSC message with the specified address pattern and list of arguments, and sends it to the target.

Parameters
targetIPAddressThe IP address to send to
targetPortNumberThe target port number
addressThe OSC address pattern of the message (you can use a string literal here).
argsThe list of arguments for the message.

Definition at line 157 of file juce_OSCSender.h.

◆ sendToIPAddress() [2/3]

bool juce::OSCSender::sendToIPAddress ( const String targetIPAddress,
int  targetPortNumber,
const OSCBundle bundle 
)

Sends an OSC bundle to a specific IP address and port.

This overrides the address and port that was originally set for this sender.

Parameters
targetIPAddressThe IP address to send to
targetPortNumberThe target port number
bundleThe OSC bundle to send.
Returns
true if the operation was successful.

Definition at line 332 of file juce_OSCSender.cpp.

◆ sendToIPAddress() [3/3]

bool juce::OSCSender::sendToIPAddress ( const String targetIPAddress,
int  targetPortNumber,
const OSCMessage message 
)

Sends an OSC message to a specific IP address and port.

This overrides the address and port that was originally set for this sender.

Parameters
targetIPAddressThe IP address to send to
targetPortNumberThe target port number
messageThe OSC message to send.
Returns
true if the operation was successful.

Definition at line 331 of file juce_OSCSender.cpp.


The documentation for this class was generated from the following files: