use of blue.soundObject.SoundObject 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);
}
}
}
use of blue.soundObject.SoundObject in project blue by kunstmusik.
the class SoundObjectLibraryUtils method removeLibrarySoundObject.
public static void removeLibrarySoundObject(BlueData data, SoundObject sObj) {
SoundObjectLibrary library = data.getSoundObjectLibrary();
library.removeSoundObject(sObj);
for (SoundObject tempObj : library) {
if (tempObj instanceof PolyObject) {
removeSoundObjectInstances((PolyObject) tempObj, sObj);
}
}
Score score = data.getScore();
for (LayerGroup layerGroup : score) {
if (layerGroup instanceof PolyObject) {
PolyObject pObj = (PolyObject) layerGroup;
removeSoundObjectInstances(pObj, sObj);
}
}
}
use of blue.soundObject.SoundObject in project blue by kunstmusik.
the class SoundObjectLibraryTopComponent method copyButtonActionPerformed.
// </editor-fold>//GEN-END:initComponents
private void copyButtonActionPerformed(java.awt.event.ActionEvent evt) {
// GEN-FIRST:event_copyButtonActionPerformed
int index = sObjLibTable.getSelectedRow();
if (index != -1) {
SoundObject sObj = sObjLib.getSoundObject(index);
SoundObject tempSObj = sObj.deepCopy();
ScoreController.getInstance().setSelectedScoreObjects(Collections.singleton(tempSObj));
scoreObjectBuffer.clear();
scoreObjectBuffer.scoreObjects.add(tempSObj);
scoreObjectBuffer.layerIndexes.add(0);
}
}
Aggregations