Skip to content

Commit

Permalink
Add getters
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamindehli committed May 24, 2024
1 parent 7a75649 commit 85914b7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/classes/Keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ export class Keyboard {
getFirstColorItem() {
return this.childElements.find((childElement) => childElement instanceof Color);
}
getColorItemByIndex(index) {
return this.getColorItems()[index];
}
addColorItem(props) {
this.childElements.push(new Color(props, "group", this.hierarchyPath));
}
Expand Down
6 changes: 6 additions & 0 deletions src/classes/Modulators.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ export class Modulators {
!!childElement?.init && childElement.init(decentSampler);
});
}
getChildElements() {
return this.childElements;
}
getChildElementByIndex(index) {
return this.childElements[index];
}
getLfoItems() {
return this.childElements?.filter((childElement) => childElement instanceof Lfo);
}
Expand Down

0 comments on commit 85914b7

Please sign in to comment.