public class NodeEvent
extends de.sciss.app.BasicEvent
Modifier and Type | Field and Description |
---|---|
static int |
END
returned by getID() : the node was destroyed
|
static int |
GO
returned by getID() : the node was created
|
static int |
GROUP
returned by getType() : the node is a group
|
static int |
INFO
returned by getID() : the event was created by a /n_query command
|
static int |
MOVE
returned by getID() : the node has moved
|
static int |
OFF
returned by getID() : the node was paused
|
static int |
ON
returned by getID() : the node was resumed
|
static int |
SYNTH
returned by getType() : the node is a synth
|
static int |
UNKNOWN
returned by getType() : the node type is unknown
|
source
Modifier | Constructor and Description |
---|---|
protected |
NodeEvent(Object source,
int ID,
long when,
Node node,
int nodeID,
int parentID,
int predID,
int succID,
int nodeType,
int headID,
int tailID)
Constructs a
NodeEvent from a detailed description. |
Modifier and Type | Method and Description |
---|---|
static NodeEvent |
fromOSCMessage(de.sciss.net.OSCMessage msg,
Object source,
long when) |
static NodeEvent |
fromOSCMessage(de.sciss.net.OSCMessage msg,
Object source,
long when,
Node node)
Constructs a
NodeEvent from a valid node
notification OSC message. |
int |
getHeadNodeID() |
static int |
getIDFromOSCMessage(de.sciss.net.OSCMessage msg)
Queries the event ID which would be used if the event was
generated from a provided OSC message.
|
Node |
getNode() |
int |
getNodeID() |
int |
getNodeType() |
int |
getOldParentGroupID() |
int |
getOldPredNodeID() |
int |
getOldSuccNodeID() |
int |
getParentGroupID() |
int |
getPredNodeID() |
int |
getSuccNodeID() |
int |
getTailNodeID() |
static List |
getValidOSCCommands()
Returns a list of strings describing
all known OSC command names that form
valid node notification messages, that is
"/n_go" , "/n_end" etc. |
boolean |
incorporate(de.sciss.app.BasicEvent oldEvent)
Used by the
EventManager to
fuse successive events together when they queue. |
getSource, toString
public static final int GO
public static final int END
public static final int ON
public static final int OFF
public static final int MOVE
public static final int INFO
public static final int SYNTH
public static final int GROUP
public static final int UNKNOWN
protected NodeEvent(Object source, int ID, long when, Node node, int nodeID, int parentID, int predID, int succID, int nodeType, int headID, int tailID)
NodeEvent
from a detailed description.
Note that the provided node (which may be null
) is considered
not to be up-to-date, it is examined to fill in the old-fields (oldParentID,
oldPredID) etc. It will be returned by
getNode
. The caller is responsible for updating the node's
fields accordingly, after processing the event.source
- who fired the eventID
- the type of status change, e.g. GO
when
- timestamp of the event (e.g. System.currentTimeMillis()
)node
- the representation of the node whose status changednodeID
- the ID of the node whose status changedparentID
- the ID of the node's parent grouppredID
- the node's predecessor or -1succID
- the node's successor or -1nodeType
- either of GROUP
or SYNTH
headID
- (for groups) ID of the group's head (first) nodetailID
- (for groups) ID of the group's tail (last) nodepublic static NodeEvent fromOSCMessage(de.sciss.net.OSCMessage msg, Object source, long when, Node node)
NodeEvent
from a valid node
notification OSC message. The provided node object is simply
stored for future reference through getNode
and must
be updated by the caller according to the returned event.msg
- OSC message such as /n_go
source
- who shall be known as the source of the generated eventwhen
- what is proposed time of the event generationnode
- a client side representation node to use for the event,
or null
if no representation is known. The caller is
responsible for updating the node's status from the returned
event.IllegalArgumentException
- if the message doesn't contain a valid node message; you
can use getIDFromOSCMessage
to determine if the
message is valid.public static NodeEvent fromOSCMessage(de.sciss.net.OSCMessage msg, Object source, long when)
public static int getIDFromOSCMessage(de.sciss.net.OSCMessage msg)
msg
- the message to parse-1
if the message command
is not in the list of valid notification commandspublic Node getNode()
null
if the client side object is not known. in this case, use getNodeID
to query the node's identifier.public int getNodeID()
public int getParentGroupID()
getNode
returns a valid node, you can also use getParentGroup
on the
returned node.public int getOldParentGroupID()
-1
, if the node was not placed in a group.public int getPredNodeID()
-1
if there is no predecessor. Note that if getNode
returns a valid node, you can also use getPredNode
on the
returned node.public int getOldPredNodeID()
-1
if there was no predecessor.public int getOldSuccNodeID()
-1
if there was no successor.public int getSuccNodeID()
-1
if there is no successor. Note that if getNode
returns a valid node, you can also use getSuccNode
on the
returned node.public int getNodeType()
SYNTH
or GROUP
.
other values might be returned if a new version of supercollider introduces
other node classes.public int getHeadNodeID()
-1
. Note that if getNode
returns a valid group, you can also use getHeadNode
on the
returned group.public int getTailNodeID()
-1
. Note that if getNode
returns a valid group, you can also use getTailNode
on the
returned group.public static List getValidOSCCommands()
"/n_go"
, "/n_end"
etc.
The returned list is immutable.String
, each element
corresponding to a valid OSC command. Note that the element index
reflects the event IDs, so returnedList.get( GO ) == "/n_go"
etc.public boolean incorporate(de.sciss.app.BasicEvent oldEvent)
EventManager
to
fuse successive events together when they queue.
Do not call this method.incorporate
in class de.sciss.app.BasicEvent
Copyright © 2015–2022 SciJava. All rights reserved.