use of blue.SoundLayer in project blue by kunstmusik.
the class SoundObjectLibraryUtilsTest method testRemoveLibrarySoundObject.
/**
* Test of removeLibrarySoundObject method, of class SoundObjectLibraryUtils.
*/
@Test
public void testRemoveLibrarySoundObject() {
BlueData data = new BlueData();
Score score = data.getScore();
PolyObject polyObj = new PolyObject(true);
score.add(polyObj);
SoundObjectLibrary library = data.getSoundObjectLibrary();
SoundLayer layer = polyObj.newLayerAt(0);
SoundObject sObj = new GenericScore();
SoundObject sObj2 = new GenericScore();
PolyObject pObjInner = new PolyObject(true);
SoundLayer layerInner = pObjInner.newLayerAt(0);
layerInner.add(new Instance(sObj));
layer.add(new Instance(sObj));
layer.add(new Instance(sObj));
layer.add(new Instance(sObj));
layer.add(sObj2);
layer.add(pObjInner);
library.add(sObj);
assertEquals(5, layer.size());
assertEquals(1, library.size());
assertEquals(1, layerInner.size());
SoundObjectLibraryUtils.removeLibrarySoundObject(data, sObj);
assertEquals(2, layer.size());
assertEquals(0, library.size());
assertEquals(0, layerInner.size());
}
use of blue.SoundLayer in project blue by kunstmusik.
the class MoveScoreObjectsListenerTest method testGetMaxYAdjust.
/**
* Test of getMaxYAdjust method, of class MoveScoreObjectsListener.
*/
@Test
public void testGetMaxYAdjust() {
System.out.println("getMaxYAdjust");
List<Layer> layers = new ArrayList<>();
final SoundLayer soundLayer = new SoundLayer();
ScoreObject scoreObj = new GenericScore();
soundLayer.add((SoundObject) scoreObj);
layers.add(new SoundLayer());
layers.add(soundLayer);
layers.add(new SoundLayer());
int sObjLayerIndex = 1;
int result = MoveScoreObjectsListener.getMaxYAdjust(layers, scoreObj, sObjLayerIndex);
assertEquals(1, result);
layers.add(0, new InvalidLayer());
layers.add(1, new SoundLayer());
layers.add(new InvalidLayer());
sObjLayerIndex = 3;
result = MoveScoreObjectsListener.getMaxYAdjust(layers, scoreObj, sObjLayerIndex);
assertEquals(1, result);
}
use of blue.SoundLayer in project blue by kunstmusik.
the class MoveScoreObjectsListenerTest method testGetMinYAdjust.
/**
* Test of getMinYAdjust method, of class MoveScoreObjectsListener.
*/
@Test
public void testGetMinYAdjust() {
System.out.println("getMinYAdjust");
List<Layer> layers = new ArrayList<>();
final SoundLayer soundLayer = new SoundLayer();
ScoreObject scoreObj = new GenericScore();
soundLayer.add((SoundObject) scoreObj);
layers.add(new SoundLayer());
layers.add(soundLayer);
layers.add(new SoundLayer());
int sObjLayerIndex = 1;
int result = MoveScoreObjectsListener.getMinYAdjust(layers, scoreObj, sObjLayerIndex);
assertEquals(-1, result);
layers.add(0, new InvalidLayer());
layers.add(1, new SoundLayer());
layers.add(new InvalidLayer());
sObjLayerIndex = 3;
result = MoveScoreObjectsListener.getMinYAdjust(layers, scoreObj, sObjLayerIndex);
assertEquals(-2, result);
}
use of blue.SoundLayer in project blue by kunstmusik.
the class LayersPanel method layersAdded.
public void layersAdded(LayerGroupDataEvent e) {
int index = e.getStartIndex();
SoundLayer sLayer = pObj.get(index);
SoundLayerPanel panel = new SoundLayerPanel(sLayer, npcMap);
this.add(panel, index);
checkSize();
revalidate();
}
use of blue.SoundLayer in project blue by kunstmusik.
the class ScoreControllerTest method setUp.
@Before
public void setUp() {
System.out.println("@Before setUp");
this.scoreController = ScoreController.getInstance();
scoreController.setScrollPane(new JScrollPane());
InstanceContent content = new InstanceContent();
Score score = new Score();
scoreController.setScore(score);
PolyObject pObj = (PolyObject) score.get(0);
SoundLayer layer1 = new SoundLayer();
SoundLayer layer2 = new SoundLayer();
pObj.add(layer1);
pObj.add(layer2);
GenericScore score1 = new GenericScore();
score1.setStartTime(2.0f);
GenericScore score2 = new GenericScore();
score2.setStartTime(4.0f);
layer2.add(score1);
layer2.add(score2);
content.add(score);
content.add(score1);
content.add(score2);
scoreController.setLookupAndContent(new AbstractLookup(content), content);
this.buffer = scoreController.getScoreObjectBuffer();
}
Aggregations