audio nodes store engine reference

This commit is contained in:
DaniTheSkunk 2022-10-13 06:06:23 +00:00
parent 6c9aa03341
commit e2d039f380
1 changed files with 7 additions and 1 deletions

View File

@ -1,6 +1,7 @@
package com.danitheskunk.skunkworks.audio.nodes; package com.danitheskunk.skunkworks.audio.nodes;
import com.danitheskunk.skunkworks.audio.AudioBuffer; import com.danitheskunk.skunkworks.audio.AudioBuffer;
import com.danitheskunk.skunkworks.audio.AudioEngine;
public abstract class Node { public abstract class Node {
private int inCount; private int inCount;
@ -8,8 +9,9 @@ public abstract class Node {
private boolean[] isOutConnected; private boolean[] isOutConnected;
private Node[] inConnections; private Node[] inConnections;
private int[] inConnectionSlots; private int[] inConnectionSlots;
private AudioEngine engine;
public Node(int inCount, int outCount) { public Node(AudioEngine engine, int inCount, int outCount) {
this.inCount = inCount; this.inCount = inCount;
this.outCount = outCount; this.outCount = outCount;
this.isOutConnected = new boolean[outCount]; this.isOutConnected = new boolean[outCount];
@ -40,6 +42,10 @@ public abstract class Node {
dst.inConnectionSlots[dstSlot] = srcSlot; dst.inConnectionSlots[dstSlot] = srcSlot;
} }
public AudioEngine getEngine() {
return engine;
}
public int getInCount() { public int getInCount() {
return inCount; return inCount;
} }