Static Public Member Functions | Static Public Attributes

MoNet Class Reference

Osc networking (static class). More...

#include <mo_net.h>

List of all members.

Static Public Member Functions

static void addAddressCallback (const std::string pattern, const MoNetReceiveCallback &callback, void *data=NULL)
 Register callbacks to handle specific pattern address (messages).
static void removeAddressCallback (const std::string pattern)
 Unregister callbacks to handle specific pattern address (messages).
static void setListeningPort (long port)
 Setter for the listening port.
static long getListeningPort ()
 Getter for the listening port.
static void startListening ()
 Start the thread that listens to incoming OSC messages.
static void stopListening ()
 Stop the thread that listens to incoming OSC messages.
static void sendMessage (const std::string &ip, uint port, const std::string &pattern_address, char types[], uint size,...)
static std::string getMyIPaddress ()
 Get the IP address of the device.
static void clearCache ()
 clear the cache of addressess

Static Public Attributes

static std::map< std::string,
MoNetCallback
m_pattern_callbacks
static std::map< std::string,
UdpTransmitSocket * > 
m_cache
 hash-map to cache sockest associated to remote machines

Detailed Description

Osc networking (static class).

Sample Code:

MoNet::addAddressCallback( "/MoMu/NoteOn", noteOnCallback, NULL );

MoNet::startListening();


Member Function Documentation

void MoNet::addAddressCallback ( const std::string  pattern,
const MoNetReceiveCallback callback,
void *  data = NULL 
) [static]

Register callbacks to handle specific pattern address (messages).

void MoNet::clearCache (  )  [static]

clear the cache of addressess

long MoNet::getListeningPort (  )  [static]

Getter for the listening port.

std::string MoNet::getMyIPaddress (  )  [static]

Get the IP address of the device.

void MoNet::removeAddressCallback ( const std::string  pattern  )  [static]

Unregister callbacks to handle specific pattern address (messages).

void MoNet::sendMessage ( const std::string &  ip,
uint  port,
const std::string &  pattern_address,
char  types[],
uint  size,
  ... 
) [static]

Sends an OSC message with variable number and type of arguments

'ip' is a string with the destination ip ( e.g, "127.0.0.1" ) 'port' is the destination port ( e.g. 8888 ) 'pattern_address' is the pattern of the message ( e.g. /momu/test ) 'types' is and array of chars cointaining the types of the different OSC variables to be send. It can be defined as: char types[num_vars] = {'i', 'f', 's'}; 'size' is the number of variables to be send ( must be the same length as the types array. After the 'size' argument, a comma separated list of varibles to be sent, must be provided. The order must be the same as the order specified in the types array

void MoNet::setListeningPort ( long  port  )  [static]

Setter for the listening port.

void MoNet::startListening (  )  [static]

Start the thread that listens to incoming OSC messages.

void MoNet::stopListening (  )  [static]

Stop the thread that listens to incoming OSC messages.


Member Data Documentation

std::map< std::string, UdpTransmitSocket * > MoNet::m_cache [static]

hash-map to cache sockest associated to remote machines

std::map< std::string, MoNetCallback > MoNet::m_pattern_callbacks [static]

List of pattern addresses ( key ) and respective callbacks ( value ) TODO: this should be private ( and static ), but then it was harder to get acces to it from MoNetOSCPacketListener


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines