Search in sources :

Example 1 with SoundObjectProvider

use of blue.ui.core.score.layers.SoundObjectProvider in project blue by kunstmusik.

the class ScoreObjectEditorTopComponent method resultChanged.

@Override
public void resultChanged(LookupEvent ev) {
    if (!(TopComponent.getRegistry().getActivated() instanceof SoundObjectProvider)) {
        return;
    }
    Collection<? extends ScoreObject> scoreObjects = result.allInstances();
    if (scoreObjects.size() == 1) {
        SwingUtilities.invokeLater(() -> {
            BlueData data = BlueProjectManager.getInstance().getCurrentBlueData();
            ScoreObject sObj = scoreObjects.iterator().next();
            if (sObj instanceof PolyObject && data.getSoundObjectLibrary().contains(sObj)) {
                PolyObject pObj = (PolyObject) sObj;
                ScoreController.getInstance().editLayerGroup(pObj);
                editScoreObject(null);
            } else {
                editScoreObject(sObj);
            }
        });
    // FIXME - figure out how to discern if editing is from BlueLive...
    } else {
        SwingUtilities.invokeLater(() -> {
            editScoreObject(null);
        });
    }
}
Also used : SoundObjectProvider(blue.ui.core.score.layers.SoundObjectProvider) BlueData(blue.BlueData) ScoreObject(blue.score.ScoreObject) PolyObject(blue.soundObject.PolyObject)

Aggregations

BlueData (blue.BlueData)1 ScoreObject (blue.score.ScoreObject)1 PolyObject (blue.soundObject.PolyObject)1 SoundObjectProvider (blue.ui.core.score.layers.SoundObjectProvider)1