Package soundtrap.xml
Class SoundTrapXMLTools
java.lang.Object
soundtrap.xml.SoundTrapXMLTools
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
findAttribute
(Node node, String attribute) Get a named attribute from a node.static String
findChildAttribute
(Node node, String childName, String attribute) Get an String value for the given attribute of a named child nodestatic Node
findChildNode
(Node node, String childName) Find a child node by namestatic String
findChildValue
(Node node, String childName) Get the string value of a child nodestatic Integer
findIntegerAttribute
(Node node, String attribute) Get a named attribute from a node.static Integer
findIntegerChildAttribute
(Node node, String childName, String attribute) Get an Integer value for the given attribute of a named child nodestatic Integer
findIntegerChildValue
(Node node, String childName) Get the Integer value of a child nodestatic Node
findNodeById
(NodeList nodes, int id) Find a node by it's IDstatic Node
findNodeById
(NodeList nodes, String id) Find a node by it's IDstatic Node
findNodeByProc
(NodeList nodes, String procName) Find a node with a given PROC name.static Node
findNodeWithChildValue
(NodeList nodes, String childName, String childValue) Find a node which has a child with a given name with that child having a given valuestatic Integer
findSourceSampleRate
(NodeList cfgNodes, Node node) Find the source sample rate for a node.
-
Constructor Details
-
SoundTrapXMLTools
public SoundTrapXMLTools()
-
-
Method Details
-
findSourceSampleRate
Find the source sample rate for a node.This function iterates back through the source list until if finds something with a sample rate or returns null.
- Parameters:
node
- starting node.- Returns:
- sample rate or null
-
findChildValue
Get the string value of a child node- Parameters:
node
- parent nodechildName
- child name- Returns:
- String value or null
-
findIntegerChildValue
Get the Integer value of a child node- Parameters:
node
- parent nodechildName
- child name- Returns:
- Integer value or null
-
findIntegerChildAttribute
Get an Integer value for the given attribute of a named child node- Parameters:
node
- parent nodechildName
- child node nameattribute
- attribute name- Returns:
- Integer value or null
-
findChildAttribute
Get an String value for the given attribute of a named child node- Parameters:
node
- parent nodechildName
- child node nameattribute
- attribute name- Returns:
- String value or null
-
findIntegerAttribute
Get a named attribute from a node.- Parameters:
node
- parent nodeattribute
- attribute name- Returns:
- Integer value or null
-
findAttribute
Get a named attribute from a node.- Parameters:
node
- parent nodeattribute
- attribute name- Returns:
- String value or null
-
findChildNode
Find a child node by name- Parameters:
node
- parent nodechildName
- child node name- Returns:
- Child node or null
-
findNodeById
Find a node by it's ID- Parameters:
nodes
- node listid
- id to search for- Returns:
- found node or null.
-
findNodeById
Find a node by it's ID- Parameters:
nodes
- node listid
- id to search for- Returns:
- found node or null.
-
findNodeByProc
Find a node with a given PROC name.- Parameters:
nodes
- node listprocName
- PROC name- Returns:
- a node or null.
-
findNodeWithChildValue
Find a node which has a child with a given name with that child having a given value- Parameters:
nodes
- node listchildName
- child namechildValue
- child value.- Returns:
- found node or null
-