com.krisharris.mpk
Class MCProcessingConnect

java.lang.Object
  extended by com.krisharris.mpk.MCProcessingConnect

public class MCProcessingConnect
extends java.lang.Object

This class allows you to communicate with a number of Making Things interface boards via the mchelper application

In your host PApplet - in processing the top level of your sketch you can define the following functions

public void OSCMessage(OSCMessage m)
This will be called each time a message is received from any connected board

public void boardAdd(Board b)
This will be called each time a board is connected

public void boardRemove(Board b)
This will be called each time a board is removed

Author:
Kristopf

Constructor Summary
MCProcessingConnect(processing.core.PApplet _parent)
          Start & Connect to mchelper at 127.0.0.1:11000
MCProcessingConnect(processing.core.PApplet _parent, java.lang.String mchelper_address)
          Start & Connect to mchelper at a specified IP address, port 11000
MCProcessingConnect(processing.core.PApplet _parent, java.lang.String mchelper_address, int port)
          Start & Connect to mchelper at a specified port and address
 
Method Summary
 void dispose()
          Called Internaly by processing.
 java.util.Vector getConnectedBoards()
          Returns a Vector of boards mchelper knows about.
 Board getDefaultBoard()
          Returns the default board
 void post()
          Called internally by processing.
 void pre()
          Called internally by processing.
 void sendMessage(Board dest, java.lang.String message, java.util.Vector args)
          Send an OSC Message imediately, without adding it to the queue
 void sendMessage(java.lang.String message, java.util.Vector args)
          Send an OSC Message
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MCProcessingConnect

public MCProcessingConnect(processing.core.PApplet _parent)
Start & Connect to mchelper at 127.0.0.1:11000

Parameters:
_parent - in processing, just pass this

MCProcessingConnect

public MCProcessingConnect(processing.core.PApplet _parent,
                           java.lang.String mchelper_address)
Start & Connect to mchelper at a specified IP address, port 11000

Parameters:
_parent - in processing, just pass this
mchelper_address - the address mchelper is running on

MCProcessingConnect

public MCProcessingConnect(processing.core.PApplet _parent,
                           java.lang.String mchelper_address,
                           int port)
Start & Connect to mchelper at a specified port and address

Parameters:
_parent - in processing, just pass this
mchelper_address - the address mchelper is running on
port - the port to connect to
Method Detail

pre

public void pre()
Called internally by processing.


post

public void post()
Called internally by processing.


sendMessage

public void sendMessage(java.lang.String message,
                        java.util.Vector args)
Send an OSC Message

Parameters:
message - the OSC message to send to the default board
args - a vector containing Integers, Floats and Strings to be sent as the argument(s) can be null.

sendMessage

public void sendMessage(Board dest,
                        java.lang.String message,
                        java.util.Vector args)
Send an OSC Message imediately, without adding it to the queue

Parameters:
dest - The board to send the message to
message - The OSC message to send
args - (Can be null): a vector containing Integers, Floats and Strings to be sent as the argument(s)

dispose

public void dispose()
Called Internaly by processing. disposes of socket


getConnectedBoards

public java.util.Vector getConnectedBoards()
Returns a Vector of boards mchelper knows about.


getDefaultBoard

public Board getDefaultBoard()
Returns the default board