|
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 |
A class for receiving OSC data. More...
#include "juce_OSCReceiver.h"
Classes | |
| class | Listener |
| A class for receiving OSC data from an OSCReceiver. More... | |
| class | ListenerWithOSCAddress |
| A class for receiving only those OSC messages from an OSCReceiver that match a given OSC address. More... | |
| struct | MessageLoopCallback |
| Use this struct as the template parameter for Listener and ListenerWithOSCAddress to receive incoming OSC data on the message thread. More... | |
| struct | Pimpl |
| struct | RealtimeCallback |
| Use this struct as the template parameter for Listener and ListenerWithOSCAddress to receive incoming OSC data immediately after it arrives, called directly on the network thread that listens to incoming OSC traffic. More... | |
Public Types | |
| using | FormatErrorHandler = std::function< void(const char *data, int dataSize)> |
| An error handler function for OSC format errors that can be called by the OSCReceiver. | |
Public Member Functions | |
| OSCReceiver () | |
| Creates an OSCReceiver. | |
| OSCReceiver (const String &threadName) | |
| Creates an OSCReceiver with a specific name for its thread. | |
| ~OSCReceiver () | |
| Destructor. | |
| bool | connect (int portNumber) |
| Connects to the specified UDP port using a datagram socket, and starts listening to OSC packets arriving on this port. | |
| bool | connectToSocket (DatagramSocket &socketToUse) |
| Connects to a UDP datagram socket that is already set up, and starts listening to OSC packets arriving on this port. | |
| bool | disconnect () |
| Disconnects from the currently used UDP port. | |
| void | addListener (Listener< MessageLoopCallback > *listenerToAdd) |
| Adds a listener that listens to OSC messages and bundles. | |
| void | addListener (Listener< RealtimeCallback > *listenerToAdd) |
| Adds a listener that listens to OSC messages and bundles. | |
| void | addListener (ListenerWithOSCAddress< MessageLoopCallback > *listenerToAdd, OSCAddress addressToMatch) |
| Adds a filtered listener that listens to OSC messages matching the address used to register the listener here. | |
| void | addListener (ListenerWithOSCAddress< RealtimeCallback > *listenerToAdd, OSCAddress addressToMatch) |
| Adds a filtered listener that listens to OSC messages matching the address used to register the listener here. | |
| void | removeListener (Listener< MessageLoopCallback > *listenerToRemove) |
| Removes a previously-registered listener. | |
| void | removeListener (Listener< RealtimeCallback > *listenerToRemove) |
| Removes a previously-registered listener. | |
| void | removeListener (ListenerWithOSCAddress< MessageLoopCallback > *listenerToRemove) |
| Removes a previously-registered listener. | |
| void | removeListener (ListenerWithOSCAddress< RealtimeCallback > *listenerToRemove) |
| Removes a previously-registered listener. | |
| void | registerFormatErrorHandler (FormatErrorHandler handler) |
| Installs a custom error handler which is called in case the receiver encounters a stream it cannot parse as an OSC bundle or OSC message. | |
Friends | |
| struct | OSCReceiverCallbackMessage |
A class for receiving OSC data.
An OSCReceiver object allows you to receive OSC bundles and messages. It can connect to a network port, receive incoming OSC packets from the network via UDP, parse them, and forward the included OSCMessage and OSCBundle objects to its listeners.
@tags{OSC}
Definition at line 40 of file juce_OSCReceiver.h.
| struct juce::OSCReceiver::MessageLoopCallback |
Use this struct as the template parameter for Listener and ListenerWithOSCAddress to receive incoming OSC data on the message thread.
This should be used by OSC callbacks that are not realtime-critical, but have significant work to do, for example updating Components in your app's user interface.
This is the default type of OSC listener.
Definition at line 85 of file juce_OSCReceiver.h.
| struct juce::OSCReceiver::RealtimeCallback |
Use this struct as the template parameter for Listener and ListenerWithOSCAddress to receive incoming OSC data immediately after it arrives, called directly on the network thread that listens to incoming OSC traffic.
This type can be used by OSC callbacks that don't do much, but are realtime-critical, for example, setting real-time audio parameters.
Definition at line 94 of file juce_OSCReceiver.h.
| using juce::OSCReceiver::FormatErrorHandler = std::function<void (const char* data, int dataSize)> |
An error handler function for OSC format errors that can be called by the OSCReceiver.
The arguments passed are the pointer to and the data of the buffer that the OSCReceiver has failed to parse.
Definition at line 205 of file juce_OSCReceiver.h.
| juce::OSCReceiver::OSCReceiver | ( | ) |
Creates an OSCReceiver.
Definition at line 592 of file juce_OSCReceiver.cpp.
Creates an OSCReceiver with a specific name for its thread.
Definition at line 588 of file juce_OSCReceiver.cpp.
| juce::OSCReceiver::~OSCReceiver | ( | ) |
Destructor.
Definition at line 596 of file juce_OSCReceiver.cpp.
| void juce::OSCReceiver::addListener | ( | OSCReceiver::Listener< MessageLoopCallback > * | listenerToAdd | ) |
Adds a listener that listens to OSC messages and bundles.
This listener will be called on the application's message loop.
Definition at line 616 of file juce_OSCReceiver.cpp.
| void juce::OSCReceiver::addListener | ( | Listener< RealtimeCallback > * | listenerToAdd | ) |
Adds a listener that listens to OSC messages and bundles.
This listener will be called in real-time directly on the network thread that receives OSC data.
Definition at line 621 of file juce_OSCReceiver.cpp.
| void juce::OSCReceiver::addListener | ( | ListenerWithOSCAddress< MessageLoopCallback > * | listenerToAdd, |
| OSCAddress | addressToMatch | ||
| ) |
Adds a filtered listener that listens to OSC messages matching the address used to register the listener here.
The listener will be called on the application's message loop.
Definition at line 626 of file juce_OSCReceiver.cpp.
| void juce::OSCReceiver::addListener | ( | ListenerWithOSCAddress< RealtimeCallback > * | listenerToAdd, |
| OSCAddress | addressToMatch | ||
| ) |
Adds a filtered listener that listens to OSC messages matching the address used to register the listener here.
The listener will be called on the application's message loop.
Definition at line 631 of file juce_OSCReceiver.cpp.
Connects to the specified UDP port using a datagram socket, and starts listening to OSC packets arriving on this port.
Definition at line 601 of file juce_OSCReceiver.cpp.
| bool juce::OSCReceiver::connectToSocket | ( | DatagramSocket & | socketToUse | ) |
Connects to a UDP datagram socket that is already set up, and starts listening to OSC packets arriving on this port.
Make sure that the object you give it doesn't get deleted while this object is still using it!
Definition at line 606 of file juce_OSCReceiver.cpp.
| bool juce::OSCReceiver::disconnect | ( | ) |
Disconnects from the currently used UDP port.
Definition at line 611 of file juce_OSCReceiver.cpp.
| void juce::OSCReceiver::registerFormatErrorHandler | ( | FormatErrorHandler | handler | ) |
Installs a custom error handler which is called in case the receiver encounters a stream it cannot parse as an OSC bundle or OSC message.
By default (i.e. if you never use this method), in case of a parsing error nothing happens and the invalid packet is simply discarded.
Definition at line 656 of file juce_OSCReceiver.cpp.
| void juce::OSCReceiver::removeListener | ( | Listener< MessageLoopCallback > * | listenerToRemove | ) |
Removes a previously-registered listener.
Definition at line 636 of file juce_OSCReceiver.cpp.
| void juce::OSCReceiver::removeListener | ( | Listener< RealtimeCallback > * | listenerToRemove | ) |
Removes a previously-registered listener.
Definition at line 641 of file juce_OSCReceiver.cpp.
| void juce::OSCReceiver::removeListener | ( | ListenerWithOSCAddress< MessageLoopCallback > * | listenerToRemove | ) |
Removes a previously-registered listener.
Definition at line 646 of file juce_OSCReceiver.cpp.
| void juce::OSCReceiver::removeListener | ( | ListenerWithOSCAddress< RealtimeCallback > * | listenerToRemove | ) |
Removes a previously-registered listener.
Definition at line 651 of file juce_OSCReceiver.cpp.
|
friend |
Definition at line 219 of file juce_OSCReceiver.h.