Package soundtrap.xml

Class SoundTrapXMLTools

java.lang.Object
soundtrap.xml.SoundTrapXMLTools

public class SoundTrapXMLTools extends Object
  • Constructor Details

    • SoundTrapXMLTools

      public SoundTrapXMLTools()
  • Method Details

    • findSourceSampleRate

      public static Integer findSourceSampleRate(NodeList cfgNodes, Node node)
      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

      public static String findChildValue(Node node, String childName)
      Get the string value of a child node
      Parameters:
      node - parent node
      childName - child name
      Returns:
      String value or null
    • findIntegerChildValue

      public static Integer findIntegerChildValue(Node node, String childName)
      Get the Integer value of a child node
      Parameters:
      node - parent node
      childName - child name
      Returns:
      Integer value or null
    • findIntegerChildAttribute

      public static Integer findIntegerChildAttribute(Node node, String childName, String attribute)
      Get an Integer value for the given attribute of a named child node
      Parameters:
      node - parent node
      childName - child node name
      attribute - attribute name
      Returns:
      Integer value or null
    • findChildAttribute

      public static String findChildAttribute(Node node, String childName, String attribute)
      Get an String value for the given attribute of a named child node
      Parameters:
      node - parent node
      childName - child node name
      attribute - attribute name
      Returns:
      String value or null
    • findIntegerAttribute

      public static Integer findIntegerAttribute(Node node, String attribute)
      Get a named attribute from a node.
      Parameters:
      node - parent node
      attribute - attribute name
      Returns:
      Integer value or null
    • findAttribute

      public static String findAttribute(Node node, String attribute)
      Get a named attribute from a node.
      Parameters:
      node - parent node
      attribute - attribute name
      Returns:
      String value or null
    • findChildNode

      public static Node findChildNode(Node node, String childName)
      Find a child node by name
      Parameters:
      node - parent node
      childName - child node name
      Returns:
      Child node or null
    • findNodeById

      public static Node findNodeById(NodeList nodes, int id)
      Find a node by it's ID
      Parameters:
      nodes - node list
      id - id to search for
      Returns:
      found node or null.
    • findNodeById

      public static Node findNodeById(NodeList nodes, String id)
      Find a node by it's ID
      Parameters:
      nodes - node list
      id - id to search for
      Returns:
      found node or null.
    • findNodeByProc

      public static Node findNodeByProc(NodeList nodes, String procName)
      Find a node with a given PROC name.
      Parameters:
      nodes - node list
      procName - PROC name
      Returns:
      a node or null.
    • findNodeWithChildValue

      public 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 value
      Parameters:
      nodes - node list
      childName - child name
      childValue - child value.
      Returns:
      found node or null