use of blue.SoundLayer in project blue by kunstmusik.
the class ScoreTimeCanvas method setPolyObject.
public void setPolyObject(PolyObject pObj, TimeState timeState) {
Component[] components = sObjPanel.getComponents();
for (int i = 0; i < components.length; i++) {
Component c = components[i];
if (c instanceof SoundObjectView) {
SoundObjectView sObjView = (SoundObjectView) c;
sObjView.cleanup();
}
}
sObjPanel.removeAll();
this.soundObjectToViewMap.clear();
marquee.setVisible(false);
if (this.getPolyObject() != null) {
this.timeState.removePropertyChangeListener(this);
this.getPolyObject().removeLayerGroupListener(this);
SoundLayer tempLayer;
for (int i = 0; i < pObj.size(); i++) {
tempLayer = pObj.get(i);
tempLayer.removePropertyChangeListener(heightListener);
tempLayer.removeSoundLayerListener(this);
}
}
this.pObj = pObj;
this.timeState = timeState;
dropTargetListener.setTimeState(timeState);
if (this.getPolyObject() != null) {
timeState.addPropertyChangeListener(this);
pObj.addLayerGroupListener(this);
}
this.automationPanel.setLayerGroup(pObj, timeState);
// content.set(Collections.emptyList(), null);
// TODO - REFACTOR THIS OUT TO POLY OBJECT CONTROLLER
SoundLayer tempLayer;
List<SoundObject> sObjects;
int size = pObj.size();
if (size != 0) {
for (int i = 0; i < size; i++) {
tempLayer = pObj.get(i);
tempLayer.addPropertyChangeListener(heightListener);
tempLayer.addSoundLayerListener(this);
for (SoundObject tempSObj : tempLayer) {
addSoundObjectView(i, tempSObj);
}
}
} else {
JOptionPane.showMessageDialog(null, "ScoreTimeCanvas: setPObj found size == 0");
}
this.checkSize(true);
this.revalidate();
this.repaint();
}
use of blue.SoundLayer in project blue by kunstmusik.
the class SoundObjectLibraryUtils method removeSoundObjectInstances.
protected static void removeSoundObjectInstances(PolyObject polyObject, SoundObject sObj) {
for (int i = 0; i < polyObject.size(); i++) {
SoundLayer layer = polyObject.get(i);
ArrayList<SoundObject> instances = new ArrayList<>();
for (SoundObject tempObject : layer) {
if (tempObject instanceof Instance) {
Instance instance = (Instance) tempObject;
if (instance.getSoundObject() == sObj) {
instances.add(instance);
}
} else if (tempObject instanceof PolyObject) {
removeSoundObjectInstances((PolyObject) tempObject, sObj);
}
}
for (SoundObject tempObject : instances) {
layer.remove(tempObject);
}
}
}
Aggregations