public class MuseGestureServer
extends java.lang.Object
implements oscP5.OscEventListener
MuseGestureServer
class is used to run methods on objects
that implement MuseGestures, whenever an action is performed.Constructor and Description |
---|
MuseGestureServer(MuseGestures listener,
int port)
Initializes a
MuseGestureServer with the given listener
object and port. |
Modifier and Type | Method and Description |
---|---|
MuseGestures |
getListener()
Returns the listener object of the MuseGestureServer.
|
boolean |
isRunning()
Returns whether or not the MuseGestureServer is running.
|
void |
onGesture(MuseGesture gesture)
Forwards the received gesture to the listener object.
|
void |
oscEvent(oscP5.OscMessage msg)
Sends the received OscMessage to the GestureAnalyzer.
|
void |
setListener(MuseGestures listener)
Changes the listener object of the MuseGestureServer to the newly
specified object.
|
boolean |
start()
Starts the MuseGestureServer.
|
boolean |
stop()
Stops the MuseGestureServer.
|
public MuseGestureServer(MuseGestures listener, int port)
MuseGestureServer
with the given listener
object and port.listener
- The object that will receive the gesture method calls.port
- The port of the Muse oscP5 server.public boolean start()
true
if the server successfully started, or
false
if it failed to start.public boolean stop()
true
if the server successfully stopped, or
false
if it failed to stop.public boolean isRunning()
true
if the MuseGestureServer is running, or
false
if it is not.public void setListener(MuseGestures listener)
listener
- The new listener object.public MuseGestures getListener()
public void oscEvent(oscP5.OscMessage msg)
oscEvent
in interface oscP5.OscEventListener
msg
- The OscMessage to be sent to the GestureAnalyzer.public void onGesture(MuseGesture gesture)
gesture
- The gesture to forward to the listener.