Search in sources :

Example 6 with SoundLayer

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());
}
Also used : BlueData(blue.BlueData) Score(blue.score.Score) GenericScore(blue.soundObject.GenericScore) SoundObject(blue.soundObject.SoundObject) Instance(blue.soundObject.Instance) SoundLayer(blue.SoundLayer) SoundObjectLibrary(blue.SoundObjectLibrary) GenericScore(blue.soundObject.GenericScore) PolyObject(blue.soundObject.PolyObject) Test(org.junit.Test)

Example 7 with SoundLayer

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);
}
Also used : SoundLayer(blue.SoundLayer) ArrayList(java.util.ArrayList) ScoreObject(blue.score.ScoreObject) GenericScore(blue.soundObject.GenericScore) SoundLayer(blue.SoundLayer) Layer(blue.score.layers.Layer) Test(org.junit.Test)

Example 8 with SoundLayer

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);
}
Also used : SoundLayer(blue.SoundLayer) ArrayList(java.util.ArrayList) ScoreObject(blue.score.ScoreObject) GenericScore(blue.soundObject.GenericScore) SoundLayer(blue.SoundLayer) Layer(blue.score.layers.Layer) Test(org.junit.Test)

Example 9 with SoundLayer

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();
}
Also used : SoundLayer(blue.SoundLayer)

Example 10 with SoundLayer

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();
}
Also used : JScrollPane(javax.swing.JScrollPane) Score(blue.score.Score) GenericScore(blue.soundObject.GenericScore) SoundLayer(blue.SoundLayer) InstanceContent(org.openide.util.lookup.InstanceContent) GenericScore(blue.soundObject.GenericScore) AbstractLookup(org.openide.util.lookup.AbstractLookup) PolyObject(blue.soundObject.PolyObject) Before(org.junit.Before)

Aggregations

SoundLayer (blue.SoundLayer)27 SoundObject (blue.soundObject.SoundObject)10 PolyObject (blue.soundObject.PolyObject)9 Point (java.awt.Point)8 Layer (blue.score.layers.Layer)6 Instance (blue.soundObject.Instance)6 BlueData (blue.BlueData)5 ScoreObject (blue.score.ScoreObject)5 GenericScore (blue.soundObject.GenericScore)5 ArrayList (java.util.ArrayList)5 Score (blue.score.Score)3 AddScoreObjectEdit (blue.ui.core.score.undo.AddScoreObjectEdit)3 Test (org.junit.Test)3 SoundObjectLibrary (blue.SoundObjectLibrary)2 ScoreObjectLayer (blue.score.layers.ScoreObjectLayer)2 Parameter (blue.automation.Parameter)1 LinePoint (blue.components.lines.LinePoint)1 BlueSynthBuilder (blue.orchestra.BlueSynthBuilder)1 External (blue.soundObject.External)1 NoteList (blue.soundObject.NoteList)1