libAlgAudio  v1.99-440-g08538e5-dirty
The development library for AlgAudio framework.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AlgAudio::OSC Class Reference

#include <OSC.hpp>

Public Member Functions

void AddMethodHandler (std::string path, std::function< void(lo::Message)>)
 
 OSC (std::string address, std::string port)
 
void Send (std::string path)
 
void Send (std::string path, lo::Message)
 
void Send (std::string path, std::function< void(lo::Message)> reply_action, lo::Message)
 
void TriggerReplies ()
 
 ~OSC ()
 

Detailed Description

This is a wrapper class for managing OSC client an server. If you wish to communicate with SuperCollider, use SCLang class instead (it has its own OSC instance). Use this class if you wish to open a completely separate OSC connection and manage it on your own.

Constructor & Destructor Documentation

AlgAudio::OSC::OSC ( std::string  address,
std::string  port 
)
AlgAudio::OSC::~OSC ( )

Member Function Documentation

void AlgAudio::OSC::AddMethodHandler ( std::string  path,
std::function< void(lo::Message)>   
)

Adds a new method handler. This function will be called when an OSC message is received on the chosen path. The handler will not be called immediatelly, instead the main thread will call it soon after. This way you can assume your handler will be always called by the main thread.

void AlgAudio::OSC::Send ( std::string  path)
void AlgAudio::OSC::Send ( std::string  path,
lo::Message   
)
void AlgAudio::OSC::Send ( std::string  path,
std::function< void(lo::Message)>  reply_action,
lo::Message   
)
void AlgAudio::OSC::TriggerReplies ( )

Called by the main thread when new OSC replies are ready to process. The server thread cannot interact with the application, so it stores functions it would like to call into a list, and then the main thread calls them using this method.


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