Allolib
1.0
C++ Components For Interactive Multimedia
|
Public Member Functions | |
PresetServer (std::string oscAddress="127.0.0.1", int oscPort=9011) | |
PresetServer constructor. More... | |
PresetServer (ParameterServer ¶mServer) | |
using this constructor reuses the existing osc::Recv server from the ParameterServer object More... | |
void | print () |
print prints information about the server to std::out | |
void | stopServer () |
stopServer stops the OSC server thread. Calling this function is sometimes required when this object is destroyed abruptly and the destructor is not called | |
bool | serverRunning () |
void | allowStore (bool allow) |
bool | allowStore () |
virtual void | onMessage (osc::Message &m) |
Called for each message contained in packet. | |
PresetServer & | registerPresetHandler (PresetHandler &presetHandler) |
PresetServer & | operator<< (PresetHandler &presetHandler) |
void | setAddress (std::string address) |
std::string | getAddress () |
void | notifyPresetChange (bool notify) |
void | attachPacketHandler (osc::PacketHandler *handler) |
virtual void | addListener (std::string IPaddress, uint16_t oscPort) |
addListener enables notifiying via OSC that a preset has changed More... | |
void | notifyListeners (std::string OSCaddress, float value, ValueSource *src=nullptr) |
Notify the listeners of value changes. More... | |
void | notifyListeners (std::string OSCaddress, int value, ValueSource *src=nullptr) |
void | notifyListeners (std::string OSCaddress, std::string value, ValueSource *src=nullptr) |
void | notifyListeners (std::string OSCaddress, Vec3f value, ValueSource *src=nullptr) |
void | notifyListeners (std::string OSCaddress, Vec4f value, ValueSource *src=nullptr) |
void | notifyListeners (std::string OSCaddress, Pose value, ValueSource *src=nullptr) |
void | notifyListeners (std::string OSCaddress, Color value, ValueSource *src=nullptr) |
void | notifyListeners (std::string OSCaddress, ParameterMeta *param, ValueSource *src) |
void | send (osc::Packet &p) |
void | startHandshakeServer (std::string address="0.0.0.0") |
void | appendCommandHandler (osc::PacketHandler &handler) |
Static Protected Member Functions | |
static void | changeCallback (int value, void *sender, void *userData) |
Protected Attributes | |
std::mutex | mListenerLock |
std::vector< osc::Send * > | mOSCSenders |
std::vector< std::pair< std::string, int > > | mConnectedNodes |
al::OSCNotifier::HandshakeHandler | mHandshakeHandler |
osc::Recv | mHandshakeServer |
std::vector< std::pair< std::string, uint16_t > > | mNodes |
std::mutex | mNodeLock |
Definition at line 51 of file al_PresetServer.hpp.
al::PresetServer::PresetServer | ( | std::string | oscAddress = "127.0.0.1" , |
int | oscPort = 9011 |
||
) |
PresetServer constructor.
oscAddress | The network address on which to listen to. If empty use all available network interfaces. Defaults to "127.0.0.1". |
oscPort | The network port on which to listen. Defaults to 9011. |
al::PresetServer::PresetServer | ( | ParameterServer & | paramServer | ) |
using this constructor reuses the existing osc::Recv server from the ParameterServer object
paramServer | an existing ParameterServer object |
You will want to reuse an osc::Recv server when you want to expose the interface thorugh the same network port. Since network ports are exclusive, once a port is bound, it can't be used. You might need to expose the parameters on the same network port when using things like interface.simpleserver.js That must connect all interfaces to the same network port.
|
inlinevirtualinherited |
addListener enables notifiying via OSC that a preset has changed
IPaddress | The IP address of the listener |
oscPort | The network port so send the value changes on |
Definition at line 95 of file al_ParameterServer.hpp.
|
inherited |
Notify the listeners of value changes.
OSCaddress | The OSC path to send the value on |
value | The value to send |
This will send all registered data to the listeners. This is useful to force a resfresh of an interface, e.g. when it just came online and is unaware of state. Otherwise, when calling addListener, you should register to be notified when the data changes to only do notifications then.