detect volume and tone pots

This commit is contained in:
Branislav Stojkovic
2019-03-02 12:31:02 +01:00
parent b3497cdca8
commit bc0d759d39
8 changed files with 168 additions and 21 deletions
@@ -247,6 +247,9 @@ public class Tree {
if (p1 == null || p2 == null)
return null;
if (p1 == p2)
return p1;
if (p1 != p2)
return this;
@@ -272,6 +275,20 @@ public class Tree {
return findCommonParent(t.get(0), findCommonParent(remainder));
}
public Tree findParent(Tree t) {
if (children == null)
return null;
if (children.contains(t))
return this;
for (Tree c : children)
{
Tree p = c.findParent(t);
if (p != null)
return p;
}
return null;
}
public boolean contains(Tree t) {
if (this == t)
return true;